UniswapV2Locker (2.1)
Functions Write
LockLPToken
Creates a new lock.
Parameters:
_lpToken
address
The univ2 token address.
_amount
uint256
Amount of LP tokens to lock.
_unlock_date
uint256
The unix timestamp (in seconds) until unlock.
_referral
address
The referrer address if any or address(0) for none.
_fee_in_eth
bool
Fees can be paid in eth or in a secondary token such as UNCX with a discount on univ2 tokens.
_withdrawer
address
The user who can withdraw liquidity once the lock expires.
_countryCode
uint16
The code of the country from which the lock user account/business is from.
Relock
Extends a lock with a new unlock date.
Parameters:
_lockID
uint256
The ID of the lock to be extended.
_unlock_date
uint256
The new unix timestamp (in seconds) until unlock. This must be greater than the current one.
Withdraw
Withdraws a specified amount from a lock.
Parameters:
_lockID
uint256
ID associated with the specific locked tokens.
_amount
uint256
Amount of tokens the user wishes to withdraw.
IncrementLock
Increases the amount of tokens per a specific lock.
Parameters:
_lockID
uint256
ID associated with the specific locked tokens.
_amount
uint256
Amount of tokens the contract or user wishes to lock/add.
SplitLock
Splits a lock into two seperate locks.
Parameters:
_lockID
uint256
ID associated with the specific locked tokens.
_amount
uint256
Amount of tokens the user wishes to split.
TransferLockOwnership
Transfers a lock to a new owner.
Parameters:
_lockID
uint256
ID associated with the specific locked tokens.
_newOwner
address
The new owner's address to transfer the lock to.
Migrate
Migrates liquidity to the next release of an AMM
Parameters:
_lockID
uint256
ID associated with the specific locked tokens.
_amount
uint256
Amount of tokens the user wishes to migrate.
_migration_option
uint256
Option to be used as an AMM selector during migration.
Functions View
GetNumLocksForToken
Parameters:
_lpToken
address
Address of the LP token.
Return Values:
uint256
Number of locks for the specified LP token.
GetNumLockedTokens
Return Values:
uint256
Number of unique locked tokens.
GetLockedTokenAtIndex
Parameters:
_index
uint256
Index of the locked token.
Return Values:
address
Address of the locked token at the specified index.
GetUserNumLockedTokens
Parameters:
_user
address
Address of the user.
Return Values:
uint256
Number of unique tokens locked by the user.
GetUserLockedTokenAtIndex
Parameters:
_user
address
Address of the user.
_index
uint256
Index of the locked token.
Return Values:
address
Address of the locked token at the specified index for the user.
GetUserNumLocksForToken
Parameters:
_user
address
Address of the user.
Return Values:
uint256
Number of unique tokens locked by the user.
GetUserLockForTokenAtIndex
Parameters:
_user
address
Address of the user.
_index
uint256
Index of the locked token.
Return Values:
address
Address of the locked token at the specified index for the user.
GetWhitelistedUsersLength
Parameters:
_user
address
Address of the user.
_lpToken
address
Address of the LP token.
Return Values:
uint256
Number of locks for the specified LP token for the user.
GetWhitelistedUserAtIndex
Parameters:
_user
address
Address of the user.
_lpToken
address
Address of the LP token.
_index
uint256
Index of the locked token.
Return Values:
TokenLock
An object that contains: lpToken
(address), lockDate
(uint256), amount
(uint256), initialAmount
(uint256), unlockDate
(uint256), lockID
(uint256), owner
(address), and countryCode
(uint16).
GetUserWhitelistStatus
Return Values:
uint256
Number of users on the whitelist.
Events
OnNewLock
Parameters:
lockID
uint256
ID of the new lock.
lpToken
address
The LP token involved in the lock.
owner
address
Address of the lock owner.
amount
uint256
Amount of tokens in the lock.
lockDate
uint256
Date when the tokens were locked.
unlockDate
uint256
Date when the tokens can be withdrawn.
countryCode
uint16
The country code of the locker or business.
OnRelock
Parameters:
lockID
uint256
ID of the relocked token.
lpToken
address
The LP token involved in the relock.
owner
address
Address of the lock owner.
amountRemainingInLock
uint256
Amount of tokens remaining in the lock.
liquidityFee
uint256
Fee associated with the liquidity.
unlockDate
uint256
Date when the tokens can be withdrawn.
OnWithdraw
Parameters:
lockID
uint256
ID of the withdrawn lock.
lpToken
address
The LP token involved in the withdrawal.
owner
address
Address of the lock owner.
amountRemainingInLock
uint256
Amount of tokens remaining in the lock.
amountRemoved
uint256
Amount of tokens removed from the lock.
OnIncrementLock
Parameters:
lockID
uint256
ID of the incremented lock.
lpToken
address
The LP token involved in the increment.
owner
address
Address of the lock owner.
payer
address
Address of the one who paid for the increment.
amountRemainingInLock
uint256
Amount of tokens remaining in the lock.
amountAdded
uint256
Amount of tokens added to the lock.
liquidityFee
uint256
Fee associated with the liquidity.
OnSplitLock
Parameters:
lockID
uint256
ID of the split lock.
lpToken
address
The LP token involved in the split.
owner
address
Address of the lock owner.
amountRemainingInLock
uint256
Amount of tokens remaining in the lock.
amountRemoved
uint256
Amount of tokens removed during the split.
OnTransferLockOwnership
Parameters:
lockID
uint256
ID of the lock whose ownership is transferred.
lpToken
address
The LP token involved in the transfer.
oldOwner
address
Address of the previous lock owner.
newOwner
address
Address of the new lock owner.
OnMigrate
Parameters:
lockID
uint256
ID of the migrated lock.
lpToken
address
The LP token involved in the migration.
owner
address
Address of the lock owner.
amountRemainingInLock
uint256
Amount of tokens remaining in the lock.
amountMigrated
uint256
Amount of tokens migrated.
migrationOption
uint256
Option selected for migration.
Last updated