ABI Encode

ABI & calldata

ABI encoder

Encode a Solidity function call into calldata from its signature and arguments, or encode raw parameters with abi.encode / abi.encodePacked. Arrays and tuples as JSON.

runs in your browser
try
calldata
0xa9059cbb000000000000000000000000d8da6bf26964af9d7eed9e10e64ac1e5d8d0d0450000000000000000000000000000000000000000000000000de0b6b3a7640000
selector
0xa9059cbb
canonical signature
transfer(address,uint256)
send it with cast
cast send <contract> "transfer(address,uint256)" 0xd8da6bf26964af9d7eed9e10e64ac1e5d8d0d045 1000000000000000000

good to know

abi.encode vs abi.encodePacked?

abi.encode pads every value to 32 bytes and is unambiguous. encodePacked uses the minimum bytes and no length prefixes, so two dynamic values next to each other can collide: never hash packed dynamic values for signatures or ids.

how do i pass arrays and structs?

one argument per line. arrays and tuples are json: [1, 2, 3] or ["0xabc…", 5]. big numbers can be plain digits, no quotes needed.