Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

BribeCollectorV1_4

Git Source

Inherits: InfraredUpgradeable, IBribeCollectorV1_4

The Bribe Collector contract is responsible for collecting bribes from Berachain rewards vaults and auctioning them for a Payout token which then is distributed among Infrared validators.

This contract is forked from Berachain POL which is forked from Uniswap V3 Factory Owner contract. https://github.com/uniswapfoundation/UniStaker/blob/main/src/V3FactoryOwner.sol

v1.4 adds a payout token setter and initializes payout token as iBGT

State Variables

payoutToken

Payout token, required to be WBERA token as its unwrapped and used to compound rewards in the iBera system.

address public payoutToken;

payoutAmount

Payout amount is a constant value that is paid by the caller of the claimFees function.

uint256 public payoutAmount;

__gap

uint256[40] private __gap;

Functions

setPayoutAmount

Set the payout amount for the bribe collector.

function setPayoutAmount(uint256 _newPayoutAmount) external onlyGovernor;

Parameters

NameTypeDescription
_newPayoutAmountuint256updated payout amount

setPayoutToken

Set the payout token for the bribe collector.

function setPayoutToken(address _newPayoutToken) external onlyGovernor;

Parameters

NameTypeDescription
_newPayoutTokenaddressupdated payout token

claimFees

Claims accumulated bribes in exchange for payout token

Only callable by accounts with the KEEPER_ROLE for security to prevent potential economic losses from unpredictable external validator incentives

function claimFees(
    address _recipient,
    address[] calldata _feeTokens,
    uint256[] calldata _feeAmounts
) external onlyKeeper;

Parameters

NameTypeDescription
_recipientaddressThe Address to receive claimed tokens
_feeTokensaddress[]Array of token addresses to claim
_feeAmountsuint256[]Array of amounts to claim for each fee token

sweepPayoutToken

function sweepPayoutToken() external;