YearnGaugeStrategyBase
Abstract base contract for Yearn gauge strategies, handling deposits and withdrawals to the YearnStakingDelegate.
State Variables
_DYFI
Address of the dYFI token
address internal constant _DYFI = 0x41252E8691e964f7DE35156B68493bAb6797a275;
_YFI
Address of the YFI token
address internal constant _YFI = 0x0bc529c00C6401aEF6D220BE8C6Ea1667F6Ad93e;
_YEARN_STAKING_DELEGATE
Address of the YearnStakingDelegate contract
address internal immutable _YEARN_STAKING_DELEGATE;
_VAULT_ASSET
Address of the vault's underlying asset
address internal immutable _VAULT_ASSET;
_VAULT
Address of the Yearn vault
address internal immutable _VAULT;
Functions
constructor
Sets the initial configuration of the strategy and approves the maximum amount of tokens to the YearnStakingDelegate.
constructor(address asset_, address yearnStakingDelegate_);
Parameters
Name | Type | Description |
---|---|---|
asset_ | address | The address of the asset (gauge token). |
yearnStakingDelegate_ | address | The address of the Yearn Staking Delegate. |
yearnStakingDelegate
Get the address of the YearnStakingDelegate.
function yearnStakingDelegate() external view returns (address);
Returns
Name | Type | Description |
---|---|---|
<none> | address | The address of the YearnStakingDelegate. |
vaultAsset
Get the address of the vault's underlying asset. This is the asset that is deposited into the vault which then is deposited into the gauge.
function vaultAsset() external view returns (address);
Returns
Name | Type | Description |
---|---|---|
<none> | address | The address of the vault's underlying asset. |
vault
Get the address of the vault. This is the Yearn vault that the gauge is for.
function vault() external view returns (address);
Returns
Name | Type | Description |
---|---|---|
<none> | address | The address of the vault. |
_depositToYSD
Internal function to deposit assets into the YearnStakingDelegate.
function _depositToYSD(address asset, uint256 amount) internal virtual;
Parameters
Name | Type | Description |
---|---|---|
asset | address | The address of the asset to deposit. |
amount | uint256 | The amount of the asset to deposit. |
_withdrawFromYSD
Internal function to withdraw assets from the YearnStakingDelegate.
function _withdrawFromYSD(address asset, uint256 amount) internal virtual;
Parameters
Name | Type | Description |
---|---|---|
asset | address | The address of the asset to withdraw. |
amount | uint256 | The amount of the asset to withdraw. |
depositedInYSD
Return the amount of the asset deposited by this contract in the YearnStakingDelegate.
function depositedInYSD(address asset) public view returns (uint256);
Parameters
Name | Type | Description |
---|---|---|
asset | address | The address of the asset to check. |
Returns
Name | Type | Description |
---|---|---|
<none> | uint256 | The amount of the asset deposited in the YearnStakingDelegate. |