Skip to main content
Helpful?

IERC20Minimal

Git Source - Generated with forge doc

Contains a subset of the full ERC20 interface that is used in Uniswap V3

Functions

balanceOf

Returns an account's balance in the token

function balanceOf(address account) external view returns (uint256);

Parameters

NameTypeDescription
accountaddressThe account for which to look up the number of tokens it has, i.e. its balance

Returns

NameTypeDescription
<none>uint256The number of tokens held by the account

transfer

Transfers the amount of token from the msg.sender to the recipient

function transfer(address recipient, uint256 amount) external returns (bool);

Parameters

NameTypeDescription
recipientaddressThe account that will receive the amount transferred
amountuint256The number of tokens to send from the sender to the recipient

Returns

NameTypeDescription
<none>boolReturns true for a successful transfer, false for an unsuccessful transfer

allowance

Returns the current allowance given to a spender by an owner

function allowance(address owner, address spender) external view returns (uint256);

Parameters

NameTypeDescription
owneraddressThe account of the token owner
spenderaddressThe account of the token spender

Returns

NameTypeDescription
<none>uint256The current allowance granted by owner to spender

approve

Sets the allowance of a spender from the msg.sender to the value amount

function approve(address spender, uint256 amount) external returns (bool);

Parameters

NameTypeDescription
spenderaddressThe account which will be allowed to spend a given amount of the owners tokens
amountuint256The amount of tokens allowed to be used by spender

Returns

NameTypeDescription
<none>boolReturns true for a successful approval, false for unsuccessful

transferFrom

Transfers amount tokens from sender to recipient up to the allowance given to the msg.sender

function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);

Parameters

NameTypeDescription
senderaddressThe account from which the transfer will be initiated
recipientaddressThe recipient of the transfer
amountuint256The amount of the transfer

Returns

NameTypeDescription
<none>boolReturns true for a successful transfer, false for unsuccessful

Events

Transfer

Event emitted when tokens are transferred from one address to another, either via #transfer or #transferFrom.

event Transfer(address indexed from, address indexed to, uint256 value);

Parameters

NameTypeDescription
fromaddressThe account from which the tokens were sent, i.e. the balance decreased
toaddressThe account to which the tokens were sent, i.e. the balance increased
valueuint256The amount of tokens that were transferred

Approval

Event emitted when the approval amount for the spender of a given owner's tokens changes.

event Approval(address indexed owner, address indexed spender, uint256 value);

Parameters

NameTypeDescription
owneraddressThe account that approved spending of its tokens
spenderaddressThe account for which the spending allowance was modified
valueuint256The new allowance from the owner to the spender
Helpful?