Solidity Interface & Canonical Declaration
function addLiquidity(address tokenA, address tokenB, uint256 amountADesired, uint256 amountBDesired, uint256 amountAMin, uint256 amountBMin, address to, uint256 deadline) external returns (uint256 amountA, uint256 amountB, uint256 liquidity)
Adds liquidity to an ERC-20⇄ERC-20 pool and mints LP tokens to the provider.
Theoretical Base Gas: 140,000 ~ 210,000 gas
Return Type: (uint256,uint256,uint256)
Calldata ABI Memory & Parameter Offset Layout
| Calldata Offset | Type | Parameter Name | Semantic Role |
|---|---|---|---|
| 0x00 ~ 0x03 (4B) | bytes4 | Method ID (msg.sig) | Function Selector for addLiquidity(address,address,uint256,uint256,uint256,uint256,address,uint256) |
| 0x04 ~ 0x23 (32B) | address | tokenA | First pool asset |
| 0x24 ~ 0x43 (32B) | address | tokenB | Second pool asset |
| 0x44 ~ 0x63 (32B) | uint256 | amountADesired | Target amount of tokenA to deposit |
| 0x64 ~ 0x83 (32B) | uint256 | amountBDesired | Target amount of tokenB to deposit |
| 0x84 ~ 0xa3 (32B) | uint256 | amountAMin | Bounds the minimum tokenA deposited |
| 0xa4 ~ 0xc3 (32B) | uint256 | amountBMin | Bounds the minimum tokenB deposited |
| 0xc4 ~ 0xe3 (32B) | address | to | Recipient of liquidity tokens |
| 0xe4 ~ 0x103 (32B) | uint256 | deadline | Expiry timestamp |
Cryptographic Keccak-256 Derivation Proof
Canonical ASCII Signature String: addLiquidity(address,address,uint256,uint256,uint256,uint256,address,uint256)
Full 256-bit Keccak-256 Digest: 0xe8e337003368fc77c2595d117bb98b627132bf8afacee71c7334a2a489802c4c
Sliced First 4 Bytes (Big-Endian): 0xe8e33700
EVM Runtime Function Dispatcher Assembly (Opcodes)
// 1. Load the first 32 bytes of transaction calldata
[0x0000] PUSH1 0x00
[0x0002] CALLDATALOAD
// 2. Right-shift by 224 bits (0xe0) to isolate the 4-byte selector
[0x0003] PUSH1 0xe0
[0x0005] SHR
// 3. Match against target selector 0xe8e33700 and branch
[0x0006] DUP1
[0x0007] PUSH4 0xe8e33700
[0x000c] EQ
[0x000d] PUSH2 0x0050
[0x0010] JUMPI // Jump to implementation if matched