You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Oct 20, 2024. It is now read-only.
A builtin to get the runtime code could make sense, especially with contracts having jumptable / immutable variables. Creation code could also have use cases.
Isn't this already possible with __codesize(MAIN) and __codesize(CONSTRUCTOR)? Would be cool to have a built-in for the sum of the two tho i.e. deploy code, which would be very useful for determining the position of constructor arguments.
Isn't this already possible with __codesize(MAIN) and __codesize(CONSTRUCTOR)? Would be cool to have a built-in for the sum of the two tho i.e. deploy code, which would be very useful for determining the position of constructor arguments.
__codesize(MAIN) + __codesize(CONSTRUCTOR) will work for contracts that do not have a jumptable: they are appended at end of the MAIN bytecode but are not considered part of the MAIN macro leading to differences between __codesize(MAIN) and deploy code.
I agree with you, would be nice to have a built-in for deploy code size.
Interesting idea for the code offset of placeholders !
Oh I see, yeah that'd be helpful. Not to mention __codesize(MAIN) __codesize(CONSTRUCTOR) add costs 9 gas and is 7-bytes vs if it was a single push instruction (3-bytes and 3 gas).
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
A builtin to get the runtime code could make sense, especially with contracts having jumptable / immutable variables. Creation code could also have use cases.
cc @Philogy
First suggested by @Maddiaa0
The text was updated successfully, but these errors were encountered: