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
Name | Type | Description |
---|---|---|
\NUMBER_PERIODS | uint256 | number of periods |
PRECISION_FACTOR
function PRECISION_FACTOR() external view returns (uint256)
Returns
Name | Type | Description |
---|---|---|
PRECISION_FACTOR | uint256 | precision factor |
START_BLOCK
function START_BLOCK() external view returns (uint256)
Returns
Name | Type | Description |
---|---|---|
START_BLOCK | uint256 | start block for the LOOKS staking |
accTokenPerShare
function accTokenPerShare() external view returns (uint256)
Returns
Name | Type | Description |
---|---|---|
accTokenPerShare() | uint256 | accumulated token per share |
calculatePendingRewards
function calculatePendingRewards(address user) external view returns (uint256)
Calculate pending rewards for a user
Parameters
Name | Type | Description |
---|---|---|
user | address | address of the user |
Returns
Name | Type | Description |
---|---|---|
- | uint256 | pending rewards for a user |
currentPhase
function currentPhase() external view returns (uint256)
Returns
Name | Type | Description |
---|---|---|
currentPhase | uint256 | current phase of the LOOKS staking program |
deposit
function deposit(uint256 amount) external nonpayable
Deposit staked tokens and compounds pending rewards
Parameters
Name | Type | Description |
---|---|---|
amount | uint256 | amount to deposit (in LOOKS) |
endBlock
function endBlock() external view returns (uint256)
Returns
Name | Type | Description |
---|---|---|
endBlock | uint256 | end block for the token distribution |
harvestAndCompound
function harvestAndCompound() external nonpayable
Compound based on pending rewards
lastRewardBlock
function lastRewardBlock() external view returns (uint256)
Returns
Name | Type | Description |
---|---|---|
lastRewardBlock | uint256 | last reward block |
looksRareToken
function looksRareToken() external view returns (contract ILooksRareToken)
Returns
Name | Type | Description |
---|---|---|
looksRareToken | contract ILooksRareToken | address of the LooksRareToken |
rewardPerBlockForOthers
function rewardPerBlockForOthers() external view returns (uint256)
Returns
Name | Type | Description |
---|---|---|
rewardPerBlockForOthers | uint256 | number of LOOKS tokens minted at each block in the current phase to the TokenSplitter |
rewardPerBlockForStaking
function rewardPerBlockForStaking() external view returns (uint256)
Returns
Name | Type | Description |
---|---|---|
rewardPerBlockForStaking | uint256 | number 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
Name | Type | Description |
---|---|---|
stakingPeriod (0, 1, 2, or 3) | uint256 | staking period |
Returns
Name | Type | Description |
---|---|---|
rewardPerBlockForStaking | uint256 | number of LOOKS tokens that is minted at each block in the current phase and distributed for LOOKS staking |
rewardPerBlockForOthers | uint256 | number of LOOKS tokens that is minted at each block in the current phase to the TokenSplitter |
periodLengthInBlock | uint256 | length of the period (in blocks) |
tokenSplitter
function tokenSplitter() external view returns (address)
Returns
Name | Type | Description |
---|---|---|
tokenSplitter | address | address of the TokenSplitter contract |
totalAmountStaked
function totalAmountStaked() external view returns (uint256)
Returns
Name | Type | Description |
---|---|---|
totalAmountStaked | uint256 | total 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
Name | Type | Description |
---|---|---|
- | address | address of the user |
Returns
Name | Type | Description |
---|---|---|
amount | uint256 | amount of tokens being staked |
rewardDebt | uint256 | reward debt |
withdraw
function withdraw(uint256 amount) external nonpayable
Withdraw staked tokens and compound pending rewards
Parameters
Name | Type | Description |
---|---|---|
amount | uint256 | amount to withdraw |
withdrawAll
function withdrawAll() external nonpayable
Withdraw all staked tokens and collect tokens
Events
Compound
event Compound(address indexed user, uint256 harvestedAmount)
Parameters
Name | Type | Description |
---|---|---|
user indexed | address | - |
harvestedAmount | uint256 | - |
Deposit
event Deposit(address indexed user, uint256 amount, uint256 harvestedAmount)
Parameters
Name | Type | Description |
---|---|---|
user indexed | address | - |
amount | uint256 | - |
harvestedAmount | uint256 | - |
NewRewardsPerBlock
event NewRewardsPerBlock(uint256 indexed currentPhase, uint256 startBlock, uint256 rewardPerBlockForStaking, uint256 rewardPerBlockForOthers)
Parameters
Name | Type | Description |
---|---|---|
currentPhase indexed | uint256 | - |
startBlock | uint256 | - |
rewardPerBlockForStaking | uint256 | - |
rewardPerBlockForOthers | uint256 | - |
Withdraw
event Withdraw(address indexed user, uint256 amount, uint256 harvestedAmount)
Parameters
Name | Type | Description |
---|---|---|
user indexed | address | - |
amount | uint256 | - |
harvestedAmount | uint256 | - |