BGTIncentiveFeeCollector
Collects the fees on the incentives posted on reward vaults and auction them for WBERA. Accrued WBERA serves as a payout for the stakers of WBERAStakerVault.sol
.
Inherits: IBGTIncentiveFeeCollector, UUPSUpgradeable, OwnableUpgradeable, PausableUpgradeable
Constants
MANAGER_ROLE
bytes32 public constant MANAGER_ROLE = keccak256("MANAGER_ROLE");
PAUSER_ROLE
bytes32 public constant PAUSER_ROLE = keccak256("PAUSER_ROLE");
WBERA
The WBERA token address, serves as payout token.
address public constant WBERA = 0x6969696969696969696969696969696969696969;
State Variables
payoutAmount
The amount of WBERA required to claim fees.
uint256 public payoutAmount;
queuedPayoutAmount
The queued payout amount that will be activated on next claim.
uint256 public queuedPayoutAmount;
wberaStakerVault
The address of the WBERA staker vault.
address public wberaStakerVault;
View Functions
hasRole
function hasRole(bytes32 role, address account) public view virtual override returns (bool);
owner
function owner() public view virtual override returns (address);
paused
function paused() public view virtual override returns (bool);
proxiableUUID
function proxiableUUID() external view virtual override notDelegated returns (bytes32);
queuedPayoutAmount
function queuedPayoutAmount() external view returns (uint256);
Functions
claimFees
Claims the accumulated fees for the given tokens.
The caller must transfer the payout amount to the staking vault.
Emits:
function claimFees(address _recipient, address[] calldata _feeTokens) external whenNotPaused;
Parameters
Name | Type | Description |
---|---|---|
_recipient | address | The address to receive the claimed tokens. |
_feeTokens | address[] | The array of fee token addresses to claim. |
initialize
Initializes the contract.
Emits:
function initialize(address governance, uint256 _payoutAmount, address _wberaStakerVault) external initializer;
Parameters
Name | Type | Description |
---|---|---|
governance | address | The address that will have the DEFAULT_ADMIN_ROLE. |
_payoutAmount | uint256 | The amount of WBERA required to claim fees. |
_wberaStakerVault | address | The address of the WBERA staker vault. |
pause
Pauses the contract.
Emits:
function pause() external onlyRole(PAUSER_ROLE);
queuePayoutAmountChange
Queues a change to the payout amount.
Emits:
function queuePayoutAmountChange(uint256 _newPayoutAmount) external onlyRole(DEFAULT_ADMIN_ROLE);
Parameters
Name | Type | Description |
---|---|---|
_newPayoutAmount | uint256 | The new payout amount. |
unpause
Unpauses the contract.
Emits:
function unpause() external onlyRole(MANAGER_ROLE);
upgradeToAndCall
function upgradeToAndCall(address newImplementation, bytes memory data) public payable virtual override onlyRole(DEFAULT_ADMIN_ROLE);
wberaStakerVault
function wberaStakerVault() external view returns (address);
Events
IncentiveFeesClaimed
Emitted when incentive fees are claimed.
event IncentiveFeesClaimed(address indexed caller, address indexed recipient);
Parameters
Name | Type | Description |
---|---|---|
caller | address | The address that called the claim function. |
recipient | address | The address that received the tokens. |
IncentiveFeeTokenClaimed
Emitted when a specific incentive fee token is claimed.
event IncentiveFeeTokenClaimed(
address indexed caller, address indexed recipient, address indexed token, uint256 amount
);
Parameters
Name | Type | Description |
---|---|---|
caller | address | The address that called the claim function. |
recipient | address | The address that received the tokens. |
token | address | The token that was claimed. |
amount | uint256 | The amount of tokens claimed. |
Initialized
Emitted when the contract is initialized.
event Initialized(uint64 version);
Parameters
Name | Type | Description |
---|---|---|
version | uint64 | The initialization version. |
OwnershipTransferred
Emitted when ownership is transferred.
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
Parameters
Name | Type | Description |
---|---|---|
previousOwner | address | The previous owner. |
newOwner | address | The new owner. |
Paused
Emitted when the contract is paused.
event Paused(address account);
Parameters
Name | Type | Description |
---|---|---|
account | address | The account that paused the contract. |
PayoutAmountSet
Emitted when the payout amount is set.
event PayoutAmountSet(uint256 oldAmount, uint256 newAmount);
Parameters
Name | Type | Description |
---|---|---|
oldAmount | uint256 | The previous payout amount. |
newAmount | uint256 | The new payout amount. |
QueuedPayoutAmount
Emitted when a payout amount change is queued.
event QueuedPayoutAmount(uint256 newAmount, uint256 currentAmount);
Parameters
Name | Type | Description |
---|---|---|
newAmount | uint256 | The new queued payout amount. |
currentAmount | uint256 | The current payout amount. |
RoleAdminChanged
Emitted when the admin role for a role is changed.
event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);
Parameters
Name | Type | Description |
---|---|---|
role | bytes32 | The role whose admin was changed. |
previousAdminRole | bytes32 | The previous admin role. |
newAdminRole | bytes32 | The new admin role. |
RoleGranted
Emitted when a role is granted to an account.
event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);
Parameters
Name | Type | Description |
---|---|---|
role | bytes32 | The role that was granted. |
account | address | The account that received the role. |
sender | address | The account that granted the role. |
RoleRevoked
Emitted when a role is revoked from an account.
event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);
Parameters
Name | Type | Description |
---|---|---|
role | bytes32 | The role that was revoked. |
account | address | The account that lost the role. |
sender | address | The account that revoked the role. |
Unpaused
Emitted when the contract is unpaused.
event Unpaused(address account);
Parameters
Name | Type | Description |
---|---|---|
account | address | The account that unpaused the contract. |
Upgraded
Emitted when the implementation is upgraded.
event Upgraded(address indexed implementation);
Parameters
Name | Type | Description |
---|---|---|
implementation | address | The new implementation address. |