EVM Threat Models

Opcodes, precompiles & protocol-level attack surfaces

Per-opcode and per-precompile security analysis covering smart contract exploitation and infrastructure-relevant protocol threats. Use this page as a jump-off point: the EVM basics section explains execution context, the opcode table links to each threat note, and the precompile table covers every precompiled contract from Frontier through Pectra.

Quick start

Open EVM basics to understand which regions (code, stack, memory, storage, calldata) opcodes read and write, then click an opcode or precompile row below to open its threat note.


FileDescription
0x00-STOPHalt execution
0x01-ADDAddition modulo 2^256
0x02-MULMultiplication modulo 2^256
0x03-SUBSubtraction modulo 2^256
0x04-DIVUnsigned integer division
0x05-SDIVSigned integer division
0x06-MODUnsigned modulus
0x07-SMODSigned modulus
0x08-ADDMODAddition modulo N
0x09-MULMODMultiplication modulo N
0x0A-EXPExponentiation modulo 2^256
0x0B-SIGNEXTENDSign-extend from (b+1) bytes to 32 bytes
0x10-LTUnsigned less-than
0x11-GTUnsigned greater-than
0x12-SLTSigned less-than
0x13-SGTSigned greater-than
0x14-EQEquality
0x15-ISZEROIs zero
0x16-ANDBitwise AND
0x17-ORBitwise OR
0x18-XORBitwise XOR
0x19-NOTBitwise NOT
0x1A-BYTEExtract byte at position i
0x1B-SHLShift left
0x1C-SHRLogical shift right
0x1D-SARArithmetic shift right
0x20-KECCAK256Compute Keccak-256 hash
0x30-ADDRESSAddress of executing contract
0x31-BALANCEBalance in wei (warm/cold access)
0x32-ORIGINTransaction originator address
0x33-CALLERDirect caller address
0x34-CALLVALUEValue sent with call, in wei
0x35-CALLDATALOADRead 32-byte word from calldata
0x36-CALLDATASIZECalldata size in bytes
0x37-CALLDATACOPYCopy calldata to memory
0x38-CODESIZESize of executing contract code
0x39-CODECOPYCopy contract code to memory
0x3A-GASPRICEGas price of transaction
0x3B-EXTCODESIZESize of external contract code
0x3C-EXTCODECOPYCopy external code to memory
0x3D-RETURNDATASIZESize of last call’s return data
0x3E-RETURNDATACOPYCopy return data to memory
0x3F-EXTCODEHASHKeccak-256 of external code
0x40-BLOCKHASHHash of a recent block (last 256)
0x41-COINBASECurrent block proposer address
0x42-TIMESTAMPCurrent block timestamp
0x43-NUMBERCurrent block number
0x44-PREVRANDAORandomness beacon (post-Merge)
0x45-GASLIMITCurrent block gas limit
0x46-CHAINIDCurrent chain ID (EIP-155)
0x47-SELFBALANCEBalance of executing contract
0x48-BASEFEEBase fee of current block (EIP-1559)
0x49-BLOBHASHBlob versioned hash (EIP-4844)
0x4A-BLOBBASEFEEBlob base fee (EIP-7516)
0x50-POPRemove top stack item
0x51-MLOADLoad word from memory
0x52-MSTOREStore word to memory
0x53-MSTORE8Store single byte to memory
0x54-SLOADLoad word from storage
0x55-SSTOREStore word to storage
0x56-JUMPSet PC to dst (must be JUMPDEST)
0x57-JUMPIConditional jump
0x58-PCCurrent program counter
0x59-MSIZESize of active memory in bytes
0x5A-GASRemaining gas
0x5B-JUMPDESTMark valid jump destination
0x5C-TLOADLoad from transient storage (EIP-1153)
0x5D-TSTOREStore to transient storage (EIP-1153)
0x5E-MCOPYCopy memory area (EIP-5656)
0x5F-PUSH0Push zero onto stack (EIP-3855)
0x60-PUSHPush 1–32 bytes from code onto stack
0x80-DUPClone nth stack item to top
0x90-SWAPSwap top with (n+1)th stack item
0xA0-LOGEmit log with 0–4 topics
0xF0-CREATECreate new contract (addr from sender, nonce)
0xF1-CALLCall another contract
0xF2-CALLCODELike DELEGATECALL but doesn’t propagate msg.sender/value
0xF3-RETURNReturn data from memory (or deployed bytecode in CREATE)
0xF4-DELEGATECALLCall with caller’s context
0xF5-CREATE2Create with deterministic address
0xFA-STATICCALLRead-only call (no state modification)
0xFD-REVERTRevert with return data, refund unused gas
0xFE-INVALIDDesignated invalid opcode; consumes all gas
0xFF-SELFDESTRUCTMark contract for destruction, send ETH to addr

Precompile Threat Models

FileGasDescription
0x01-ECRECOVER3,000ECDSA public key recovery from signature
0x02-SHA25660 + 12/wordSHA-256 hash function
0x03-RIPEMD160600 + 120/wordRIPEMD-160 hash function
0x04-IDENTITY15 + 3/wordData copy (identity function)
0x05-MODEXPComplex (EIP-2565)Modular exponentiation
0x06-BN256ADD150alt_bn128 point addition
0x07-BN256MUL6,000alt_bn128 scalar multiplication
0x08-BN256PAIRING45,000 + 34,000/pairalt_bn128 pairing check (zkSNARK verification)
0x09-BLAKE2Frounds × 1BLAKE2b compression function
0x0A-POINT_EVALUATION50,000KZG point evaluation (EIP-4844 blobs)
0x0B-BLS12_G1ADD375BLS12-381 G1 point addition
0x0C-BLS12_G1MSMVariable (discount table)BLS12-381 G1 multi-scalar multiplication
0x0D-BLS12_G2ADD600BLS12-381 G2 point addition
0x0E-BLS12_G2MSMVariable (discount table)BLS12-381 G2 multi-scalar multiplication
0x0F-BLS12_PAIRING_CHECK37,700 + 32,600/pairBLS12-381 pairing check (BLS signature verification)
0x10-BLS12_MAP_FP_TO_G15,500Map field element to G1 point
0x11-BLS12_MAP_FP2_TO_G223,800Map Fp2 element to G2 point