Skip to content

Commit 76920d7

Browse files
committed
Fixes
1 parent 3043a3e commit 76920d7

File tree

5 files changed

+17
-35
lines changed

5 files changed

+17
-35
lines changed

app/models/erc721_ethscriptions_collection_parser.rb

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,3 @@ def build_sync_ownership_values(data)
361361
[data['collection_id'], data['ethscription_ids']]
362362
end
363363
end
364-
365-
# Legacy alias for previous class name
366-
CollectionsParamsExtractor = Erc721EthscriptionsCollectionParser
367-
ERC721EthscriptionsCollectionParamsExtractor = Erc721EthscriptionsCollectionParser

app/services/eth_block_importer.rb

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -383,15 +383,11 @@ def import_single_block(block_number)
383383
ValidationJob.perform_later(block_number, l2_block_hashes)
384384
end
385385

386-
# Removed noisy per-block timing logs
387-
388386
ImportProfiler.stop("import_single_block")
389387

390388
[imported_ethscriptions_blocks, [eth_block]]
391389
end
392390

393-
# Legacy batch import method removed - use import_single_block instead
394-
395391
def import_next_block
396392
block_number = next_block_to_import
397393
import_single_block(block_number)

contracts/src/ERC721EthscriptionsCollectionManager.sol

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -135,12 +135,12 @@ contract ERC721EthscriptionsCollectionManager is IProtocolHandler {
135135
}
136136

