GaugeRewardReceiver
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
Name | Type | Description |
---|---|---|
admin_ | address | The 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
Name | Type | Description |
---|---|---|
swapAndLock | address | Address of the SwapAndLock contract. |
treasury | address | Address of the treasury to receive a portion of the rewards. |
coveYfiRewardForwarder | address | Address of the CoveYfiRewardForwarder contract. |
rewardSplit | IYearnStakingDelegate.RewardSplit | Struct containing the split percentages for lock, treasury, and user rewards. |
Returns
Name | Type | Description |
---|---|---|
<none> | uint256 | userRewardsAmount 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
Name | Type | Description |
---|---|---|
token | IERC20 | address of the token to rescue. |
to | address | address to send the rescued tokens to. |
amount | uint256 | amount 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
Name | Type | Description |
---|---|---|
<none> | address | The 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
Name | Type | Description |
---|---|---|
<none> | address | The 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
Name | Type | Description |
---|---|---|
<none> | address | The 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
Name | Type | Description |
---|---|---|
<none> | address | The address of the staking delegate rewards contract. |