Technical Reference
Functions Write
PayForFreeTokenLocks
Permits to pay a once off fee to have free use of the lockers for the token.
Parameters:
_token
address
The address of the token to be locked for free.
EditZeroFeeWhitelist
Callable by UNCX_ADMINS or whitelisted contracts.
Parameters:
_token
address
The address of the token to be added or removed from the whitelist.
_add
bool
Indicates if the token should be added (true) or removed (false) from the whitelist.
Lock
Creates one or multiple locks for the specified token.
Parameters:
LockParams
An object that contains: owner
(address), amount
(uint256), startEmission
(uint256), endEmission
(uint256), and condition
(address).
Withdraw
Withdraws a specified amount from a lock.
Parameters:
_lockID
uint256
The ID of the lock from which tokens will be withdrawn.
_amount
uint256
The desired amount of tokens to be withdrawn.
Relock
Extends a lock with a new unlock date, if lock is Type 2 it extends the emission end date.
Parameters:
_lockID
uint256
The ID of the lock which needs to have its unlock date extended.
_unlock_date
uint256
The new unlock date. If the lock is Type 2, this extends the emission end date.
IncrementLock
Increases the amount of tokens per a specific lock.
Parameters:
_lockID
uint256
The ID of the lock which will have its token amount increased.
_amount
uint256
The amount of additional tokens to be added to the specified lock.
TransferLockOwnership
Transfers a lock to a new owner.
Parameters:
_lockID
uint256
The ID of the lock whose ownership will be transferred.
_newOwner
address payable
The address of the new owner to whom the lock will be transferred.
SplitLock
Splits a lock into two seperate locks.
Parameters:
_lockID
uint256
The ID of the lock which will be split.
_amount
uint256
The amount in tokens which will form one part of the split lock.
Migrate
Migrates to the next locker version.
Parameters:
_lockID
uint256
The ID of the lock which will be migrated to the next locker version.
_option
uint256
An option for migration. The exact meaning would depend on the migration logic.
RevokeCondition
Revokes premature unlock conditions.
Parameters:
_lockID
uint256
The ID of the lock whose premature unlock condition will be revoked.
Functions View
TestCondition
Parameters:
condition
address
The condition's address to test on the frontend UI.
Return Values:
bool
The result of the condition tested in the frontend UI.
GetWithdrawableShares
Parameters:
_lockID
uint256
The ID of the lock for which shares are being queried.
Return Values:
uint256
The withdrawable share amount from the lock.
GetWithdrawableTokens
Parameters:
_lockID
uint256
The ID of the lock for which tokens are being queried.
Return Values:
uint256
The current amount in tokens that can be withdrawn.
ConvertSharesToTokens
Parameters:
_token
address
The token's address.
_shares
uint256
The number of shares to convert.
Return Values:
uint256
The equivalent amount of tokens for the provided shares.
convertTokensToShares
Parameters:
_token
address
The token's address.
_tokens
uint256
The number of tokens to convert.
Return Values:
uint256
The equivalent amount of shares for the provided tokens.
GetLock
Parameters:
_lockID
uint256
The ID of the lock being queried.
Return Values:
GetNumLockedTokens
Return Values:
uint256
Number of locked tokens.
GetTokenAtIndex
Parameters:
_index
uint256
The index of the token queried.
Return Values:
address
Token's address at the given index.
GetTokenLocksLength
Parameters:
_token
address
The token's address.
Return Values:
uint256
Token Lock ID at the specified index.
GetTokenLockIDAtIndex
Parameters:
_token
address
The token's address.
_index
uint256
The index of the lock queried.
Return Values:
uint256
Token Lock ID at the specified index.
GetUserLockedTokensLength
Parameters:
_user
address
The user's address queried.
Return Values:
uint256
Number of tokens locked by the user.
GetUserLockedTokenAtIndex
Parameters:
_user
address
The user's address queried.
_index
uint256
The index of the token queried.
Return Values:
address
Token address at the specified index for the user.
GetUserLocksForTokenLength
Parameters:
_user
address
The user's address.
_token
address
The token's address.
Return Values:
uint256
Number of locks for a token for the user.
GetUserLockIDForTokenAtIndex
Parameters:
_user
address
The user's address.
_token
address
The token's address.
_index
uint256
The index of the lock queried.
Return Values:
uint256
Lock ID for a token at the specified index for the user.
GetZeroFeeTokensLength
Return Values:
uint256
Length of no fee tokens.
GetZeroFeeTokenAtIndex
Parameters:
_index
uint256
The index of the token queried.
Return Values:
address
No fee token at the given index.
TokenOnZeroFeeWhitelist
Parameters:
_token
address
The token's address.
Return Values:
bool
Whether the token is on the no fee whitelist.
GetTokenWhitelisterLength
Return Values:
uint256
Length of token whitelisters.
GetTokenWhitelisterAtIndex
Parameters:
_index
uint256
The index of the whitelister queried.
Return Values:
address
Token whitelister at the given index.
GetTokenWhitelisterStatus
Parameters:
_user
address
The user's address whose status is queried.
Return Values:
bool
Whitelister status of the specified user.
Events
OnLock
Parameters:
lockID
uint256
ID of the lock.
token
address
Token address.
owner
address
Address of the lock owner.
amountInTokens
uint256
Amount of tokens in the lock.
amountInShares
uint256
Amount of shares in the lock.
startEmission
uint256
Start time of emission.
endEmission
uint256
End time of emission.
unlockCondition
address
Address of the unlock condition contract.
OnWithdraw
Parameters:
lockID
uint256
ID of the lock.
lpToken
address
LP token address.
amountInTokens
uint256
Amount of tokens withdrawn.
amountInShares
uint256
Amount of shares withdrawn.
OnRelock
Parameters:
lockID
uint256
ID of the lock.
token
address
Token address.
unlockDate
uint256
New unlock date.
OnTransferLock
Parameters:
lockIDFrom
uint256
Original lock ID.
lockIDto
uint256
New lock ID.
oldOwner
address
Original owner of the lock.
newOwner
address
New owner of the lock.
OnSplitLock
Parameters:
fromLockID
uint256
Original lock ID.
toLockID
uint256
New lock ID after split.
amountInTokens
uint256
Amount of tokens in the new lock.
amountInShares
uint256
Amount of shares in the new lock.
OnMigrate
Parameters:
lockID
uint256
ID of the lock being migrated.
amountInTokens
uint256
Amount of tokens being migrated.
OnConditionRevoke
Parameters:
lockID
uint256
ID of the lock.
tokenAddress
address
Token address of the lock.
Last updated