0xcalldata

ERC-20 function

approve(address,uint256)

Sets how many ERC-20 tokens a spender may transfer from the caller’s account.

Selector
0x095ea7b3
Mutability
nonpayable

Generate approve calldata

Edit the example inputs to rebuild the bytes instantly in your browser. Nothing is sent and no transaction is submitted.

address
uint256
calldata68 bytes
sel0x095ea7b3
approve(address,uint256)
0x000000000000000000000000003333333333333333333333333333333333333333
spender · address =0x33333333…333333
0x200000000000000000000000000000000000000000000000000de0b6b3a7640000
amount · uint256 =1000000000000000000

How approve works

Calling approve replaces the spender’s current allowance with the encoded amount; it does not add that amount to the existing allowance.

The approved owner is msg.sender and therefore does not appear in calldata. The spender can later use transferFrom within the available allowance.

Parameters

NameSolidity typeMeaning
spenderaddressAddress authorized to spend the caller’s tokens.
amountuint256New allowance in raw token base units; zero revokes it.

Return value

A boolean success value that callers must handle.

bool result

Return data comes back after execution and is not included in the calldata above.

View all ERC-20 functions →