-
Notifications
You must be signed in to change notification settings - Fork 154
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
evm: emit Transfer events on L1 deposits #3410
evm: emit Transfer events on L1 deposits #3410
Conversation
metadata, err := isc.IRC27NFTMetadataFromBytes(nft.Metadata) | ||
if err != nil { | ||
panic(errEVMCanNotDecodeERC27Metadata) | ||
} | ||
|
||
addr := iscmagic.ERC721NFTCollectionAddress(nft.ID) | ||
state := emulator.NewStateDBFromKVStore(emulator.StateDBSubrealm(store)) | ||
state := emulator.NewStateDBFromKVStore(evm.EmulatorStateSubrealm(evmState)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this was a bug because it was calling emulator.StateDBSubrealm() twice (once here and again inside NewStateDBFromKVStore.
I'm not sure about the implications of the bug, I think the erc721 contract was being stored under some bogus key. I also don't know how this affects the production instances.
erc721CollectionContractAddress := iscmagic.ERC721NFTCollectionAddress(collectionID) | ||
stateDB := emulator.NewStateDB(newEmulatorContext(ctx)) | ||
if stateDB.Exist(erc721CollectionContractAddress) { | ||
logs = append(logs, makeTransferEvent(erc721CollectionContractAddress, addr, iscmagic.WrapNFTID(nftID).TokenID())) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
won't this produce 2 events if the NFT belongs to a collection? I think it should only produce 1 event (from the collection contract)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it produces 2 events. I'm not sure what is the expected behavior; I guessed it was like this but I can change it if it's wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
only 1 event should be produced IMO
c4926ad
to
a606d80
Compare
No description provided.