Skip to content
This repository has been archived by the owner on Jul 5, 2024. It is now read-only.

Commit

Permalink
feat: finish MCOPY spec
Browse files Browse the repository at this point in the history
  • Loading branch information
curryrasul committed Apr 17, 2024
1 parent deff931 commit 929bb70
Showing 1 changed file with 15 additions and 8 deletions.
23 changes: 15 additions & 8 deletions specs/opcode/94MCOPY.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,21 @@ The gas cost of `MCOPY` opcode consists of two parts:

2. State Transition

1.
2.
3.

3. Lookups

1.
2.
- rw_counter += 3 stack_reads + ???
- stack_pointer += 3
- pc += 1
- gas += 3 + dynamic_gas_cost
- reversible_write_counter += 1
- memory_size
- `prev_memory_size` if `size = 0`
- `max(prev_memory_size, (offset + size + 31) / 32)` if `size > 0`

3. Lookups: 4

1. `dest_offset` is at the 1st position of the stack
2. `offset` is at the 2nd position of the stack
3. `size` is at the 3rd position of the stack
4. CopyTable lookup

## Exceptions

Expand Down

0 comments on commit 929bb70

Please sign in to comment.