Skip to content

Latest commit

 

History

History
52 lines (37 loc) · 1.8 KB

3E.mdx

File metadata and controls

52 lines (37 loc) · 1.8 KB
fork group
Byzantium
Environmental Information

Index 1 is top of the stack. See PUSH.

Notes

A sub context can be created with CALL, CALLCODE, DELEGATECALL or STATICCALL.

Stack input

  1. destOffset: byte offset in the memory where the result will be copied.
  2. offset: byte offset in the return data from the last executed sub context to copy.
  3. size: byte size to copy.

Examples

Return data
0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
* Input 1 * * Input 2
1 0 * 1 32
2 0 * 2 31
3 32 * 3 1
Memory before
0
Memory after input 1
0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
Memory after input 1 then 2
0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF

[Reproduce in playground][1]

[1]: /playground?unit=Wei&codeType=Mnemonic&code='jCKVthat%20cK(wich%20return-32%20Z7F7ggggggggggFJ_Z6Q527F6Q526020.!_Zq06020526029.0064_Breatef(withfVcod)above77JJzCREATE%20jPutsfnew%20(addres-onfstackBallfdeployed%20XJJJJzDUP584%200xgzSTATICCALLBlearfstackzPOPzPOPBlearfmemoryJJ_J!J64_zG1!JJWG2131!W'81%20z%5CnqQQQj%2F%2F%20g***f%20th)_zMSTOREZ832%200xXcontractWzRETURNDATACOPYzVconstructor%20Q000Kreate-a%20J0GzjExampl)BzzjC8zPUSH.6QF3qqqq-s%20FF)e%20(X%20!~32%01!()-.8BGJKQVWXZ_fgjqz

Error cases

The state changes done by the current context are reverted in those cases:

  • Not enough gas.
  • Not enough values on the stack.
  • The addition offset + size overflows.
  • offset + size is larger than RETURNDATASIZE.