Passer au contenu principal

FeeSharingSystem

It handles the distribution of fees using WETH along with the auto-compounding of LOOKS.

Methods

PRECISION_FACTOR

function PRECISION_FACTOR() external view returns (uint256)

Returns

NameTypeDescription
PRECISION_FACTORuint256-

calculatePendingRewards

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

Calculate pending rewards (WETH) for a user

Parameters

NameTypeDescription
useraddressaddress of the user

Returns

NameTypeDescription
-uint256pending rewards for the user

calculateSharePriceInLOOKS

function calculateSharePriceInLOOKS() external view returns (uint256)

Calculate price of one share (in LOOKS token) Share price is expressed times 1e18

Returns

NameTypeDescription
-uint256price of one share (in LOOKS token)

calculateSharesValueInLOOKS

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

Calculate value of LOOKS for a user given a number of shares owned

Parameters

NameTypeDescription
useraddressaddress of the user

Returns

NameTypeDescription
-uint256estimated number of LOOKS for a user given the number of owned shares

currentRewardPerBlock

function currentRewardPerBlock() external view returns (uint256)

Returns

NameTypeDescription
-uint256current reward per block (in WETH)

deposit

function deposit(uint256 amount, bool claimRewardToken) external nonpayable

Deposit staked tokens (and collect reward tokens if requested)

Parameters

NameTypeDescription
amountuint256amount to deposit (in LOOKS)
claimRewardTokenboolwhether to claim reward tokens

harvest

function harvest() external nonpayable

Harvest reward tokens that are pending

lastRewardAdjustment

function lastRewardAdjustment() external view returns (uint256)

Returns

NameTypeDescription
lastRewardAdjustmentuint256last reward adjustment

lastRewardBlock

function lastRewardBlock() external view returns (uint256)

Return last block where trading rewards were distributed

Returns

NameTypeDescription
lastRewardBlockuint256last block where trading rewards were distributed

lastUpdateBlock

function lastUpdateBlock() external view returns (uint256)

Returns

NameTypeDescription
lastUpdateBlockuint256last update block

looksRareToken

function looksRareToken() external view returns (contract IERC20)

Returns

NameTypeDescription
looksRareTokencontract IERC20address of the LooksRare token

owner

function owner() external view returns (address)

Returns the address of the current owner.

Returns

NameTypeDescription
owneraddressaddress of the current owner

periodFinish

function periodFinish() external view returns (uint256)

Returns

NameTypeDescription
periodFinishuint256endBlock for the current reward period

renounceOwnership

function renounceOwnership() external nonpayable

Leaves the contract without owner. It will not be possible to call onlyOwner functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.

rewardPerTokenStored

function rewardPerTokenStored() external view returns (uint256)

Returns

NameTypeDescription
rewardPerTokenStoreduint256current reward that has been stored per share

rewardToken

function rewardToken() external view returns (contract IERC20)

Returns

NameTypeDescription
rewardTokencontract IERC20reward token address (WETH)

tokenDistributor

function tokenDistributor() external view returns (contract TokenDistributor)

Returns

NameTypeDescription
tokenDistributorcontract TokenDistributoraddress of the TokenDistributor

totalShares

function totalShares() external view returns (uint256)

Returns

NameTypeDescription
totalSharesuint256number of outstanding shares

transferOwnership

function transferOwnership(address newOwner) external nonpayable

Transfers ownership of the contract to a new account (newOwner). Can only be called by the current owner.

Parameters

NameTypeDescription
newOwneraddressaddress of the new owner

updateRewards

function updateRewards(uint256 reward, uint256 rewardDurationInBlocks) external nonpayable

Update the reward per block (in rewardToken)

Only callable by owner. Owner is meant to be another smart contract.

Parameters

NameTypeDescription
rewarduint256total reward distributed in the period
rewardDurationInBlocksuint256number of blocks in the period (e.g., 6500)

userInfo

function userInfo(address) external view returns (uint256 shares, uint256 userRewardPerTokenPaid, uint256 rewards)

Parameters

NameTypeDescription
-addressaddress of the user

Returns

NameTypeDescription
sharesuint256number of shares
userRewardPerTokenPaiduint256user reward per token paid
rewardsuint256pending rewards

withdraw

function withdraw(uint256 shares, bool claimRewardToken) external nonpayable

Withdraw staked tokens (and collect reward tokens if requested)

Parameters

NameTypeDescription
sharesuint256shares to withdraw
claimRewardTokenboolwhether to claim reward tokens

withdrawAll

function withdrawAll(bool claimRewardToken) external nonpayable

Withdraw all staked tokens (and collect reward tokens if requested)

Parameters

NameTypeDescription
claimRewardTokenboolwhether to claim reward tokens

Events

Deposit

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

Parameters

NameTypeDescription
user indexedaddressaddress of the user
amountuint256amount deposited
harvestedAmountuint256harvested amount (in WETH)

Harvest

event Harvest(address indexed user, uint256 harvestedAmount)

Parameters

NameTypeDescription
user indexedaddressaddress of the user
harvestedAmountuint256harvested amount (in WETH)

NewRewardPeriod

event NewRewardPeriod(uint256 numberBlocks, uint256 rewardPerBlock, uint256 reward)

Parameters

NameTypeDescription
numberBlocksuint256number of blocks for the new reward period
rewardPerBlockuint256reward per block (in WETH)
rewarduint256total reward distributed over the period (in WETH)

OwnershipTransferred

event OwnershipTransferred(address indexed previousOwner, address indexed newOwner)

Parameters

NameTypeDescription
previousOwner indexedaddressaddress of the previous owner
newOwner indexedaddressaddress of the new owner

Withdraw

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

Parameters

NameTypeDescription
user indexedaddressaddress of the user
amountuint256amount withdrawn
harvestedAmountuint256harvested amount (in WETH)