Appendix C. Ethereum EVM Opcodes and Gas Consumption
This appendix is based on the consolidation work done by the people of https://github.com/trailofbits/evm-opcodes as a reference for Ethereum VM (EVM) opcodes and instruction information licensed under the Apache License 2.0.
| Opcode | Name | Description | Extra info | Gas |
|---|---|---|---|---|
|
|
Halts execution |
- |
0 |
|
|
Addition operation |
- |
3 |
|
|
Multiplication operation |
- |
5 |
|
|
Subtraction operation |
- |
3 |
|
|
Integer division operation |
- |
5 |
|
|
Signed integer division operation (truncated) |
- |
5 |
|
|
Modulo remainder operation |
- |
5 |
|
|
Signed modulo remainder operation |
- |
5 |
|
|
Modulo addition operation |
- |
8 |
|
|
Modulo multiplication operation |
- |
8 |
|
|
Exponential operation |
- |
10*** |
|
|
Extend length of two’s complement signed integer |
- |
5 |
|
Unused |
Unused |
- |
|
|
|
Less-than comparison |
- |
3 |
|
|
Greater-than comparison |
- |
3 |
|
|
Signed less-than comparison |
- |
3 |
|
|
Signed greater-than comparison |
- |
3 |
|
|
Equality comparison |
- |
3 |
|
|
Simple NOT operator |
- |
3 |
|
|
Bitwise AND operation |
- |
3 |
|
|
Bitwise OR operation |
- |
3 |
|
|
Bitwise XOR operation |
- |
3 |
|
|
Bitwise NOT operation |
- |
3 |
|
|
Retrieve single byte from word |
- |
3 |
|
Unused |
Unused |
- |
|
|
|
Compute Keccak-256 hash |
- |
30 |
|
Unused |
Unused |
- |
|
|
|
Get address of currently ... |
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access