跳到主要內容

AggregatorFeeSharingWithUniswapV3

An extra layer built on top of the FeeSharingSystem that sells WETH to LOOKS using the Uniswap V3 router. It is a yield aggregator that optimizes LOOKS staking.

Prime shares represent the number of shares in the FeeSharingSystem. When not specified, shares represent secondary shares in this contract.

Methods

MAXIMUM_HARVEST_BUFFER_BLOCKS

function MAXIMUM_HARVEST_BUFFER_BLOCKS() external view returns (uint256)

Returns

NameTypeDescription
MAXIMUM_HARVEST_BUFFER_BLOCKSuint256maximum number of blocks between two harvests

MINIMUM_DEPOSIT_LOOKS

function MINIMUM_DEPOSIT_LOOKS() external view returns (uint256)

Returns

NameTypeDescription
MINIMUM_DEPOSIT_LOOKSuint256minimum amount for a single deposit (in LOOKS)

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 a (secondary) share in LOOKS

calculateSharePriceInPrimeShare

function calculateSharePriceInPrimeShare() external view returns (uint256)

Calculate price of one (secondary) share (in prime share). Share price is expressed times 1e18

Returns

NameTypeDescription
-uint256price of a (secondary) share in prime share

calculateSharesValueInLOOKS

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

Calculate shares value of a user (in LOOKS)

Parameters

NameTypeDescription
useraddressaddress of the user

Returns

NameTypeDescription
-uint256value (in LOOKS) of the total shares of a user

canHarvest

function canHarvest() external view returns (bool)

Returns

NameTypeDescription
-boolwhether harvests are triggered automatically at standard user action (i.e., deposits, withdraws)

checkAndAdjustLOOKSTokenAllowanceIfRequired

function checkAndAdjustLOOKSTokenAllowanceIfRequired() external nonpayable

Adjust allowance if necessary

Only callable by owner.

checkAndAdjustRewardTokenAllowanceIfRequired

function checkAndAdjustRewardTokenAllowanceIfRequired() external nonpayable

Adjust allowance if necessary

Only callable by owner.

deposit

function deposit(uint256 amount) external nonpayable

Deposit LOOKS tokens

There is a limit of 1 LOOKS per deposit to prevent potential manipulation of the shares

Parameters

NameTypeDescription
amountuint256amount to deposit (in LOOKS)

feeSharingSystem

function feeSharingSystem() external view returns (contract FeeSharingSystem)

Returns

NameTypeDescription
-contract FeeSharingSystemaddress of the FeeSharingSystem contract

harvestAndSellAndCompound

function harvestAndSellAndCompound() external nonpayable

Harvest pending WETH, sell them to LOOKS, and deposit LOOKS (if possible)

Only callable by owner. It is meant for emergency.

harvestBufferBlocks

function harvestBufferBlocks() external view returns (uint256)

Returns

NameTypeDescription
-uint256number of blocks between two consecutive harvests

lastHarvestBlock

function lastHarvestBlock() external view returns (uint256)

Returns

NameTypeDescription
lastHarvestBlockuint256block number of the last harvest

looksRareToken

function looksRareToken() external view returns (contract IERC20)

Returns

NameTypeDescription
-contract IERC20address of the LooksRareToken

maxPriceLOOKSInWETH

function maxPriceLOOKSInWETH() external view returns (uint256)

Returns

NameTypeDescription
maxPriceLOOKSInWETHuint256maximum price of 1 LOOKS (in WETH) times 1e18

owner

function owner() external view returns (address)

Returns the address of the current owner.

Returns

NameTypeDescription
owneraddressaddress of the current owner

pause

function pause() external nonpayable

Pause

Only callable by owner

paused

function paused() external view returns (bool)

Returns true if the contract is paused, and false otherwise.

Returns

NameTypeDescription
pausedboolwhether the contract is in pause status. If paused, new user deposits are suspended but withdrawals are available.

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.

rewardToken

function rewardToken() external view returns (contract IERC20)

Returns

NameTypeDescription
-contract IERC20address of the rewardToken (i.e., WETH)

startHarvest

function startHarvest() external nonpayable

Start automatic harvest/selling transactions

Only callable by owner

stopHarvest

function stopHarvest() external nonpayable

Stop automatic harvest transactions

Only callable by owner

thresholdAmount

function thresholdAmount() external view returns (uint256)

Returns

NameTypeDescription
-uint256threshold amount (in rewardToken) to trigger a sale on Uniswap V3

totalShares

function totalShares() external view returns (uint256)

Returns

NameTypeDescription
totalSharesuint256number of total (secondary) shares

tradingFeeUniswapV3

function tradingFeeUniswapV3() external view returns (uint24)

Returns

NameTypeDescription
tradingFeeUniswapV3uint24trading fee for Uniswap v3 (e.g., 3000 --> 0.30%, 500 --> 0.05%)

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

uniswapRouter

function uniswapRouter() external view returns (contract ISwapRouter)

Returns

NameTypeDescription
-contract ISwapRouteraddress of the Uniswap V3 swap router

unpause

function unpause() external nonpayable

Unpause

Only callable by owner

updateHarvestBufferBlocks

function updateHarvestBufferBlocks(uint256 _newHarvestBufferBlocks) external nonpayable

Update harvest buffer block

Only callable by owner.

Parameters

NameTypeDescription
newHarvestBufferBlocksuint256buffer in blocks between two harvest operations

updateMaxPriceOfLOOKSInWETH

function updateMaxPriceOfLOOKSInWETH(uint256 _newMaxPriceLOOKSInWETH) external nonpayable

Update maximum price of LOOKS in WETH

Only callable by owner

Parameters

NameTypeDescription
newMaxPriceLOOKSInWETHuint256new maximum price of LOOKS in WETH times 1e18

updateThresholdAmount

function updateThresholdAmount(uint256 _newThresholdAmount) external nonpayable

Adjust threshold amount for periodic Uniswap v3 WETH to LOOKS conversion

Only callable by owner

Parameters

NameTypeDescription
newThresholdAmountuint256new threshold amount (in WETH)

updateTradingFeeUniswapV3

function updateTradingFeeUniswapV3(uint24 _newTradingFeeUniswapV3) external nonpayable

Adjust trading fee for Uniswap v3

Only callable by owner. Can only be 10,000 (1%), 3000 (0.3%), or 500 (0.05%).

Parameters

NameTypeDescription
newTradingFeeUniswapV3uint24new trading fee for Uniswap V3

userInfo

function userInfo(address) external view returns (uint256)

Parameters

NameTypeDescription
-addressaddress of the user

Returns

NameTypeDescription
-uint256number of shares of the user

withdraw

function withdraw(uint256 shares) external nonpayable

Redeem shares for LOOKS tokens

Parameters

NameTypeDescription
sharesuint256number of shares to redeem

withdrawAll

function withdrawAll() external nonpayable

Withdraw all shares of sender

Events

ConversionToLOOKS

event ConversionToLOOKS(uint256 amountSold, uint256 amountReceived)

Parameters

NameTypeDescription
amountSolduint256amount of tokens sold (in rewardToken)
amountReceiveduint256amount of LOOKS received

Deposit

event Deposit(address indexed user, uint256 amount)

Parameters

NameTypeDescription
user indexedaddressaddress of the user
amountuint256amount deposited in LOOKS

FailedConversion

event FailedConversion()

HarvestStart

event HarvestStart()

HarvestStop

event HarvestStop()

NewHarvestBufferBlocks

event NewHarvestBufferBlocks(uint256 harvestBufferBlocks)

Parameters

NameTypeDescription
harvestBufferBlocksuint256number of blocks between two consecutive harvests

NewMaximumPriceLOOKSInWETH

event NewMaximumPriceLOOKSInWETH(uint256 maxPriceLOOKSInWETH)

Parameters

NameTypeDescription
maxPriceLOOKSInWETHuint256maximum price of LOOKS in WETH times 1e18

NewThresholdAmount

event NewThresholdAmount(uint256 thresholdAmount)

Parameters

NameTypeDescription
thresholdAmountuint256threshold amount (in rewardToken) to trigger a sale on Uniswap V3

NewTradingFeeUniswapV3

event NewTradingFeeUniswapV3(uint24 tradingFeeUniswapV3)

Parameters

NameTypeDescription
tradingFeeUniswapV3uint24trading fee for Uniswap V3

OwnershipTransferred

event OwnershipTransferred(address indexed previousOwner, address indexed newOwner)

Parameters

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

Paused

event Paused(address account)

Parameters

NameTypeDescription
accountaddress-

Unpaused

event Unpaused(address account)

Parameters

NameTypeDescription
accountaddress-

Withdraw

event Withdraw(address indexed user, uint256 amount)

Parameters

NameTypeDescription
user indexedaddressaddress of the user
amountuint256amount received (in LOOKS)