Skip to content
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

Simulation: debug_traceCall: make mint and burn simulation possible #1087

Open
wants to merge 20 commits into
base: v2
Choose a base branch
from

Conversation

JIOjosBG
Copy link
Member

@JIOjosBG JIOjosBG commented Nov 11, 2024

Resolves:

our debug_traceCall used to determine if a LOG4 event is nft transfer by checking if the nft has tokenURI, the problem was this operation fails when we execute it with the onchain state, because if the token is not yet minted - the contract reverts with something along the lines of invalid tokenID

This PR introduces additional transaction simulation during evaluation of the received events from debug_traceCall.

Edit:
second problem - if the simulation has two unminted nfts from one collection and the current accountOp mints one of them, the second one might still revert on ownerOf method call, resulting in both being omitted from the result:
solutions:

  • don't persist such nfts in the hints at all?
  • have a try catch at a lower level in the nft getter contract, allowing more precise fetching

@JIOjosBG JIOjosBG added the bug Something isn't working label Nov 11, 2024
@JIOjosBG JIOjosBG self-assigned this Nov 11, 2024
@JIOjosBG JIOjosBG changed the title Simulation: debug_traceCall: make mint and burn simulation possible via debug_traceCall Simulation: debug_traceCall: make mint and burn simulation possible Nov 13, 2024
contracts/deployless/NFTGetter.sol Show resolved Hide resolved
src/libs/tracer/debugTraceCall.ts Outdated Show resolved Hide resolved
src/libs/portfolio/getOnchainBalances.ts Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants