Skip to main content
Solidity: ^0.8.4

Functions

lock

function lock(
    address owner,
    address token,
    bool isLpToken,
    uint256 amount,
    uint256 unlockDate,
    string memory description
) external payable returns (uint256 lockId)
Params
NameTypeDescription
owneraddressaddress that can call unlock
tokenaddresserc20 or lp token contract
isLpTokenboolflag indicating whether token is an LP pair
amountuint256raw token amount (in token decimals)
unlockDateuint256unix timestamp when tokens unlock
descriptionstringhuman-readable note stored with lock
Returns
TypeDescription
uint256Unique identifier for the new lock

vestingLock

function vestingLock(
    address owner,
    address token,
    bool isLpToken,
    uint256 amount,
    uint256 tgeDate,
    uint256 tgeBps,
    uint256 cycle,
    uint256 cycleBps,
    string memory description
) external payable returns (uint256 lockId)
Params
NameTypeDescription
owneraddressbeneficiary / unlock caller
tokenaddresstoken contract
isLpTokenboollp token flag
amountuint256total amount subject to vesting
tgeDateuint256first unlock timestamp (tge)
tgeBpsuint256basis-points release at tge (100 = 1%)
cycleuint256seconds between subsequent unlocks
cycleBpsuint256basis-points unlocked each cycle
descriptionstringstored lock metadata
Returns
TypeDescription
uint256new lock indentifier

multipleVestingLock

function multipleVestingLock(
    address[] calldata owners,
    uint256[] calldata amounts,
    address token,
    bool isLpToken,
    uint256 tgeDate,
    uint256 tgeBps,
    uint256 cycle,
    uint256 cycleBps,
    string memory description
) external payable returns (uint256[] memory)
Params
NameTypeDescription
ownersaddress[]beneficiary addresses (length = lock count)
amountsuint256[]individual vesting amounts (same order)
tokenaddressshared token contract
isLpTokenboolshared lp token flag
tgeDateuint256tge timestamp (same for all)
tgeBpsuint256tge unlock basis-points
cycleuint256cycle length in seconds
cycleBpsuint256cycle unlock basis-points
descriptionstringcommon metadata string
Returns
TypeDescription
uint256[]array of new lock identifiers (1-to-1 with owners)

unlock

function unlock(uint256 lockId) external
Params
NameTypeDescription
lockIduint256lock to release from

editLock

function editLock(
    uint256 lockId,
    uint256 newAmount,
    uint256 newUnlockDate
) external
Params
NameTypeDescription
lockIduint256lock to modify
newAmountuint256updated token amount
newUnlockDateuint256updated cliff/unlock timestamp