メインコンテンツへスキップ

FeeSharingSetter

It receives LooksRare protocol fees and owns the FeeSharingSystem contract. It can plug to AMMs for converting all received currencies to WETH.

Methods

DEFAULT_ADMIN_ROLE

function DEFAULT_ADMIN_ROLE() external view returns (bytes32)

Returns

NameTypeDescription
DEFAULT_ADMIN_ROLEbytes32default admin role identifier

MAX_REWARD_DURATION_IN_BLOCKS

function MAX_REWARD_DURATION_IN_BLOCKS() external view returns (uint256)

Returns

NameTypeDescription
MAX_REWARD_DURATION_IN_BLOCKSuint256maximum reward duration that can be set (in blocks)

MIN_REWARD_DURATION_IN_BLOCKS

function MIN_REWARD_DURATION_IN_BLOCKS() external view returns (uint256)

Returns

NameTypeDescription
MIN_REWARD_DURATION_IN_BLOCKSuint256minimum reward duration that can be set (in blocks)

OPERATOR_ROLE

function OPERATOR_ROLE() external view returns (bytes32)

Returns

NameTypeDescription
OPERATOR_ROLEbytes32operator role identifier

addFeeStakingAddresses

function addFeeStakingAddresses(address[] _stakingAddresses) external nonpayable

Add staking addresses

Parameters

NameTypeDescription
_stakingAddressesaddress[]array of addresses eligible for fee-sharing only

convertCurrencyToRewardToken

function convertCurrencyToRewardToken(address token, bytes additionalData) external nonpayable

Convert currencies to reward token

Function only usable only for whitelisted currencies (where no potential side effect)

Parameters

NameTypeDescription
tokenaddressaddress of the token to sell
additionalDatabytesadditional data (e.g., slippage)

feeSharingSystem

function feeSharingSystem() external view returns (contract FeeSharingSystem)

Returns

NameTypeDescription
feeSharingSystemcontract FeeSharingSystemaddress of the FeeSharingSystem

getRoleAdmin

function getRoleAdmin(bytes32 role) external view returns (bytes32)

Returns the admin role that controls role. See {grantRole} and {revokeRole}. To change a role's admin, use {_setRoleAdmin}.

Parameters

NameTypeDescription
rolebytes32-

Returns

NameTypeDescription
-bytes32-

grantRole

function grantRole(bytes32 role, address account) external nonpayable

Grants role to account. If account had not been already granted role, emits a {RoleGranted} event. Requirements: - the caller must have role's admin role.

Parameters

NameTypeDescription
rolebytes32identifier of the role (e.g., OPERATOR_ROLE)
accountaddressaddress of the account

hasRole

function hasRole(bytes32 role, address account) external view returns (bool)

Returns true if account has been granted role.

Parameters

NameTypeDescription
rolebytes32identifier of the role (e.g., OPERATOR_ROLE)
accountaddressaddress of the account

Returns

NameTypeDescription
-boolwhether the account has been granted the role

lastRewardDistributionBlock

function lastRewardDistributionBlock() external view returns (uint256)

Returns

NameTypeDescription
-uint256block for the last reward distribution

looksRareToken

function looksRareToken() external view returns (contract IERC20)

Returns

NameTypeDescription
looksRareTokencontract IERC20address of the LooksRareToken

nextRewardDurationInBlocks

function nextRewardDurationInBlocks() external view returns (uint256)

Returns

NameTypeDescription
nextRewardDurationInBlocksuint256next reward duration in blocks (that will apply for the next update of the rewards)

removeFeeStakingAddresses

function removeFeeStakingAddresses(address[] _stakingAddresses) external nonpayable

Remove staking addresses

Parameters

NameTypeDescription
_stakingAddressesaddress[]array of addresses eligible for fee-sharing only

renounceRole

function renounceRole(bytes32 role, address account) external nonpayable

Revokes role from the calling account. Roles are often managed via {grantRole} and {revokeRole}: this function's purpose is to provide a mechanism for accounts to lose their privileges if they are compromised (such as when a trusted device is misplaced). If the calling account had been revoked role, emits a {RoleRevoked} event. Requirements: - the caller must be account.