137137
/// @notice Handle create_collection operation
138-
function op_create_collection(bytes32 txHash, bytes calldata data) external onlyEthscriptions {
138+
function op_create_collection(bytes32 ethscriptionId, bytes calldata data) external onlyEthscriptions {
139139
// Decode the operation data directly into CollectionMetadata
140140
CollectionMetadata memory metadata = abi.decode(data, (CollectionMetadata));
141141

142142
// Use the ethscription hash as the collection ID
143-
bytes32 collectionId = txHash;
143+
bytes32 collectionId = ethscriptionId;
144144

145145
// Check if collection already exists
146146
require(collectionState[collectionId].collectionContract == address(0), "Collection already exists");
@@ -165,7 +165,7 @@ contract ERC721EthscriptionsCollectionManager is IProtocolHandler {
165165
// Store collection state
166166
collectionState[collectionId] = CollectionState({
167167
collectionContract: address(collectionProxy),
168-
createEthscriptionId: txHash,
168+
createEthscriptionId: ethscriptionId,
169169
currentSize: 0,
170170
locked: false
171171
});
@@ -179,10 +179,10 @@ contract ERC721EthscriptionsCollectionManager is IProtocolHandler {
179179
}
180180

181181
/// @notice Handle add_items_batch operation with full metadata
182-
function op_add_items_batch(bytes32 txHash, bytes calldata data) external onlyEthscriptions {
182+
function op_add_items_batch(bytes32 ethscriptionId, bytes calldata data) external onlyEthscriptions {
183183
// Get who is trying to add items
184184
Ethscriptions ethscriptionsContract = Ethscriptions(ethscriptions);
185-
Ethscriptions.Ethscription memory ethscription = ethscriptionsContract.getEthscription(txHash);
185+
Ethscriptions.Ethscription memory ethscription = ethscriptionsContract.getEthscription(ethscriptionId);
186186
address sender = ethscription.creator;
187187

188188
AddItemsBatchOperation memory addOp = abi.decode(data, (AddItemsBatchOperation));
@@ -242,14 +242,14 @@ contract ERC721EthscriptionsCollectionManager is IProtocolHandler {
242242
collection.currentSize++;
243243
}
244244

245-
emit ItemsAdded(addOp.collectionId, addOp.items.length, txHash);
245+
emit ItemsAdded(addOp.collectionId, addOp.items.length, ethscriptionId);
246246
}
247247

248248
/// @notice Handle remove_items operation
249-
function op_remove_items(bytes32 txHash, bytes calldata data) external onlyEthscriptions {
249+
function op_remove_items(bytes32 ethscriptionId, bytes calldata data) external onlyEthscriptions {
250250
// Get who is trying to remove items
251251
Ethscriptions ethscriptionsContract = Ethscriptions(ethscriptions);
252-
Ethscriptions.Ethscription memory ethscription = ethscriptionsContract.getEthscription(txHash);
252+
Ethscriptions.Ethscription memory ethscription = ethscriptionsContract.getEthscription(ethscriptionId);
253253
address sender = ethscription.creator;
254254

255255
// Decode the operation data
@@ -283,13 +283,13 @@ contract ERC721EthscriptionsCollectionManager is IProtocolHandler {
283283
collection.currentSize--;
284284
}
285285

286-
emit ItemsRemoved(removeOp.collectionId, removeOp.ethscriptionIds.length, txHash);
286+
emit ItemsRemoved(removeOp.collectionId, removeOp.ethscriptionIds.length, ethscriptionId);
287287
}
288288

289289
/// @notice Handle edit_collection operation
290-
function op_edit_collection(bytes32 txHash, bytes calldata data) external onlyEthscriptions {
290+
function op_edit_collection(bytes32 ethscriptionId, bytes calldata data) external onlyEthscriptions {
291291
Ethscriptions ethscriptionsContract = Ethscriptions(ethscriptions);
292-
Ethscriptions.Ethscription memory ethscription = ethscriptionsContract.getEthscription(txHash);
292+
Ethscriptions.Ethscription memory ethscription = ethscriptionsContract.getEthscription(ethscriptionId);
293293
address sender = ethscription.creator;
294294

295295
EditCollectionOperation memory editOp = abi.decode(data, (EditCollectionOperation));
@@ -315,9 +315,9 @@ contract ERC721EthscriptionsCollectionManager is IProtocolHandler {
315315
}
316316

317317
/// @notice Handle edit_collection_item operation
318-
function op_edit_collection_item(bytes32 txHash, bytes calldata data) external onlyEthscriptions {
318+
function op_edit_collection_item(bytes32 ethscriptionId, bytes calldata data) external onlyEthscriptions {
319319
Ethscriptions ethscriptionsContract = Ethscriptions(ethscriptions);
320-
Ethscriptions.Ethscription memory ethscription = ethscriptionsContract.getEthscription(txHash);
320+
Ethscriptions.Ethscription memory ethscription = ethscriptionsContract.getEthscription(ethscriptionId);
321321
address sender = ethscription.creator;
322322

323323
EditCollectionItemOperation memory editOp = abi.decode(data, (EditCollectionItemOperation));
@@ -347,10 +347,10 @@ contract ERC721EthscriptionsCollectionManager is IProtocolHandler {
347347
}
348348

349349
/// @notice Handle lock_collection operation
350-
function op_lock_collection(bytes32 txHash, bytes calldata data) external onlyEthscriptions {
350+
function op_lock_collection(bytes32 ethscriptionId, bytes calldata data) external onlyEthscriptions {
351351
// Get the ethscription details from the Ethscriptions contract
352352
Ethscriptions ethscriptionsContract = Ethscriptions(ethscriptions);
353-
Ethscriptions.Ethscription memory ethscription = ethscriptionsContract.getEthscription(txHash);
353+
Ethscriptions.Ethscription memory ethscription = ethscriptionsContract.getEthscription(ethscriptionId);
354354
address sender = ethscription.creator; // Who sent this lock operation
355355

356356
// Decode just the collection ID
@@ -371,7 +371,7 @@ contract ERC721EthscriptionsCollectionManager is IProtocolHandler {
371371

372372
/// @notice Handle sync_ownership operation to sync ERC721 ownership with Ethscription ownership
373373
/// @dev Requires specifying the collection ID to sync for, to avoid iterating over unbounded user data
374-
function op_sync_ownership(bytes calldata data) external onlyEthscriptions {
374+
function op_sync_ownership(bytes32 ethscriptionId, bytes calldata data) external onlyEthscriptions {
375375
// User must specify which collection to sync for
376376
// Decode the operation: collection ID + ethscription IDs to sync
377377
(bytes32 collectionId, bytes32[] memory ethscriptionIds) = abi.decode(data, (bytes32, bytes32[]));

lib/erc20_fixed_denomination_reader.rb

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -124,13 +124,6 @@ def self.get_token_item(ethscription_tx_hash, block_tag: 'latest')
124124
nil
125125
end
126126

127-
# Legacy compatibility - mints aren't tracked by ID in ERC20FixedDenominationManager
128-
def self.get_mint(tick, mint_id, block_tag: 'latest')
129-
# This would need to be reimplemented if mint tracking by ID is needed
130-
# For now, return nil as ERC20FixedDenominationManager doesn't support this
131-
nil
132-
end
133-
134127
def self.mint_exists?(tick, mint_id, block_tag: 'latest')
135128
# ERC20FixedDenominationManager doesn't track mints by tick+id
136129
false

lib/protocol_event_reader.rb

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,10 @@ class ProtocolEventReader
88
'ProtocolHandlerSuccess' => 'ProtocolHandlerSuccess(bytes32,string,bytes)',
99
'ProtocolHandlerFailed' => 'ProtocolHandlerFailed(bytes32,string,bytes)',
1010

11-
# ERC20FixedDenominationManager.sol events (including legacy aliases)
11+
# ERC20FixedDenominationManager.sol events
1212
'ERC20FixedDenominationTokenDeployed' => 'ERC20FixedDenominationTokenDeployed(bytes32,address,string,uint256,uint256)',
1313
'ERC20FixedDenominationTokenMinted' => 'ERC20FixedDenominationTokenMinted(bytes32,address,uint256,bytes32)',
1414
'ERC20FixedDenominationTokenTransferred' => 'ERC20FixedDenominationTokenTransferred(bytes32,address,address,uint256,bytes32)',
15-
'FixedFungibleTokenDeployed' => 'FixedFungibleTokenDeployed(bytes32,address,string,uint256,uint256)',
16-
'FixedFungibleTokenMinted' => 'FixedFungibleTokenMinted(bytes32,address,uint256,bytes32)',
17-
'FixedFungibleTokenTransferred' => 'FixedFungibleTokenTransferred(bytes32,address,address,uint256,bytes32)',
1815

1916
# CollectionsManager.sol events
2017
# CollectionsManager.sol events (match actual signatures)

0 commit comments

Comments
 (0)