HarvestBaseCollector
Inherits: InfraredUpgradeable
Auction contract for iBGT to WBERA conversion for base fees to compound to iBERA holders
Simplified version of BribeCollector. This contract allows keepers to claim iBGT fees by paying a fixed WBERA amount, which is converted to native BERA and sent to the fee receiver for compounding.
Note: oz-upgrades:
State Variables
feeReceivor
the addres of the fee recivor contract that compounds BERA to iBERA.
address public feeReceivor;
ibgt
the addres of iBGT, the expected fee token
ERC20 public ibgt;
wbera
WBERA token that is used instead of native BERA token.
WBERA public wbera;
payoutAmount
Payout amount is a constant value that is paid by the caller of the claimFees
function.
uint256 public payoutAmount;
__gap
uint256[20] private __gap;
Functions
initialize
Initializes the contract with required parameters and roles.
Reverts if any address is zero or payout amount is zero. Grants roles and initializes upgradeable components.
function initialize(
address _infrared,
address _gov,
address _keeper,
address _ibgt,
address _wbera,
address _feeReceivor,
uint256 _payoutAmount
) external initializer;
Parameters
Name | Type | Description |
---|---|---|
_infrared | address | Address of the Infrared contract. |
_gov | address | Address of the governance. |
_keeper | address | Address of the keeper. |
_ibgt | address | Address of the iBGT token. |
_wbera | address | Address of the WBERA token. |
_feeReceivor | address | Address of the fee receiver. |
_payoutAmount | uint256 | Initial payout amount. |
setPayoutAmount
Set the payout amount for the bribe collector.
Only callable by the governor. Reverts if amount is zero. Emits PayoutAmountSet.
function setPayoutAmount(uint256 _newPayoutAmount) external onlyGovernor;
Parameters
Name | Type | Description |
---|---|---|
_newPayoutAmount | uint256 | updated payout amount |
claimFee
Claims fees by transferring WBERA payout from caller, converting to native BERA, sending to fee receiver, and transferring iBGT to recipient.
Only callable by keeper. Reverts on insufficient balances or zero recipient. Emits FeeClaimed.
function claimFee(address _recipient, uint256 _feeAmount) external onlyKeeper;
Parameters
Name | Type | Description |
---|---|---|
_recipient | address | The address to receive the iBGT fees. |
_feeAmount | uint256 | The amount of iBGT to transfer. |
sweep
Sweeps any WBERA or native BERA balances to the fee receiver.
Only callable by keeper. Useful for recovering stuck funds.
function sweep() external onlyKeeper;
receive
Fallback function to receive BERA
receive() external payable;
Events
PayoutAmountSet
Emitted when the payout amount is updated by the governor
event PayoutAmountSet(
uint256 indexed oldPayoutAmount, uint256 indexed newPayoutAmount
);
Parameters
Name | Type | Description |
---|---|---|
oldPayoutAmount | uint256 | Previous payout amount |
newPayoutAmount | uint256 | New payout amount set |
FeeClaimed
Emitted when the fees are claimed
event FeeClaimed(
address indexed caller, address indexed recipient, uint256 amount
);
Parameters
Name | Type | Description |
---|---|---|
caller | address | Caller of the claimFees function |
recipient | address | The address to which collected POL bribes will be transferred |
amount | uint256 | The amount of fee token to transfer |