Skip to main content

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.

NameTypeDescription
tokenAddressaddressAddress of ERC20 to transfer.
owneraddressAddress of current token owner.
recipientaddressAddress to transfer tokens to.
amountuint256Amount of tokens to transfer.

releaseERC20

function releaseERC20(address tokenAddress, address recipient, uint256 amount) internal

Transfers custody of token to recipient.

NameTypeDescription
tokenAddressaddressAddress of ERC20 to transfer.
recipientaddressAddress to transfer tokens to.
amountuint256Amount of tokens to transfer.

mintERC20

function mintERC20(address tokenAddress, address recipient, uint256 amount) internal

Used to create new ERC20s.

NameTypeDescription
tokenAddressaddressAddress of ERC20 to transfer.
recipientaddressAddress to mint token to.
amountuint256Amount of token to mint.

burnERC20

function burnERC20(address tokenAddress, address owner, uint256 amount) internal

Used to burn ERC20s.

NameTypeDescription
tokenAddressaddressAddress of ERC20 to burn.
owneraddressCurrent owner of tokens.
amountuint256Amount of tokens to burn.

_safeTransfer

function _safeTransfer(contract IERC20 token, address to, uint256 value) private

used to transfer ERC20s safely

NameTypeDescription
tokencontract IERC20Token instance to transfer
toaddressAddress to transfer token to
valueuint256Amount of token to transfer

_safeTransferFrom

function _safeTransferFrom(contract IERC20 token, address from, address to, uint256 value) private

used to transfer ERC20s safely

NameTypeDescription
tokencontract IERC20Token instance to transfer
fromaddressAddress to transfer token from
toaddressAddress to transfer token to
valueuint256Amount of token to transfer

_safeCall

function _safeCall(contract IERC20 token, bytes data) private

used to make calls to ERC20s safely

NameTypeDescription
tokencontract IERC20Token instance call targets
databytesencoded call data