UniversalTokenLib

Git Source

State Variables

ETH_ADDRESS

address internal constant ETH_ADDRESS = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE;

Functions

universalTransfer

Transfers tokens to the given account. Reverts if transfer is not successful.

This might trigger fallback, if ETH is transferred to the contract. Make sure this can not lead to reentrancy attacks.

function universalTransfer(address token, address to, uint256 value) internal;

universalApproveInfinity

Issues an infinite allowance to the spender, if the current allowance is insufficient to spend the given amount.

Note: this can potentially lead to executing code in to.

function universalApproveInfinity(address token, address spender, uint256 amountToSpend) internal;

universalBalanceOf

Returns the balance of the given token (or native ETH) for the given account.

function universalBalanceOf(address token, address account) internal view returns (uint256);

assertIsContract

Checks that token is a contract and not ETH_ADDRESS.

function assertIsContract(address token) internal view;