GaugeRewardReceiver

Git Source

Inherits: Clone, Rescuable, ReentrancyGuardUpgradeable, AccessControlEnumerableUpgradeable

Contract to receive rewards from a Yearn gauge and distribute them according to specified splits.

Inherits from Clone and ReentrancyGuardUpgradeable for creating clones acts and preventing reentrancy attacks.

Functions

constructor

Initializes the contract by disabling initializers from the Clone pattern.

constructor() payable;

initialize

Initializes the GaugeRewardReceiver contract.

function initialize(address admin_) external initializer;

Parameters

NameTypeDescription
admin_addressThe address of the owner of the contract.

harvest

Harvest rewards from the gauge and distribute to treasury, compound, and veYFI

function harvest(
    address swapAndLock,
    address treasury,
    address coveYfiRewardForwarder,
    IYearnStakingDelegate.RewardSplit calldata rewardSplit
)
    external
    nonReentrant
    returns (uint256);

Parameters

NameTypeDescription
swapAndLockaddressAddress of the SwapAndLock contract.
treasuryaddressAddress of the treasury to receive a portion of the rewards.
coveYfiRewardForwarderaddressAddress of the CoveYfiRewardForwarder contract.
rewardSplitIYearnStakingDelegate.RewardSplitStruct containing the split percentages for lock, treasury, and user rewards.

Returns

NameTypeDescription
<none>uint256userRewardsAmount The amount of rewards harvested for the user.

rescue

Rescue tokens from the contract. May only be called by the owner. Token cannot be the reward token.

function rescue(IERC20 token, address to, uint256 amount) external onlyRole(DEFAULT_ADMIN_ROLE);

Parameters

NameTypeDescription
tokenIERC20address of the token to rescue.
toaddressaddress to send the rescued tokens to.
amountuint256amount of tokens to rescue.

stakingDelegate

Get the address of the staking delegate from the contract's immutable arguments.

function stakingDelegate() public pure returns (address);

Returns

NameTypeDescription
<none>addressThe address of the staking delegate.

gauge

Get the address of the gauge from the contract's immutable arguments.

function gauge() public pure returns (address);

Returns

NameTypeDescription
<none>addressThe address of the gauge.

rewardToken

Get the address of the reward token from the contract's immutable arguments.

function rewardToken() public pure returns (address);

Returns

NameTypeDescription
<none>addressThe address of the reward token.

stakingDelegateRewards

Get the address of the staking delegate rewards contract from the contract's immutable arguments.

function stakingDelegateRewards() public pure returns (address);

Returns

NameTypeDescription
<none>addressThe address of the staking delegate rewards contract.