Solidity API
ERC20Safe
This contract is intended to be used with ERC20Handler contract.
lockERC20
function lockERC20(address tokenAddress, address owner, address recipient, uint256 amount) internal
Used to gain custody of deposited token.
Name | Type | Description |
---|---|---|
tokenAddress | address | Address of ERC20 to transfer. |
owner | address | Address of current token owner. |
recipient | address | Address to transfer tokens to. |
amount | uint256 | Amount of tokens to transfer. |
releaseERC20
function releaseERC20(address tokenAddress, address recipient, uint256 amount) internal
Transfers custody of token to recipient.
Name | Type | Description |
---|---|---|
tokenAddress | address | Address of ERC20 to transfer. |
recipient | address | Address to transfer tokens to. |
amount | uint256 | Amount of tokens to transfer. |
mintERC20
function mintERC20(address tokenAddress, address recipient, uint256 amount) internal
Used to create new ERC20s.
Name | Type | Description |
---|---|---|
tokenAddress | address | Address of ERC20 to transfer. |
recipient | address | Address to mint token to. |
amount | uint256 | Amount of token to mint. |
burnERC20
function burnERC20(address tokenAddress, address owner, uint256 amount) internal
Used to burn ERC20s.
Name | Type | Description |
---|---|---|
tokenAddress | address | Address of ERC20 to burn. |
owner | address | Current owner of tokens. |
amount | uint256 | Amount of tokens to burn. |
_safeTransfer
function _safeTransfer(contract IERC20 token, address to, uint256 value) private
used to transfer ERC20s safely
Name | Type | Description |
---|---|---|
token | contract IERC20 | Token instance to transfer |
to | address | Address to transfer token to |
value | uint256 | Amount of token to transfer |
_safeTransferFrom
function _safeTransferFrom(contract IERC20 token, address from, address to, uint256 value) private
used to transfer ERC20s safely
Name | Type | Description |
---|---|---|
token | contract IERC20 | Token instance to transfer |
from | address | Address to transfer token from |
to | address | Address to transfer token to |
value | uint256 | Amount of token to transfer |
_safeCall
function _safeCall(contract IERC20 token, bytes data) private
used to make calls to ERC20s safely
Name | Type | Description |
---|---|---|
token | contract IERC20 | Token instance call targets |
data | bytes | encoded call data |