Skip to content

Latest commit

 

History

History
24 lines (15 loc) · 902 Bytes

59.mdx

File metadata and controls

24 lines (15 loc) · 902 Bytes
fork group
Frontier
Stack Memory Storage and Flow Operations

Index 1 is top of the stack. See PUSH.

Notes

The memory is always fully accessible. What this instruction tracks is the highest offset that was accessed in the current execution. A first write or read to a bigger offset will trigger a memory expansion, which will cost gas. The size is always a multiple of a word (32 bytes).

Stack output

  1. size: current memory size in bytes (higher offset accessed until now + 1).

Example

See in playground

Error cases

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

  • Not enough gas.
  • Stack overflow.