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

[WIP] add ErrorDepth specs #52

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

[WIP] add ErrorDepth specs #52

wants to merge 3 commits into from

Conversation

lightsing
Copy link
Member

No description provided.

[FQ(Opcode.CALL), FQ(Opcode.CALLCODE), FQ(Opcode.DELEGATECALL), FQ(Opcode.STATICCALL)]
)

is_call, is_callcode, is_delegatecall, is_staticcall = instruction.multiple_select(

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't need to check it is call or call code etc.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but CALL and CALLCODE will consume 7 stack elements and DELEGATECALL and STATICCALL will consume 6 elements


# check the call depth
depth = instruction.call_context_lookup(CallContextFieldTag.Depth)
instruction.constrain_equal(depth, FQ(1025))

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be 1024 because current look up is for caller's depth

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.

2 participants