Passer au contenu principal

TokenDistributor

It handles the distribution of LOOKS token. It auto-adjusts block rewards over a set number of periods.

Methods

NUMBER_PERIODS

function NUMBER_PERIODS() external view returns (uint256)

Returns

NameTypeDescription
\NUMBER_PERIODSuint256number of periods

PRECISION_FACTOR

function PRECISION_FACTOR() external view returns (uint256)

Returns

NameTypeDescription
PRECISION_FACTORuint256precision factor

START_BLOCK

function START_BLOCK() external view returns (uint256)

Returns

NameTypeDescription
START_BLOCKuint256start block for the LOOKS staking

accTokenPerShare

function accTokenPerShare() external view returns (uint256)

Returns

NameTypeDescription
accTokenPerShare()uint256accumulated token per share

calculatePendingRewards

function calculatePendingRewards(address user) external view returns (uint256)

Calculate pending rewards for a user

Parameters

NameTypeDescription
useraddressaddress of the user

Returns

NameTypeDescription
-uint256pending rewards for a user

currentPhase

function currentPhase() external view returns (uint256)

Returns

NameTypeDescription
currentPhaseuint256current phase of the LOOKS staking program

deposit

function deposit(uint256 amount) external nonpayable

Deposit staked tokens and compounds pending rewards

Parameters

NameTypeDescription
amountuint256amount to deposit (in LOOKS)

endBlock

function endBlock() external view returns (uint256)

Returns

NameTypeDescription
endBlockuint256end block for the token distribution

harvestAndCompound

function harvestAndCompound() external nonpayable

Compound based on pending rewards

lastRewardBlock

function lastRewardBlock() external view returns (uint256)

Returns

NameTypeDescription
lastRewardBlockuint256last reward block

looksRareToken

function looksRareToken() external view returns (contract ILooksRareToken)

Returns

NameTypeDescription
looksRareTokencontract ILooksRareTokenaddress of the LooksRareToken

rewardPerBlockForOthers

function rewardPerBlockForOthers() external view returns (uint256)

Returns

NameTypeDescription
rewardPerBlockForOthersuint256number of LOOKS tokens minted at each block in the current phase to the TokenSplitter

rewardPerBlockForStaking

function rewardPerBlockForStaking() external view returns (uint256)

Returns

NameTypeDescription
rewardPerBlockForStakinguint256number of LOOKS tokens that is minted at each block in the current phase and distributed for LOOKS staking

stakingPeriod

function stakingPeriod(uint256) external view returns (uint256 rewardPerBlockForStaking, uint256 rewardPerBlockForOthers, uint256 periodLengthInBlock)

Parameters

NameTypeDescription
stakingPeriod (0, 1, 2, or 3)uint256staking period

Returns

NameTypeDescription
rewardPerBlockForStakinguint256number of LOOKS tokens that is minted at each block in the current phase and distributed for LOOKS staking
rewardPerBlockForOthersuint256number of LOOKS tokens that is minted at each block in the current phase to the TokenSplitter
periodLengthInBlockuint256length of the period (in blocks)

tokenSplitter

function tokenSplitter() external view returns (address)

Returns

NameTypeDescription
tokenSplitteraddressaddress of the TokenSplitter contract

totalAmountStaked

function totalAmountStaked() external view returns (uint256)

Returns

NameTypeDescription
totalAmountStakeduint256total amount of LOOKS tokens being staked in this contract

updatePool

function updatePool() external nonpayable

Update pool rewards

userInfo

function userInfo(address) external view returns (uint256 amount, uint256 rewardDebt)

Parameters

NameTypeDescription
-addressaddress of the user

Returns

NameTypeDescription
amountuint256amount of tokens being staked
rewardDebtuint256reward debt

withdraw

function withdraw(uint256 amount) external nonpayable

Withdraw staked tokens and compound pending rewards

Parameters

NameTypeDescription
amountuint256amount to withdraw

withdrawAll

function withdrawAll() external nonpayable

Withdraw all staked tokens and collect tokens

Events

Compound

event Compound(address indexed user, uint256 harvestedAmount)

Parameters

NameTypeDescription
user indexedaddress-
harvestedAmountuint256-

Deposit

event Deposit(address indexed user, uint256 amount, uint256 harvestedAmount)

Parameters

NameTypeDescription
user indexedaddress-
amountuint256-
harvestedAmountuint256-

NewRewardsPerBlock

event NewRewardsPerBlock(uint256 indexed currentPhase, uint256 startBlock, uint256 rewardPerBlockForStaking, uint256 rewardPerBlockForOthers)

Parameters

NameTypeDescription
currentPhase indexeduint256-
startBlockuint256-
rewardPerBlockForStakinguint256-
rewardPerBlockForOthersuint256-

Withdraw

event Withdraw(address indexed user, uint256 amount, uint256 harvestedAmount)

Parameters

NameTypeDescription
user indexedaddress-
amountuint256-
harvestedAmountuint256-