Parameters

NameTypeDescription
rolebytes32identifier of the role (e.g., OPERATOR_ROLE)
accountaddressaddress of the account

revokeRole

function revokeRole(bytes32 role, address account) external nonpayable

Revokes role from account. If account had been granted role, emits a {RoleRevoked} event. Requirements: - the caller must have role's admin role.

Parameters

NameTypeDescription
rolebytes32identifier of the role (e.g., OPERATOR_ROLE)
accountaddressaddress of the account

rewardConvertor

function rewardConvertor() external view returns (contract IRewardConvertor)

Returns

NameTypeDescription
rewardConvertercontract IRewardConvertoraddress of the reward convertor (it returns address(0) if not set)

rewardDurationInBlocks

function rewardDurationInBlocks() external view returns (uint256)

Returns

NameTypeDescription
rewardDurationInBlocksuint256current reward duration in blocks

rewardToken

function rewardToken() external view returns (contract IERC20)

Returns

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

setNewRewardDurationInBlocks

function setNewRewardDurationInBlocks(uint256 _newRewardDurationInBlocks) external nonpayable

Set new reward duration in blocks for next update

Parameters

NameTypeDescription
_newRewardDurationInBlocksuint256number of blocks for new reward period

setRewardConvertor

function setRewardConvertor(address _rewardConvertor) external nonpayable

Set reward convertor contract

Parameters

NameTypeDescription
_rewardConvertoraddressaddress of the reward convertor (set to null to deactivate)

supportsInterface

function supportsInterface(bytes4 interfaceId) external view returns (bool)

See {IERC165-supportsInterface}.

Parameters

NameTypeDescription
interfaceIdbytes4-

Returns

NameTypeDescription
-boolwhether it supports the interfaceId

tokenDistributor

function tokenDistributor() external view returns (contract TokenDistributor)

Returns

NameTypeDescription
tokenDistributorcontract TokenDistributoraddress of the TokenDistributor

transferOwnershipOfFeeSharingSystem

function transferOwnershipOfFeeSharingSystem(address _newOwner) external nonpayable

Transfer ownership of fee sharing system

Parameters

NameTypeDescription
_newOwneraddressaddress of the new owner

updateRewards

function updateRewards() external nonpayable

Update the reward per block (in rewardToken)

It automatically retrieves the number of pending WETH and adjusts based on the balance of LOOKS in fee-staking addresses that exist in the set.

Events

ConversionToRewardToken

event ConversionToRewardToken(address indexed token, uint256 amountConverted, uint256 amountReceived)

Parameters

NameTypeDescription
token indexedaddress-
amountConverteduint256-
amountReceiveduint256-

FeeStakingAddressesAdded

event FeeStakingAddressesAdded(address[] feeStakingAddresses)

Parameters

NameTypeDescription
feeStakingAddressesaddress[]-

FeeStakingAddressesRemoved

event FeeStakingAddressesRemoved(address[] feeStakingAddresses)

Parameters

NameTypeDescription
feeStakingAddressesaddress[]-

NewFeeSharingSystemOwner

event NewFeeSharingSystemOwner(address newOwner)

Parameters

NameTypeDescription
newOwneraddressaddress of the new owner

NewRewardConvertor

event NewRewardConvertor(address rewardConvertor)

Parameters

NameTypeDescription
rewardConvertoraddress-

NewRewardDurationInBlocks

event NewRewardDurationInBlocks(uint256 rewardDurationInBlocks)

Parameters

NameTypeDescription
rewardDurationInBlocksuint256-

RoleAdminChanged

event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole)

Parameters

NameTypeDescription
role indexedbytes32-
previousAdminRole indexedbytes32-
newAdminRole indexedbytes32-

RoleGranted

event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender)

Parameters

NameTypeDescription
role indexedbytes32-
account indexedaddress-
sender indexedaddress-

RoleRevoked

event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender)

Parameters

NameTypeDescription
role indexedbytes32-
account indexedaddress-
sender indexedaddress-