CommonReportTrigger

CommonReportTrigger

State Variables

name

baseFeeProvider

acceptableBaseFee

customStrategyTrigger

customStrategyBaseFee

customVaultTrigger

customVaultBaseFee

Functions

constructor

setCustomStrategyTrigger

setCustomStrategyBaseFee

setCustomVaultTrigger

setCustomVaultBaseFee

strategyReportTrigger

defaultStrategyReportTrigger

vaultReportTrigger

defaultVaultReportTrigger

strategyTendTrigger

getCurrentBaseFee

isCurrentBaseFeeAcceptable

setBaseFeeProvider

setAcceptableBaseFee

Events

NewBaseFeeProvider

UpdatedAcceptableBaseFee

UpdatedCustomStrategyTrigger

UpdatedCustomStrategyBaseFee

UpdatedCustomVaultTrigger

UpdatedCustomVaultBaseFee

# CommonReportTrigger

Git Source (https://github.com/yearn/tokenized-strategy-periphery/blob/47e243f39ea0af6568d38d6425354208999e629d/src/ReportTrigger/CommonReportTrigger.sol)

Inherits: Governance

Author:
Yearn.finance

This is a central contract that keepers can use
to decide if Yearn V3 strategies should report profits as
well as when a V3 Vaults should record a strategies profits.
It allows for a simple default flow that most strategies
and vaults can use for easy integration with a keeper network.
However, it is also customizable by the strategy and vaults
management to allow complete customization if desired.

## State Variables

### name

```
string public name = "Yearn Common Report Trigger";
```

### baseFeeProvider

```
address public baseFeeProvider;
```

### acceptableBaseFee

```
uint256 public acceptableBaseFee;
```

### customStrategyTrigger

```
mapping(address => address) public customStrategyTrigger;
```

### customStrategyBaseFee

```
mapping(address => uint256) public customStrategyBaseFee;
```

### customVaultTrigger

```
mapping(address => mapping(address => address)) public customVaultTrigger;
```

### customVaultBaseFee

```
mapping(address => mapping(address => uint256)) public customVaultBaseFee;
```

## Functions

### constructor

```
constructor(address _governance) Governance(_governance);
```

### setCustomStrategyTrigger

Set a custom report trigger contract for a strategy.

This gives the `management` of a specific strategy the option
to enforce a custom report trigger for their strategy easily while
still using this standard contract for keepers to read the trigger
status from.
The custom trigger contract only needs to implement the `reportTrigger`
function to return true or false.

```
function setCustomStrategyTrigger(address _strategy, address _trigger) external virtual;
```

Parameters

NameTypeDescription`_strategy``address`The address of the strategy to set the trigger for.`_trigger``address`The address of the custom trigger contract.

### setCustomStrategyBaseFee

Set a custom base fee for a specific strategy.

This can be set by a strategies `management` to increase or
decrease the acceptable network base fee for a specific strategies
trigger to return true.
This can be used instead of a custom trigger contract.
This will have no effect if a custom trigger is set for the strategy.

```
function setCustomStrategyBaseFee(address _strategy, uint256 _baseFee) external virtual;
```

Parameters

NameTypeDescription`_strategy``address`The address of the strategy to customize.`_baseFee``uint256`The max acceptable network base fee.

### setCustomVaultTrigger

Set a custom report trigger contract for a vaults strategy.

This gives the management of a vault the option to enforce a
custom report trigger for a specific strategy attached to the vault
while still using this standard contract for keepers to read the
trigger status from.
The address calling must have the `REPORTING_MANAGER` role on the vault.
The custom trigger contract only needs to implement the `reportTrigger`
function to return true or false.

```
function setCustomVaultTrigger(address _vault, address _strategy, address _trigger) external virtual;
```

Parameters

NameTypeDescription`_vault``address`The address of the vault`_strategy``address`The address of the strategy to set the trigger for.`_trigger``address`The address of the custom trigger contract.

### setCustomVaultBaseFee

Set a custom base fee for a vaults strategy.

This can be set by the vaults management to increase or
decrease the acceptable network base fee for a specific strategies
trigger to return true.
This can be used instead of a custom trigger contract.
This will have no effect if a custom trigger is set for the strategy.
The address calling must have the `REPORTING_MANAGER` role on the vault.

```
function setCustomVaultBaseFee(address _vault, address _strategy, uint256 _baseFee) external virtual;
```

Parameters

NameTypeDescription`_vault``address`The address of the vault.`_strategy``address`The address of the strategy to customize.`_baseFee``uint256`The max acceptable network base fee.

### strategyReportTrigger

Returns whether or not a strategy is ready for a keeper to call `report`.

Will first check if a custom trigger is set. If not it will use
the default trigger flow.

```
function strategyReportTrigger(address _strategy) external view virtual returns (bool, bytes memory);
```

Parameters

NameTypeDescription`_strategy``address`The address of the strategy to check the trigger for.

Returns

NameTypeDescription```bool`. Bool representing if the strategy is ready to report.```bytes`. Bytes with either the calldata or reason why False.

### defaultStrategyReportTrigger

The default trigger logic for a strategy.

*This is kept in a separate function so it can still
be used by custom triggers even if extra checks are needed
first or after.
This will also check if a custom acceptable base fee has been set
by the strategies management.
In order for the default flow to return true the strategy must:

- Not be shutdown.

- Have funds.

- The current network base fee be below the `acceptableBaseFee`.

- The time since the last report be > the strategies `profitMaxUnlockTime`.*

```
function defaultStrategyReportTrigger(address _strategy) public view virtual returns (bool, bytes memory);
```

Parameters

NameTypeDescription`_strategy``address`The address of the strategy to check the trigger for.

Returns

NameTypeDescription```bool`. Bool representing if the strategy is ready to report.```bytes`. Bytes with either the calldata or reason why False.

### vaultReportTrigger

Return whether or not a report should be called on a vault for
a specific strategy.

Will first check if a custom trigger is set. If not it will use
the default trigger flow.

```
function vaultReportTrigger(address _vault, address _strategy) external view virtual returns (bool, bytes memory);
```

Parameters

NameTypeDescription`_vault``address`The address of the vault.`_strategy``address`The address of the strategy to report.

Returns

NameTypeDescription```bool`. Bool if the strategy should report to the vault.```bytes`. Bytes with either the calldata or reason why False.

### defaultVaultReportTrigger

The default trigger logic for a vault.

*This is kept in a separate function so it can still
be used by custom triggers even if extra checks are needed
before or after.
This will also check if a custom acceptable base fee has been set
by the vault management for the `_strategy`.
In order for the default flow to return true:

- The vault must not be shutdown.

- The strategy must be active and have debt allocated.

- The current network base fee be below the `acceptableBaseFee`.

- The time since the strategies last report be > the vaults `profitMaxUnlockTime`.*

```
function defaultVaultReportTrigger(address _vault, address _strategy) public view virtual returns (bool, bytes memory);
```

Parameters

NameTypeDescription`_vault``address`The address of the vault.`_strategy``address`The address of the strategy to report.

Returns

NameTypeDescription```bool`. Bool if the strategy should report to the vault.```bytes`. Bytes with either the calldata or reason why False.

### strategyTendTrigger

Return whether or not a strategy should be tended by a keeper.

This can be used as an easy keeper integration for any strategy that
implements a tendTrigger.
It is expected that a strategy implement all needed checks such as
isShutdown, totalAssets > 0 and base fee checks within the trigger.

```
function strategyTendTrigger(address _strategy) external view virtual returns (bool, bytes memory);
```

Parameters

NameTypeDescription`_strategy``address`Address of the strategy to check.

Returns

NameTypeDescription```bool`. Bool if the strategy should be tended.```bytes`. Bytes with the calldata.

### getCurrentBaseFee

Returns the current base fee from the provider.

Will return 0 if a base fee provider is not set.

```
function getCurrentBaseFee() public view virtual returns (uint256);
```

Returns

NameTypeDescription```uint256`. The current base fee for the chain.

### isCurrentBaseFeeAcceptable

Returns whether or not the current base fee is acceptable
based on the default `acceptableBaseFee`.

Can be used in custom triggers to easily still use this contracts
fee provider and acceptableBaseFee. And makes it backwards compatible to V2.
Will always return `true` if no `baseFeeProvider` is set.

```
function isCurrentBaseFeeAcceptable() external view virtual returns (bool);
```

Returns

NameTypeDescription```bool`. IF the current base fee is acceptable.

### setBaseFeeProvider

Sets the address used to pull the current network base fee.

Throws if the caller is not current governance.

```
function setBaseFeeProvider(address _baseFeeProvider) external virtual onlyGovernance;
```

Parameters

NameTypeDescription`_baseFeeProvider``address`The network's baseFeeProvider address.

### setAcceptableBaseFee

Sets the default acceptable current network base fee.

Throws if the caller is not current governance.

```
function setAcceptableBaseFee(uint256 _newAcceptableBaseFee) external virtual onlyGovernance;
```

Parameters

NameTypeDescription`_newAcceptableBaseFee``uint256`The acceptable network base fee.

## Events

### NewBaseFeeProvider

```
event NewBaseFeeProvider(address indexed provider);
```

### UpdatedAcceptableBaseFee

```
event UpdatedAcceptableBaseFee(uint256 acceptableBaseFee);
```

### UpdatedCustomStrategyTrigger

```
event UpdatedCustomStrategyTrigger(address indexed strategy, address indexed trigger);
```

### UpdatedCustomStrategyBaseFee

```
event UpdatedCustomStrategyBaseFee(address indexed strategy, uint256 acceptableBaseFee);
```

### UpdatedCustomVaultTrigger

```
event UpdatedCustomVaultTrigger(address indexed vault, address indexed strategy, address indexed trigger);
```

### UpdatedCustomVaultBaseFee

```
event UpdatedCustomVaultBaseFee(address indexed vault, address indexed strategy, uint256 acceptableBaseFee);
```


Yearn4626Router

State Variables

Functions

constructor

name

depositToVault

depositToVault

depositToVault

depositToVault

redeem

redeem

redeem

migrate

migrate

migrate

migrate

# Yearn4626Router

Git Source (https://github.com/yearn/Yearn-ERC4626-Router/blob/68165774ec8858b43db24620756402def14b7ec1/src/Yearn4626Router.sol)

Inherits: IYearn4626Router, Yearn4626RouterBase

Router that is meant to be used with Yearn V3 vaults and strategies
for deposits, withdraws and migrations.
The router was developed from the original router by FEI protocol
https://github.com/fei-protocol/ERC4626
The router is designed to be used with permit and multicall for the
optimal experience.
NOTE: It is important to never leave tokens in the router at the
end of a call, otherwise they can be swept by anyone.

## State Variables

### _name

```
bytes32 private immutable _name;
```

## Functions

### constructor

```
constructor(string memory _name_, IWETH9 weth) PeripheryPayments(weth);
```

### name

```
function name() external view returns (string memory);
```

### depositToVault

deposit `amount` to an ERC4626 vault.

throws "!minShares" Error.

```
function depositToVault(IYearn4626 vault, uint256 amount, address to, uint256 minSharesOut) public payable override returns (uint256);
```

Parameters

NameTypeDescription`vault``IYearn4626`The ERC4626 vault to deposit assets to.`amount``uint256`The amount of assets to deposit to `vault`.`to``address`The destination of ownership shares.`minSharesOut``uint256`The min amount of `vault` shares received by `to`.

Returns

NameTypeDescription```uint256`. the amount of shares received by `to`.

### depositToVault

See depositToVault (https://docs.yearn.fi/developers/smart-contracts/V3/Periphery/Yearn4626Router/#deposittovault) in IYearn4626Router.

Uses msg.sender as the default for `to`.

```
function depositToVault(IYearn4626 vault, uint256 amount, uint256 minSharesOut) external payable returns (uint256);
```

### depositToVault

See depositToVault (https://docs.yearn.fi/developers/smart-contracts/V3/Periphery/Yearn4626Router/#deposittovault) in IYearn4626Router.

Uses msg.sender as the default for `to` and their full
balance of msg.sender as `amount`.

```
function depositToVault(IYearn4626 vault, uint256 minSharesOut) external payable returns (uint256);
```

### depositToVault

See depositToVault (https://docs.yearn.fi/developers/smart-contracts/V3/Periphery/Yearn4626Router/#deposittovault) in IYearn4626Router.

Uses msg.sender as the default for `to`, their full balance
of msg.sender as `amount` and 1 Basis point for `maxLoss`.
NOTE: The slippage tollerance is only useful if `previewDeposit`
cannot be manipulated for the `vault`.

```
function depositToVault(IYearn4626 vault) external payable returns (uint256);
```

### redeem

See redeem (https://docs.yearn.fi/developers/smart-contracts/V3/Periphery/Yearn4626Router/#redeem) in IYearn4626RouterBase.

Uses msg.sender as `receiver`.

```
function redeem(IYearn4626 vault, uint256 shares, uint256 maxLoss) external payable returns (uint256);
```

### redeem

See redeem (https://docs.yearn.fi/developers/smart-contracts/V3/Periphery/Yearn4626Router/#redeem) in IYearn4626RouterBase.

Uses msg.sender as `receiver` and their full balance as `shares`.

```
function redeem(IYearn4626 vault, uint256 maxLoss) external payable returns (uint256);
```

### redeem

See redeem (https://docs.yearn.fi/developers/smart-contracts/V3/Periphery/Yearn4626Router/#redeem) in IYearn4626RouterBase.

Uses msg.sender as `receiver`, their full balance as `shares`
and 1 Basis Point for `maxLoss`.

```
function redeem(IYearn4626 vault) external payable returns (uint256);
```

### migrate

will redeem `shares` from one vault and deposit amountOut to a different ERC4626 vault.

throws "!minAmount", "!minShares" Errors.

```
function migrate(IYearn4626 fromVault, IYearn4626 toVault, uint256 shares, address to, uint256 minSharesOut) public payable override returns (uint256);
```

Parameters

NameTypeDescription`fromVault``IYearn4626`The ERC4626 vault to redeem shares from.`toVault``IYearn4626`The ERC4626 vault to deposit assets to.`shares``uint256`The amount of shares to redeem from fromVault.`to``address`The destination of ownership shares.`minSharesOut``uint256`The min amount of toVault shares received by `to`.

Returns

NameTypeDescription```uint256`. the amount of shares received by `to`.

### migrate

See migrate (https://docs.yearn.fi/developers/smart-contracts/V3/Periphery/Yearn4626Router/#migrate) in IYearn4626Router.

Uses msg.sender as `to`.

```
function migrate(IYearn4626 fromVault, IYearn4626 toVault, uint256 shares, uint256 minSharesOut) external payable returns (uint256);
```

### migrate

See migrate (https://docs.yearn.fi/developers/smart-contracts/V3/Periphery/Yearn4626Router/#migrate) in IYearn4626Router.

Uses msg.sender as `to` and their full balance for `shares`.

```
function migrate(IYearn4626 fromVault, IYearn4626 toVault, uint256 minSharesOut) external payable returns (uint256);
```

### migrate

See migrate (https://docs.yearn.fi/developers/smart-contracts/V3/Periphery/Yearn4626Router/#migrate) in IYearn4626Router.

Uses msg.sender as `to`, their full balance for `shares` and no `minamountOut`.
NOTE: Using this will enforce no slippage checks and should be used with care.

```
function migrate(IYearn4626 fromVault, IYearn4626 toVault) external payable returns (uint256);
```

### migrateFromV2

migrate from Yearn V2 vault to a V3 vault'.

throws "!minAmount", "!minShares" Errors.

```
function migrateFromV2(IYearnV2 fromVault, IYearn4626 toVault, uint256 shares, address to, uint256 minSharesOut) public payable override returns (uint256);
```

Parameters

NameTypeDescription`fromVault``IYearnV2`The Yearn V2 vault to withdraw from.`toVault``IYearn4626`The Yearn V3 vault to deposit assets to.`shares``uint256`The amount of V2 shares to redeem form 'fromVault'.`to``address`The destination of ownership shares`minSharesOut``uint256`The min amount of 'toVault' shares to be received by 'to'.

Returns

NameTypeDescription```uint256`. The actual amount of 'toVault' shares received by 'to'.

### migrateFromV2

See migrateFromV2 (https://docs.yearn.fi/developers/smart-contracts/V3/Periphery/Yearn4626Router/#migratefromv2) in IYearn4626Router.

Uses msg.sender as `to`.

```
function migrateFromV2(IYearnV2 fromVault, IYearn4626 toVault, uint256 shares, uint256 minSharesOut) external payable returns (uint256);
```

### migrateFromV2

See migrateFromV2 (https://docs.yearn.fi/developers/smart-contracts/V3/Periphery/Yearn4626Router/#migratefromv2) in IYearn4626Router.

Uses msg.sender as `to` and their full balance as `shares`.

```
function migrateFromV2(IYearnV2 fromVault, IYearn4626 toVault, uint256 minSharesOut) external payable returns (uint256);
```

### migrateFromV2

See migrate (https://docs.yearn.fi/developers/smart-contracts/V3/Periphery/Yearn4626Router/#migrate) in IYearn4626Router.

Uses msg.sender as `to`, their full balance for `shares` and no `minamountOut`.
NOTE: Using this will enforce no slippage checks and should be used with care.

```
function migrateFromV2(IYearnV2 fromVault, IYearn4626 toVault) external payable returns (uint256 sharesOut);
```


Yearn4626RouterBase

Functions

mint

deposit

withdraw

withdrawDefault

redeem

redeemDefault

# Yearn4626RouterBase

Git Source (https://github.com/yearn/Yearn-ERC4626-Router/blob/68165774ec8858b43db24620756402def14b7ec1/src/Yearn4626RouterBase.sol)

Inherits: IYearn4626RouterBase, SelfPermit, Multicall, PeripheryPayments

## Functions

### mint

mint `shares` from an ERC4626 vault.

throws "!maxAmount" Error

```
function mint(IYearn4626 vault, uint256 shares, address to, uint256 maxAmountIn) public payable virtual override returns (uint256 amountIn);
```

Parameters

NameTypeDescription`vault``IYearn4626`The ERC4626 vault to mint shares from.`shares``uint256`The amount of shares to mint from `vault`.`to``address`The destination of ownership shares.`maxAmountIn``uint256`The max amount of assets used to mint.

Returns

NameTypeDescription`amountIn``uint256`the amount of assets used to mint by `to`.

### deposit

deposit `amount` to an ERC4626 vault.

throws "!minShares" Error

```
function deposit(IYearn4626 vault, uint256 amount, address to, uint256 minSharesOut) public payable virtual override returns (uint256 sharesOut);
```

Parameters

NameTypeDescription`vault``IYearn4626`The ERC4626 vault to deposit assets to.`amount``uint256`The amount of assets to deposit to `vault`.`to``address`The destination of ownership shares.`minSharesOut``uint256`The min amount of `vault` shares received by `to`.

Returns

NameTypeDescription`sharesOut``uint256`the amount of shares received by `to`.

### withdraw

withdraw `amount` from an ERC4626 vault.

Uses the Yearn specific 'maxLoss' accounting.

```
function withdraw(IYearn4626 vault, uint256 amount, address to, uint256 maxLoss) public payable virtual override returns (uint256);
```

Parameters

NameTypeDescription`vault``IYearn4626`The ERC4626 vault to redeem shares from.`amount``uint256`The amount of assets to withdraw from vault.`to``address`The destination of assets.`maxLoss``uint256`The acceptable loss in Basis Points.

Returns

NameTypeDescription```uint256`sharesOut the amount of shares received by `to`.

### withdrawDefault

withdraw `amount` from an ERC4626 vault.

Uses the default 4626 syntax, throws !maxShares" Error.

```
function withdrawDefault(IYearn4626 vault, uint256 amount, address to, uint256 maxSharesOut) public payable virtual override returns (uint256 sharesOut);
```

Parameters

NameTypeDescription`vault``IYearn4626`The ERC4626 vault to withdraw assets from.`amount``uint256`The amount of assets to withdraw from vault.`to``address`The destination of assets.`maxSharesOut``uint256`

Returns

NameTypeDescription`sharesOut``uint256`the amount of shares received by `to`.

### redeem

redeem `shares` shares from an ERC4626 vault.

Uses the Yearn specific 'maxLoss' accounting.

```
function redeem(IYearn4626 vault, uint256 shares, address to, uint256 maxLoss) public payable virtual override returns (uint256);
```

Parameters

NameTypeDescription`vault``IYearn4626`The ERC4626 vault to redeem shares from.`shares``uint256`The amount of shares to redeem from vault.`to``address`The destination of assets.`maxLoss``uint256`The acceptable loss in Basis Points.

Returns

NameTypeDescription```uint256`amountOut the amount of assets received by `to`.

### redeemDefault

redeem `shares` shares from an ERC4626 vault.

Uses the default 4626 syntax, throws "!minAmount" Error.

```
function redeemDefault(IYearn4626 vault, uint256 shares, address to, uint256 minAmountOut) public payable virtual override returns (uint256 amountOut);
```

Parameters

NameTypeDescription`vault``IYearn4626`The ERC4626 vault to redeem shares from.`shares``uint256`The amount of shares to redeem from vault.`to``address`The destination of assets.`minAmountOut``uint256`The min amount of assets received by `to`.

Returns

NameTypeDescription`amountOut``uint256`the amount of assets received by `to`.


PeripheryPayments

PeripheryPayments

State Variables

Functions

constructor

receive

approve

pullToken

sweepToken

refundETH

# PeripheryPayments

Git Source (https://github.com/yearn/Yearn-ERC4626-Router/blob/68165774ec8858b43db24620756402def14b7ec1/src/external/PeripheryPayments.sol)

Immutable state used by periphery contracts
Largely Forked from https://github.com/Uniswap/v3-periphery/blob/main/contracts/base/PeripheryPayments.sol
Changes:
no interface
no inheritdoc
add immutable WETH9 in constructor instead of PeripheryImmutableState
receive from any address
Solmate interfaces and transfer lib
casting
add approve, wrapWETH9 and pullToken

## State Variables

### WETH9

```
IWETH9 public immutable WETH9;
```

## Functions

### constructor

```
constructor(IWETH9 _WETH9);
```

### receive

```
receive() external payable;
```

### approve

```
function approve(ERC20 token, address to, uint256 amount) public payable;
```

### unwrapWETH9

```
function unwrapWETH9(uint256 amountMinimum, address recipient) public payable;
```

### wrapWETH9

```
function wrapWETH9() public payable;
```

### pullToken

```
function pullToken(ERC20 token, uint256 amount, address recipient) public payable;
```

### sweepToken

```
function sweepToken(ERC20 token, uint256 amountMinimum, address recipient) public payable;
```

### refundETH

```
function refundETH() external payable;
```


Multicall

Multicall

Functions

multicall

# Multicall

Git Source (https://github.com/yearn/Yearn-ERC4626-Router/blob/68165774ec8858b43db24620756402def14b7ec1/src/external/Multicall.sol)

Inherits: IMulticall

Enables calling multiple methods in a single call to the contract

## Functions

### multicall

Call multiple functions in the current contract and return the data from all of them if they all succeed

The `msg.value` should not be trusted for any method callable from multicall.

```
function multicall(bytes[] calldata data) public payable override returns (bytes[] memory results);
```

Parameters

NameTypeDescription`data``bytes[]`The encoded function data for each of the calls to make to this contract

Returns

NameTypeDescription`results``bytes[]`The results from each of the calls passed in via data


SelfPermit

SelfPermit

Functions

selfPermit

selfPermitIfNecessary

selfPermitAllowed

selfPermitAllowedIfNecessary

# SelfPermit

Git Source (https://github.com/yearn/Yearn-ERC4626-Router/blob/68165774ec8858b43db24620756402def14b7ec1/src/external/SelfPermit.sol)

Inherits: ISelfPermit

Functionality to call permit on any EIP-2612-compliant token for use in the route

These functions are expected to be embedded in multicalls to allow EOAs to approve a contract and call a function
that requires an approval in a single transaction.

## Functions

### selfPermit

Permits this contract to spend a given token from `msg.sender`

The `owner` is always msg.sender and the `spender` is always address(this).

```
function selfPermit(address token, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) public payable override;
```

Parameters

NameTypeDescription`token``address`The address of the token spent`value``uint256`The amount that can be spent of token`deadline``uint256`A timestamp, the current blocktime must be less than or equal to this timestamp`v``uint8`Must produce valid secp256k1 signature from the holder along with `r` and `s``r``bytes32`Must produce valid secp256k1 signature from the holder along with `v` and `s``s``bytes32`Must produce valid secp256k1 signature from the holder along with `r` and `v`

### selfPermitIfNecessary

Permits this contract to spend a given token from `msg.sender`

The `owner` is always msg.sender and the `spender` is always address(this).
Can be used instead of #selfPermit to prevent calls from failing due to a frontrun of a call to #selfPermit

```
function selfPermitIfNecessary(address token, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) external payable override;
```

Parameters

NameTypeDescription`token``address`The address of the token spent`value``uint256`The amount that can be spent of token`deadline``uint256`A timestamp, the current blocktime must be less than or equal to this timestamp`v``uint8`Must produce valid secp256k1 signature from the holder along with `r` and `s``r``bytes32`Must produce valid secp256k1 signature from the holder along with `v` and `s``s``bytes32`Must produce valid secp256k1 signature from the holder along with `r` and `v`

### selfPermitAllowed

Permits this contract to spend the sender's tokens for permit signatures that have the `allowed` parameter

The `owner` is always msg.sender and the `spender` is always address(this)

```
function selfPermitAllowed(address token, uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s) public payable override;
```

Parameters

NameTypeDescription`token``address`The address of the token spent`nonce``uint256`The current nonce of the owner`expiry``uint256`The timestamp at which the permit is no longer valid`v``uint8`Must produce valid secp256k1 signature from the holder along with `r` and `s``r``bytes32`Must produce valid secp256k1 signature from the holder along with `v` and `s``s``bytes32`Must produce valid secp256k1 signature from the holder along with `r` and `v`

### selfPermitAllowedIfNecessary

Permits this contract to spend the sender's tokens for permit signatures that have the `allowed` parameter

The `owner` is always msg.sender and the `spender` is always address(this)
Can be used instead of #selfPermitAllowed to prevent calls from failing due to a frontrun of a call to #selfPermitAllowed.

```
function selfPermitAllowedIfNecessary(address token, uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s) external payable override;
```

Parameters

NameTypeDescription`token``address`The address of the token spent`nonce``uint256`The current nonce of the owner`expiry``uint256`The timestamp at which the permit is no longer valid`v``uint8`Must produce valid secp256k1 signature from the holder along with `r` and `s``r``bytes32`Must produce valid secp256k1 signature from the holder along with `v` and `s``s``bytes32`Must produce valid secp256k1 signature from the holder along with `r` and `v`


V2 yVault Smart Contracts

V2 yVault Smart Contracts

📄 BaseStrategy.sol

📄 BaseFeeOracle.sol

📄 CommonHealthCheck.sol

📄 Registry.vy

📄 Vault.vy

🗃 test

# V2 yVault Smart Contracts

info

Current v2 yVault API version is 0.4.6

older versions will be located in the "Deprecated" Folder if they exist.

## 📄 BaseStrategy.sol

Functions

## 📄 BaseFeeOracle.sol

Interprets the base fee from our base fee provider contract to determine if a harvest is permissable.

## 📄 CommonHealthCheck.sol

Functions

## 📄 Registry.vy

vyper: 0.3.3

## 📄 Vault.vy

vyper: 0.3.3

## 🗃 test

2 items