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

feat: add error traces for vvm #373

Open
wants to merge 11 commits into
base: master
Choose a base branch
from

Conversation

AlbertoCentonze
Copy link
Collaborator

@AlbertoCentonze AlbertoCentonze commented Jan 20, 2025

What I did

Added basic support for error traces on vvm based contracts, the implementation assumes that the compiler output is the one generated by Vyper 0.3.10. Hopefully it won't be required to support older versions.

How I did it

  • Added source maps and and source code to VVMDeployer
  • Created a new class VVMContract that references source maps and source code through a pointer to the deployer.
  • VVMContract has a stack_trace function that behaves similarly to the one in ABIContract or VyperContract, the function:
    • Use source maps to find the line where the error happened.
    • Use vyper.utils.annotate_source_code to prettify the error line.
    • Returns the value that then is correctly handled by BoaError when something reverts.

How to verify it

Run unit tests.

Description for the changelog

as per title

@AlbertoCentonze AlbertoCentonze marked this pull request as ready for review January 24, 2025 17:50
@AlbertoCentonze AlbertoCentonze changed the title error traces wip feat: add error traces for vvm Jan 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant