UnifiERC20.sol
Primary Uses - UnifiERC20.sol essentially ports the properties of ERC-20 tokens on to Unifi LP Tokens, or uTokens. An example of this in practice would be the 'approve' transaction.
uTrade V2 UnifiERC20 Code / Interfaces
uTrade V2 UnifiERC20 Contract Addresses
Each uTrade V2 Liquidity Pool uses the uTrade V2 ERC20 Interface in the contract. An example would be 0x96351b805FB389B761c1318B43a7dC0C679BEd5E
(Link) for the UNIFI / ETH pair.
Events
Approval
The Approval
event is emitted anytime an approve
or permit
function is called.
Transfer
The Transfer
event is emitted anytime a transfer of LP tokens occurs, by the transfer
, transferFrom
, mint
, or burn
functions.
Read-Only Functions
name
The name
function will return "Unifi LPs" for all liquidity pool contracts.
symbol
The symbol
function will return "Unifi-LP" for all liquidity pool contracts.
decimals
The decimals
function returns "18" as a uint8 value, which is the precision for each uToken on uTrade V2.
totalSupply
The totalSupply
function returns the total amount uTokens for a pair.
balanceOf
The balanceOf
function returns the balance of uTokens for the provided address.
allowance
The allowance
function returns the amount of tokens an address is approved to transfer when using the transferFrom
function.
DOMAIN_SEPARATOR
The DOMAIN_SEPARATOR
function is used in the permit
function, and is one of the components that allows transactions to get through without a prior approve transaction. Calling a read function returns the bytes32 data that is required for use in permit
function.
PERMIT_TYPEHASH
The PERMIT_TYPEHASH
function is used in the permit
function, and is one of the components that allows transactions to get through without a prior approve transaction. Calling a read function returns the bytes32 data that is required for use in the permit
function.
nonces
The nonces
function is used in the permit function. It returns the current nonce of the address provided.
State-Changing Functions
approve
The approve
function sets a value for the amount of LP tokens the address provided is allowed to transfer. Returns a boolean value and emits the Approval
event.
transfer
The transfer
function lets an address send uTokens from one address to another, and returns a boolean value and emits a Transfer
event.
transferFrom
The transferFrom
function sends uTokens from one address to another. This requires the sending address to have approval to send uTokens. Returns a boolean value and emits a Transfer
event.
permit
The permit function allows a sender to use a signature in lieu of an approval transaction, and sets the allowance for an address to send.
Function Parameter Breakdown
Interface Code
Last updated