Skip to main content

LockDrop

Allows users to lock certain amounts of tokens to earn LEXE rewards after the lock period.

Lock Assets

function lockAsset(uint8 lockTime, uint256 amount, address xTokenAddress )

locks given asset “xTokenAddress” for “amount” over lock period “lockTime”.

reverts if

  • Locktime is invalid
  • amount is zero
  • locking period is over
  • no allowance granted for token

if no reverts are hit, lock the token for the lock period by transferring them into the contract and emit the XTokensLocked event.

function lockAssets()

same functionality as lockAsset but for multiple tokens.

Metadata

function lockDropMetadata()

returns all metadata of the token (all locked tokens over all lock periods).

function lockDropUserdata(address account)

returns all metadata for the given user (all locked tokens over all lock periods).

Calculate Portions

function calculateTokenPortions(uint lockTime)

Calculates token portions for every day of a vesting time. this will be called daily to calculate it properly for each day.

reverts if

  • Locktime is invalid
  • Distribution hasn’t started
  • All portions have been calculated
  • Portions have been calculated for this day already
  • Oracle is disabled

if no reverts are hit, calculate the portions of all lock periods.

Redeem

function redeemTokens(uint8 lockTime)

Distributes the tokens for the given locktime.

reverts if

  • Locktime is invalid
  • Tokens for the day have already been redeemed
  • nothing to redeem

if no reverts are hit, distribute the calculated portion for given locktime.