State Variables
| Name | Type | Description |
|---|---|---|
lockFee | uint256 | eth fee per lock in wei |
feeReceiver | address payable | address receiving lock fees |
_locks | Lock[] | append only list of all locks |
_userLpLockIds | mapping(address ⇒ Set) | lp lock ids for user |
_userNormalLockIds | mapping(address ⇒ Set) | normal token lock ids for user |
_lpLockedTokens | AddressSet | unique lp tokens with active locks |
_normalLockedTokens | AddressSet | unique normal tokens with active locks |
cumulativeLockInfo | mapping(address ⇒ Info) | totals per token and factory reference |
_tokenToLockIds | mapping(address ⇒ Set) | all lock ids tied to a specific token |
Structs
Lock
| Field | Type | Description |
|---|---|---|
id | uint256 | external id (index plus 1000000) |
token | address | token contract address |
owner | address | unlock caller |
amount | uint256 | total locked amount |
lockDate | uint256 | timestamp when created |
tgeDate | uint256 | tge time for vesting, unlock time for normal |
tgeBps | uint256 | release basis points at tge, 0 for normal |
cycle | uint256 | seconds per cycle, 0 for normal |
cycleBps | uint256 | release basis points per cycle, 0 for normal |
unlockedAmount | uint256 | total withdrawn |
description | string | user note |
CumulativeLockInfo
| Field | Type | Description |
|---|---|---|
token | address | token address |
factory | address | uniswap v2 factory, zero for normal token |
amount | uint256 | active total locked amount |
Functions
lock
LockAdded
vestingLock
LockAdded
multipleVestingLock
LockAdded (per lock)
unlock
LockRemoved / LockVested
editLock
LockUpdated
editLockDescription
LockDescriptionChanged
transferLockOwnership
LockOwnerChanged
renounceLockOwnership
LockOwnerChanged
View Helpers
| Signature | Returns |
|---|---|
getTotalLockCount() | uint256 |
getLockAt(uint256 index) | Lock memory |
getLockById(uint256 lockId) | Lock memory |
withdrawableTokens(uint256 lockId) | uint256 |
allLpTokenLockedCount() | uint256 |
allNormalTokenLockedCount() | uint256 |
totalTokenLockedCount() | uint256 |
getCumulativeNormalTokenLockInfoAt(uint256 index) | CumulativeLockInfo memory |
getCumulativeNormalTokenLockInfo(uint256 start, uint256 end) | CumulativeLockInfo[] memory |
getCumulativeLpTokenLockInfoAt(uint256 index) | CumulativeLockInfo memory |
getCumulativeLpTokenLockInfo(uint256 start, uint256 end) | CumulativeLockInfo[] memory |
lpLockCountForUser(address user) | uint256 |
lpLocksForUser(address user) | Lock[] memory |
lpLockForUserAtIndex(address user, uint256 index) | Lock memory |
normalLockCountForUser(address user) | uint256 |
normalLocksForUser(address user) | Lock[] memory |
normalLockForUserAtIndex(address user, uint256 index) | Lock memory |
totalLockCountForUser(address user) | uint256 |
totalLockCountForToken(address token) | uint256 |
getLocksForToken(address token ,uint256 start, uint256 end) | Lock[] memory |
cumulativeLockInfo(address token) | CumulativeLockInfo memory |
Events
| Name | Signature |
|---|---|
| LockAdded | event LockAdded(uint256 id, address token, address owner, uint256 amount, uint256 unlockDate) |
| LockUpdated | event LockUpdated(uint256 id, address token, address owner, uint256 newAmount, uint256 newUnlockDate) |
| LockRemoved | event LockRemoved(uint256 id, address token, address owner, uint256 amount, uint256 unlockedAt) |
| LockVested | event LockVested(uint256 id, address token, address owner, uint256 amount, uint256 remaining, uint256 timestamp) |
| LockDescriptionChanged | event LockDescriptionChanged(uint256 lockId) |
| LockOwnerChanged | event LockOwnerChanged(uint256 lockId, address owner, address newOwner) |

