IERC20Minimal
IERC20Minimal
Contains a subset of the full ERC20 interface that is used in DragonswapV2
Functionsโ
balanceOfโ
Returns the balance of a token
Parameters:โ
Name | Type | Description |
---|---|---|
| address | The account for which to look up the number of tokens it has, i.e. its balance |
Return Values:โ
Type | Description |
---|---|
uint256 | number of tokens held by the account |
transferโ
Transfers the amount of token from the msg.sender
to the recipient
Parameters:โ
Name | Type | Description |
---|---|---|
| address | The account that will receive the amount transferred |
| uint256 | The number of tokens to send from the sender to the recipient |
Return Values:โ
Type | Description |
---|---|
bool | true for a successful transfer, false for an unsuccessful transfer |
allowanceโ
Returns the current allowance given to a spender by an owner
Parameters:โ
Name | Type | Description |
---|---|---|
| address | The account of the token owner |
| address | The account of the token spender |
Return Values:โ
Type | Description |
---|---|
uint256 | current allowance granted by |
approveโ
Sets the allowance of a spender from the msg.sender
to the value amount
Parameters:โ
Name | Type | Description |
---|---|---|
| address | The account which will be allowed to spend a given amount of the owners tokens |
| uint256 | The amount of tokens allowed to be used by |
Return Values:โ
Type | Description |
---|---|
bool | 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
Parameters:โ
Name | Type | Description |
---|---|---|
| address | The account from which the transfer will be initiated |
| address | The recipient of the transfer |
| uint256 | The amount of the transfer |
Return Values:โ
Type | Description |
---|---|
bool | 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
.
Parameters:โ
Name | Type | Description |
---|---|---|
| address | The account from which the tokens were sent, i.e. the balance decreased |
| address | The account to which the tokens were sent, i.e. the balance increased |
| uint256 | The amount of tokens that were transferred |
Approvalโ
Event emitted when the approval amount for the spender of a given owner's tokens changes.
Parameters:โ
Name | Type | Description |
---|---|---|
| address | The account that approved spending of its tokens |
| address | The account for which the spending allowance was modified |
| uint256 | The new allowance from the owner to the spender |
Last updated