Skip to content

Latest commit

 

History

History
54 lines (38 loc) · 1.8 KB

3C.mdx

File metadata and controls

54 lines (38 loc) · 1.8 KB
fork group
Frontier
Environmental Information

Index 1 is top of the stack. See PUSH.

Notes

For out of bound bytes, 0s will be copied.

Not allowed in EOFv1 code, code containing this instruction will fail validation.

Stack input

  1. address: 20-byte address of the contract to query. If address points to an EOF contract, result is as if its code was EF00.
  2. destOffset: byte offset in the memory where the result will be copied.
  3. offset: byte offset in the code to copy.
  4. size: byte size to copy.

Examples

Code
0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
* Input 1 * * Input 2
1 0x43a61f3f4c73ea0d444c5c1c1a8544067a86219b * 1 0x43a61f3f4c73ea0d444c5c1c1a8544067a86219b
2 0 * 2 0
3 0 * 3 31
4 32 * 4 8
Memory before
0
Memory after input 1
0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
Memory after input 1 then 2
0xFF00000000000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF

Reproduce in playground

Error cases

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

  • Not enough gas.
  • Not enough values on the stack.