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

IRAuction

Git Source

Inherits: InfraredUpgradeable

Title: IRAuction

Auctions portion of iBGT vault rewards to IR, then compounds in sIR

Similar to BribeCollector pattern but for sIR reward auto-compounding

Auction mechanism: Pay IR tokens to claim non-IR reward tokens

State Variables

IR_TOKEN

IR token that must be paid to claim auction rewards

ERC20 internal IR_TOKEN

SIR_VAULT

sIR vault that receives compounded IR

IStakedIR internal SIR_VAULT

payoutAmount

Amount of IR required per auction claim

uint256 public payoutAmount

__gap

uint256[40] private __gap

Functions

initialize

function initialize(
    address _infrared,
    address _gov,
    address _keeper,
    address _irToken,
    address _sirVault,
    uint256 _payoutAmount
) external initializer;

claimFees

Claim auction rewards by paying IR

Converts paid IR to sIR shares via compounding (increases share value)

function claimFees(
    address _recipient,
    address[] calldata rewardTokens,
    uint256[] calldata amounts
) external virtual onlyKeeper;

Parameters

NameTypeDescription
_recipientaddressAddress to receive rewardTokens
rewardTokensaddress[]Array of reward token addresses to claim
amountsuint256[]Array of amounts for each reward token

sweepPayoutToken

function sweepPayoutToken() external;

setPayoutAmount

Update payout amount (governance function)

function setPayoutAmount(uint256 _newAmount) external virtual onlyGovernor;

Parameters

NameTypeDescription
_newAmountuint256New amount of IR required per auction claim

recoverERC20

Recover stuck tokens (governance function)

Emergency function to recover tokens sent to contract by mistake

function recoverERC20(address token, address to, uint256 amount)
    external
    virtual
    onlyGovernor;

Parameters

NameTypeDescription
tokenaddressToken address to recover
toaddressRecipient address
amountuint256Amount to recover

getTokenBalance

Get balance of a specific token held by this contract

function getTokenBalance(address token)
    external
    view
    virtual
    returns (uint256);

Parameters

NameTypeDescription
tokenaddressToken address to check

Returns

NameTypeDescription
<none>uint256The token balance

payoutToken

Get payout token address

function payoutToken() external view virtual returns (address);

Returns

NameTypeDescription
<none>addresspayout token address

Events

AuctionClaimed

event AuctionClaimed(
    address indexed claimer,
    address indexed rewardToken,
    uint256 rewardAmount,
    uint256 irPaid
);

PayoutAmountSet

event PayoutAmountSet(uint256 oldAmount, uint256 newAmount);

TokensRecovered

event TokensRecovered(
    address indexed token, address indexed to, uint256 amount
);