OpenZeppelin’s Blog post
https://blog.openzeppelin.com/deconstructing-a-solidity-contract-part-ii-creation-vs-runtime-6b9d60ecb44c
PUSH
88 PUSH1 0x04
| | |
| | Hex value for push.
| Opcode.
Instruction number.
PUSH1 vs PUSH2
| Opcode | Meaning | Bytes Pushed | Value Range |
|---|---|---|---|
PUSH1 |
Push 1 byte (8 bits) | 1 byte | 0x00 to 0xff (0 to 255 in decimal) |
PUSH2 |
Push 2 bytes (16 bits) | 2 bytes | 0x0000 to 0xffff (0 to 65535 in decimal) |
JUMPJUMPIJUMPDESTRETURNSTOPSWAP2
stack[-1]) with the third-from-top element (stack[-3])SSTORE (opcode 0x55) writes a value into the contract’s persistent storage.0x15 (decimal 21)1 (true) if the input is zero0 (false) otherwiseEthereum Stack Exchange+5Pushes a single value onto the EVM stack: the length of calldata in bytes.
Calldata consists of a “function id”, which is generated by hashing the function’s signature (truncated to the first leading four bytes) followed by the packed arguments data. That is ,
Calldata is the read-only byte array that includes:
function transfer(address to, uint amount) external;
a9059cbb // function selector (transfer), got by applying keccak256(totalSupply())
000000000000000000000000deadbeef... // address to
000000000000000000000000000000000000000000000000000000000000003e // amount
// This calldata would be 4 (selector) + 32 + 32 = 68 bytes, or 0x44