-
Notifications
You must be signed in to change notification settings - Fork 7
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
Feature: Process ERC-721 information #19
Conversation
const erc20Deposit = await this.handlePayload(input, block, ctx); | ||
if (erc20Deposit) { | ||
this.depositStorage.set(inputId, erc20Deposit); | ||
ctx.log.info(`${inputId} (Erc20Deposit) stored`); | ||
input.erc20Deposit = erc20Deposit; | ||
} | ||
|
||
input.erc721Deposit = await this.prepareErc721Deposit( |
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.
this block of code stayed a little bit different from the token handling above. Is there a way to make it more uniform?
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 the handlePayload()
deserves a bit of refactoring following the steps of prepareErc721Deposit
in a separate PR. When I started, I did add the logic inside it. I would return an object with a return like {erc721Deposit: ERC20 } | {erc20Deposit: NFT}
so it would be mutually exclusive because the msgSender
is 1:1. Also, I was not fond of the duplication on checking if it exists than store/log/assign. I prefer to separate and have a method to take care of everything at once and leave the handle()
to control and glue for the Input
. That is for the context where I am coming from. I can create an issue and refactor that in a separate branch.
94d6846
to
d6f236b
Compare
Summary
Code changes to support indexing information from ERC-721 deposits coming from ERC721Portal contract
I created an ERC-721 contract and deployed it on Sepolia to transfer and see the real thing going through.
Contract Address: 0x7a3Cc9c0408887a030A0354330C36a9cd681AA7E
OpenSea: testnet/collection
PS: Now honeypot has a NFT on Sepolia, cartesiScan/apps
Changelog: