-
-
Notifications
You must be signed in to change notification settings - Fork 806
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
Deployable bytecode attempts to access calldata #1399
Comments
@Pet3ris the default |
Hi @jacqueswww - this is precisely why I'm asking. According to the yellow paper, contract creation transactions come with empty calldata: In section "Contract Creation", the specific environment set-up is listed here (note that The Solidity convention is to embed constructor arguments as part of the original bytecode that gets passed during contract creation ( Has Vyper adopted a different convention where the contract call assumes constructor arguments are passed during the contract creation phase? |
@Pet3ris I don't think we use anything different, also you can check our tests also show we use standard web3 to deploy and test init. given example program: val: public(uint256)
@public
def __init__(a: uint256):
self.val = a Check the IR output (-if ir):
Specifically:
Seems to be in order ? ( I realise I answered incorrectly about calldata copying at first, sorry!). |
Looking at the above |
@jacqueswww thanks a lot for the clarification and clearly wrong to assume you're violating the spec :) |
@Pet3ris No problem! Great catch! So I just did a fix:
Looks much better :) (calldata load for the function), nothing for the init. |
Did a PR if you want to check it out :) |
Nice! |
Hi There,
I'm trying to understand vyper constructor usage patterns. When compiling the example Vyper erc20 contract, the output (deployed) bytecode looks like this:
The second opcode
0x35
isCALLDATALOAD
. Given that in the EVM specification, contract creation calls assumecalldata == []
, how is calldata used in this case?In Solidity, a comparable example would not include
CALLDATALOAD
in the executable part of deployed bytecode, reserving it instead for the runtime bytecode portion.Let me know if I'm misunderstanding!
The text was updated successfully, but these errors were encountered: