Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

3
  • 3
    "calldata is used and persists throughout the transaction" - I think I know what you meant here, but this is msleading. calldataload will load different data depending on the call frame, and will persist for an individual call frame, but not to the next call frame. E.g. if EOA calls function a on contract A, and contract A calls function b on contract B, the calldataload will no longer load the EOA's call data and will instead load the data used in the sub-call frame. Commented Feb 28, 2019 at 17:11
  • I see. I will update the answer accordingly. If function a on contract A calls function b on contract A, the calldataload will still be the EOA's call data, correct? Commented Mar 1, 2019 at 19:44
  • 2
    It depends how it's called, either through a jump (local call, i.e. just doing b()) or through a message call (message call, i.e. this.b(). The latter, in Solidity, will change the calldataload, but the former wont. In Vyper, AFAIK, all calls to local functions (i.e. both this.b() and b()) create a message call so calldataload will change. Commented Mar 1, 2019 at 22:05