Skip to content

Latest commit

 

History

History
39 lines (26 loc) · 1.06 KB

1B.mdx

File metadata and controls

39 lines (26 loc) · 1.06 KB
fork group
Constantinople
Comparison & Bitwise Logic Operations

Index 1 is top of the stack. See PUSH.

Notes

Shift the bits towards the most significant one. The bits moved after the 256th one are discarded, the new bits are set to 0.

Stack input

  1. shift: number of bits to shift to the left.
  2. value: 32 bytes to shift.

Stack output

  1. value << shift: the shifted value. If shift is bigger than 255, returns 0.

Examples

* Input Output
1 1 2
2 1
* Input Output
1 4 0xF000000000000000000000000000000000000000000000000000000000000000
2 0xFF00000000000000000000000000000000000000000000000000000000000000

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.