ESE
ESE
Implementation of the {IERC20} interface with automatic vesting mechanism and EIP-2612 permit.
Beneficiary
VestingParams
ConstructorVestingParams
vestingStages
Vesting parameters. Mappings are more gas efficient than arrays.
vestingStagesLength
Info on how many vesting stages there are in total.
TGE
Token generation event.
Initialize
AddVestingBeneficiary
addVestingBeneficiaries
_Adds new vesting beneficiaries to {vestingStages}. Mints new tokens according to {TGEMintShares} variable. Emits {AddVestingBeneficiary} event for each beneficiary.
Parameters
Name | Type | Description |
---|---|---|
stage | uint256 | - vestingStages index to add beneficiaries for. |
beneficiaries | struct ESE.Beneficiary[] | - Beneficiary structs containing beneficiaries's addresses and vesting amounts. |
Note: Can only be called in an unitialized state by {_initializer}. |
initialize
Initializes this contract. Token transfers are not available until TGE timestamp. Emits {Initialize} event.
Parameters
Name | Type | Description |
---|---|---|
_TGE | uint256 | - Token generation timestamp in the future. Set to 0 to initialize immediately. |
Note: Can only be called in an unitialized state by {_initializer}. |
totalVestedAmount
Info on how many tokens have already been vested during the specified stage in total.
vestedAmount
Info on how many tokens have already been vested during the specified stage for account.
totalSupply
See {IERC20-totalSupply}.
balanceOf
See {IERC20-balanceOf}.
Inherited from ERC20Burnable
burn
_Destroys amount
tokens from the caller.
See {ERC20-burn}.
burnFrom
_Destroys amount
tokens from account
, deducting from the caller's allowance.
See {ERC20-_burn} and {ERC20-allowance}.
Requirements:
the caller must have allowance for
accounts
's tokens of at leastamount
._
Inherited from ERC20Permit
permit
_Sets value
as the allowance of spender
over owner
's tokens, given owner
's signed approval.
IMPORTANT: The same issues {IERC20-approve} has related to transaction ordering also apply here.
Emits an {Approval} event.
Requirements:
spender
cannot be the zero address.deadline
must be a timestamp in the future.v
,r
ands
must be a validsecp256k1
signature fromowner
over the EIP712-formatted function arguments.the signature must use
owner
's current nonce (see {nonces}).
For more information on the signature format, see the https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP section].
CAUTION: See Security Considerations above._
nonces
_Returns the current nonce for owner
. This value must be included whenever a signature is generated for {permit}.
Every successful call to {permit} increases owner
's nonce by one. This prevents a signature from being used multiple times._
DOMAIN_SEPARATOR
Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.
Inherited from EIP712
eip712Domain
_See {EIP-5267}.
Available since v4.9._
Inherited from IERC5267
EIP712DomainChanged
MAY be emitted to signal that the domain could have changed.
Inherited from ERC20
name
Returns the name of the token.
symbol
Returns the symbol of the token, usually a shorter version of the name.
decimals
_Returns the number of decimals used to get its user representation. For example, if decimals
equals 2
, a balance of 505
tokens should be displayed to a user as 5.05
(505 / 10 ** 2
).
Tokens usually opt for a value of 18, imitating the relationship between Ether and Wei. This is the default value returned by this function, unless it's overridden.
NOTE: This information is only used for display purposes: it in no way affects any of the arithmetic of the contract, including {IERC20-balanceOf} and {IERC20-transfer}._
transfer
_See {IERC20-transfer}.
Requirements:
to
cannot be the zero address.the caller must have a balance of at least
amount
._
allowance
See {IERC20-allowance}.
approve
_See {IERC20-approve}.
NOTE: If amount
is the maximum uint256
, the allowance is not updated on transferFrom
. This is semantically equivalent to an infinite approval.
Requirements:
spender
cannot be the zero address._
transferFrom
_See {IERC20-transferFrom}.
Emits an {Approval} event indicating the updated allowance. This is not required by the EIP. See the note at the beginning of {ERC20}.
NOTE: Does not update the allowance if the current allowance is the maximum uint256
.
Requirements:
from
andto
cannot be the zero address.from
must have a balance of at leastamount
.the caller must have allowance for
from
's tokens of at leastamount
._
increaseAllowance
_Atomically increases the allowance granted to spender
by the caller.
This is an alternative to {approve} that can be used as a mitigation for problems described in {IERC20-approve}.
Emits an {Approval} event indicating the updated allowance.
Requirements:
spender
cannot be the zero address._
decreaseAllowance
_Atomically decreases the allowance granted to spender
by the caller.
This is an alternative to {approve} that can be used as a mitigation for problems described in {IERC20-approve}.
Emits an {Approval} event indicating the updated allowance.
Requirements:
spender
cannot be the zero address.spender
must have allowance for the caller of at leastsubtractedValue
._
Inherited from IERC20
Transfer
_Emitted when value
tokens are moved from one account (from
) to another (to
).
Note that value
may be zero._
Approval
Emitted when the allowance of a spender
for an owner
is set by a call to {approve}. value
is the new allowance.
Last updated