ERC20Extended
Inherits: IERC20Extended, ERC3009
Author: M^0 Labs
State Variables
PERMIT_TYPEHASH
Returns the EIP712 typehash used in the encoding of the digest for the permit function.
Keeping this constant, despite permit
parameter name differences, to ensure max EIP-2612 compatibility. keccak256("Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)")
decimals
Returns the number of decimals UIs should assume all amounts have.
symbol
Returns the symbol of the token.
allowance
Returns the allowance spender
is allowed to spend on behalf of account
.
Functions
constructor
Constructs the ERC20Extended contract.
Parameters
Name | Type | Description |
---|---|---|
|
| The name of the token. |
|
| The symbol of the token. |
|
| The number of decimals the token uses. |
approve
Allows a calling account to approve spender
to spend up to amount
of its token balance.
MUST emit an Approval
event.
Parameters
Name | Type | Description |
---|---|---|
|
| |
|
|
Returns
Name | Type | Description |
---|---|---|
|
| Whether or not the approval was successful. |
permit
Approves spender
to spend up to amount
of the token balance of owner
, via a signature.
Parameters
Name | Type | Description |
---|---|---|
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
permit
Approves spender
to spend up to amount
of the token balance of owner
, via a signature.
Parameters
Name | Type | Description |
---|---|---|
|
| |
|
| |
|
| |
|
| |
|
|
transfer
Allows a calling account to transfer amount
tokens to recipient
.
Parameters
Name | Type | Description |
---|---|---|
|
| |
|
|
Returns
Name | Type | Description |
---|---|---|
|
| Whether or not the transfer was successful. |
transferFrom
Allows a calling account to transfer amount
tokens from sender
, with allowance, to a recipient
.
Parameters
Name | Type | Description |
---|---|---|
|
| |
|
| |
|
|
Returns
Name | Type | Description |
---|---|---|
|
| Whether or not the transfer was successful. |
name
Returns the name of the contract/token.
_approve
Approve spender_
to spend amount_
of tokens from account_
.
Parameters
Name | Type | Description |
---|---|---|
|
| The address approving the allowance. |
|
| The address approved to spend the tokens. |
|
| The amount of tokens being approved for spending. |
_setAllowance
Set the amount_
of tokens spender_
is allowed to spend from account_
.
Parameters
Name | Type | Description |
---|---|---|
|
| The address for which the allowance is set. |
|
| The address allowed to spend the tokens. |
|
| The amount of tokens being allowed for spending. |
_permitAndGetDigest
Performs the approval based on the permit info, validates the deadline, and returns the digest.
Parameters
Name | Type | Description |
---|---|---|
|
| The address of the account approving the allowance. |
|
| The address of the account being allowed to spend the tokens. |
|
| The amount of tokens being approved for spending. |
|
| The deadline by which the signature must be used. |
Returns
Name | Type | Description |
---|---|---|
|
| The EIP-712 digest of the permit. |