SafeToken.sol
Last updated
Was this helpful?
Last updated
Was this helpful?
View Source:
↗ Extends: ↘ Derived Contracts: , ,
checkTransferIn(address asset, address from, uint256 amount)
doTransferIn(address asset, address from, uint256 amount)
getCash(address asset)
getBalanceOf(address asset, address from)
doTransferOut(address asset, address to, uint256 amount)
doApprove(address asset, address to, uint256 amount)
Checks whether or not there is sufficient allowance for this contract to move amount from from
and whether or not from
has a balance of at least amount
. Does NOT do a transfer.
Arguments
Name
Type
Description
asset
address
from
address
amount
uint256
Similar to EIP20 transfer, except it handles a False result from transferFrom
and returns an explanatory error code rather than reverting. If caller has not called checkTransferIn
, this may revert due to insufficient balance or insufficient allowance. If caller has called checkTransferIn
prior to this call, and it returned Error.NO_ERROR, this should not revert in normal conditions.
Note: This wrapper safely handles non-standard ERC-20 tokens that do not return a value.
Arguments
Name
Type
Description
asset
address
from
address
amount
uint256
Checks balance of this contract in asset
Arguments
Name
Type
Description
asset
address
Checks balance of from
in asset
Arguments
Name
Type
Description
asset
address
from
address
Similar to EIP20 transfer, except it handles a False result from transfer
and returns an explanatory error code rather than reverting. If caller has not called checked protocol's balance, this may revert due to insufficient cash held in this contract. If caller has checked protocol's balance prior to this call, and verified it is >= amount, this should not revert in normal conditions.
Note: This wrapper safely handles non-standard ERC-20 tokens that do not return a value.
Arguments
Name
Type
Description
asset
address
to
address
amount
uint256
Arguments
Name
Type
Description
asset
address
to
address
amount
uint256
See here:
See here: