This contract is responsible for managing tokens, such as setting locking token balances, or setting flow limits, for interchain transfers.
error TokenLinkerZeroAddress()
error NotService(address caller)
error TakeTokenFailed()
error GiveTokenFailed()
error NotToken(address caller)
error ZeroAddress()
error AlreadyFlowLimiter(address flowLimiter)
error NotFlowLimiter(address flowLimiter)
error NotSupported()
function implementationType() external view returns (uint256)
Returns implementation type of this token manager.
Name | Type | Description |
---|---|---|
[0] | uint256 | uint256 The implementation type of this token manager. |
function addFlowIn(uint256 amount) external
function addFlowOut(uint256 amount) external
function addFlowLimiter(address flowLimiter) external
This function adds a flow limiter for this TokenManager.
Can only be called by the operator.
Name | Type | Description |
---|---|---|
flowLimiter | address | the address of the new flow limiter. |
function removeFlowLimiter(address flowLimiter) external
This function removes a flow limiter for this TokenManager.
Can only be called by the operator.
Name | Type | Description |
---|---|---|
flowLimiter | address | the address of an existing flow limiter. |
function isFlowLimiter(address addr) external view returns (bool)
Query if an address is a flow limiter.
Name | Type | Description |
---|---|---|
addr | address | The address to query for. |
Name | Type | Description |
---|---|---|
[0] | bool | bool Boolean value representing whether or not the address is a flow limiter. |
function setFlowLimit(uint256 flowLimit_) external
This function sets the flow limit for this TokenManager.
Can only be called by the flow limiters.
Name | Type | Description |
---|---|---|
flowLimit_ | uint256 | The maximum difference between the tokens flowing in and/or out at any given interval of time (6h). |
function approveService() external
A function to renew approval to the service if we need to.
function params(bytes operator_, address tokenAddress_) external pure returns (bytes params_)
Getter function for the parameters of a lock/unlock TokenManager.
This function will be mainly used by frontends.
Name | Type | Description |
---|---|---|
operator_ | bytes | The operator of the TokenManager. |
tokenAddress_ | address | The token to be managed. |
Name | Type | Description |
---|---|---|
params_ | bytes | The resulting params to be passed to custom TokenManager deployments. |
function mintToken(address tokenAddress_, address to, uint256 amount) external
External function to allow the service to mint tokens through the tokenManager
This function should revert if called by anyone but the service.
Name | Type | Description |
---|---|---|
tokenAddress_ | address | The address of the token, since its cheaper to pass it in instead of reading it as the token manager. |
to | address | The recipient. |
amount | uint256 | The amount to mint. |
function burnToken(address tokenAddress_, address from, uint256 amount) external
External function to allow the service to burn tokens through the tokenManager
This function should revert if called by anyone but the service.
Name | Type | Description |
---|---|---|
tokenAddress_ | address | The address of the token, since its cheaper to pass it in instead of reading it as the token manager. |
from | address | The address to burn the token from. |
amount | uint256 | The amount to burn. |