Skip to content

[WIP] add ErrorDepth specs#52

Open
lightsing wants to merge 3 commits intomasterfrom
feat/error-depth
Open

[WIP] add ErrorDepth specs#52
lightsing wants to merge 3 commits intomasterfrom
feat/error-depth

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