Vault


Functions:

Events:

Modifiers:

Graphs:


Function Definitions:

constructor()

constructor(address token_, address yearnRegistry_, contract IContractRegistry contractRegistry_, address staking_, struct Vault.FeeStructure feeStructure_) public 

assetsPerShare()

assetsPerShare() public  returns (uint256)

Vault shares are denominated with 18 decimals. Return value units are defined by underlying asset token.

Return Values:

Return NameTypeDescription

Price

per vault share in underlying token.

asset()

asset() external  returns (address)

Return Values:

Return NameTypeDescription

Address

of the underlying token used by the vault for accounting, depositing, and withdrawing.

totalAssets()

totalAssets() public  returns (uint256)

This function overrides the parent Yearn vault's totalAssets to return only assets managed by the vault wrapper, rather than the parent Yearn vault.

Return Values:

Return NameTypeDescription

Total

amount of underlying asset token managed by vault.

assetsOf()

assetsOf(address owner) public  returns (uint256)
Parameter NameTypeDescription

owner

address

Address of owner.

Return Values:

Return NameTypeDescription

Balance

address

of owner address, denominated in underlying asset token.

convertToAssets()

convertToAssets(uint256 shares) external  returns (uint256)
Parameter NameTypeDescription

shares

uint256

Exact amount of shares

Return Values:

Return NameTypeDescription

Exact

uint256

amount of assets

convertToShares()

convertToShares(uint256 assets) external  returns (uint256)
Parameter NameTypeDescription

assets

uint256

Exact amount of assets

Return Values:

Return NameTypeDescription

Exact

uint256

amount of shares

previewDeposit()

previewDeposit(uint256 assets) public  returns (uint256 shares)

This method accounts for issuance of accrued fee shares.

Parameter NameTypeDescription

assets

uint256

Exact amount of underlying asset token to deposit

Return Values:

Return NameTypeDescription

shares

uint256

of the vault issued in exchange to the user for assets

previewMint()

previewMint(uint256 shares) public  returns (uint256 assets)

This method accounts for issuance of accrued fee shares.

Parameter NameTypeDescription

shares

uint256

Exact amount of vault shares to mint.

Return Values:

Return NameTypeDescription

assets

uint256

quantity of underlying needed in exchange to mint shares.

previewWithdraw()

previewWithdraw(uint256 assets) external  returns (uint256 shares)

This method accounts for both issuance of fee shares and withdrawal fee.

Parameter NameTypeDescription

assets

uint256

Exact amount of assets to withdraw

Return Values:

Return NameTypeDescription

shares

uint256

to be burned in exchange for assets

previewRedeem()

previewRedeem(uint256 shares) public  returns (uint256 assets)

This method accounts for both issuance of fee shares and withdrawal fee.

Parameter NameTypeDescription

shares

uint256

Exact amount of shares to redeem

Return Values:

Return NameTypeDescription

assets

uint256

quantity of underlying returned in exchange for shares.

accruedManagementFee()

accruedManagementFee() public  returns (uint256)

Management fee is annualized per minute, based on 525,600 minutes per year. Total assets are calculated using the average of their current value and the value at the previous fee harvest checkpoint. This method is similar to calculating a definite integral using the trapezoid rule.

Return Values:

Return NameTypeDescription

Accrued

management fee in underlying asset token.

accruedPerformanceFee()

accruedPerformanceFee() public  returns (uint256)

Performance fee is based on a vault share high water mark value. If vault share value has increased above the HWM in a fee period, issue fee shares to the vault equal to the performance fee.

Return Values:

Return NameTypeDescription

Accrued

performance fee in underlying asset token.

maxDeposit()

maxDeposit(address) public  returns (uint256)

Return Values:

Return NameTypeDescription

Maximum

address

amount of underlying asset token that may be deposited for a given address.

maxMint()

maxMint(address) external  returns (uint256)

Return Values:

Return NameTypeDescription

Maximum

address

amount of vault shares that may be minted to given address.

maxWithdraw()

maxWithdraw(address caller) external  returns (uint256)

Return Values:

Return NameTypeDescription

Maximum

address

amount of underlying asset token that can be withdrawn by caller address.

maxRedeem()

maxRedeem(address caller) external  returns (uint256)

Return Values:

Return NameTypeDescription

Maximum

address

amount of shares that may be redeemed by caller address.

deposit()

deposit(uint256 assets) public  returns (uint256)

This overrides deposit(uint256) from the parent AffiliateToken contract. It therefore needs to be public since the AffiliateToken function is public

Parameter NameTypeDescription

assets

uint256

Quantity of tokens to deposit.

Return Values:

Return NameTypeDescription

Quantity

uint256

of vault shares issued to caller.

deposit()

deposit(uint256 assets, address receiver) public  returns (uint256 shares)
Parameter NameTypeDescription

assets

uint256

Quantity of tokens to deposit.

receiver

address

Receiver of issued vault shares.

Return Values:

Return NameTypeDescription

shares

uint256

of the vault issued to receiver.

depositAndStake()

depositAndStake(uint256 assets) external  returns (uint256)
Parameter NameTypeDescription

assets

uint256

Quantity of tokens to deposit.

Return Values:

Return NameTypeDescription

shares

uint256

of the vault issued to receiver.

depositAndStakeFor()

depositAndStakeFor(uint256 assets, address receiver) public  returns (uint256 shares)
Parameter NameTypeDescription

assets

uint256

Quantity of tokens to deposit.

Return Values:

Return NameTypeDescription

shares

uint256

of the vault issued to receiver.

mint()

mint(uint256 shares) external  returns (uint256)
Parameter NameTypeDescription

shares

uint256

Quantity of shares to mint.

Return Values:

Return NameTypeDescription

assets

uint256

of underlying that have been deposited.

mint()

mint(uint256 shares, address receiver) public  returns (uint256 assets)
Parameter NameTypeDescription

shares

uint256

Quantity of shares to mint.

receiver

address

Receiver of issued vault shares.

Return Values:

Return NameTypeDescription

assets

uint256

of underlying that have been deposited.

mintAndStake()

mintAndStake(uint256 shares) external  returns (uint256)
Parameter NameTypeDescription

shares

uint256

Quantity of shares to mint.

Return Values:

Return NameTypeDescription

assets

uint256

of underlying that have been deposited.

mintAndStakeFor()

mintAndStakeFor(uint256 shares, address receiver) public  returns (uint256 assets)
Parameter NameTypeDescription

shares

uint256

Quantity of shares to mint.

Return Values:

Return NameTypeDescription

assets

uint256

of underlying that have been deposited.

withdraw()

withdraw(uint256 assets) public  returns (uint256)

This overrides withdraw(uint256) from the parent AffiliateToken contract.

Parameter NameTypeDescription

assets

uint256

Quantity of underlying asset token to withdraw.

Return Values:

Return NameTypeDescription

shares

uint256

of vault burned in exchange for underlying asset tokens.

withdraw()

withdraw(uint256 assets, address receiver, address owner) public  returns (uint256 shares)
Parameter NameTypeDescription

assets

uint256

Quantity of underlying asset token to withdraw.

receiver

address

Receiver of underlying token.

owner

address

Owner of burned vault shares.

Return Values:

Return NameTypeDescription

shares

uint256

of vault burned in exchange for underlying asset tokens.

redeem()

redeem(uint256 shares) external  returns (uint256)
Parameter NameTypeDescription

shares

uint256

Quantity of vault shares to exchange for underlying tokens.

Return Values:

Return NameTypeDescription

assets

uint256

of underlying sent to receiver.

redeem()

redeem(uint256 shares, address receiver, address owner) public  returns (uint256 assets)
Parameter NameTypeDescription

shares

uint256

Quantity of vault shares to exchange for underlying tokens.

receiver

address

Receiver of underlying tokens.

owner

address

Owner of burned vault shares.

Return Values:

Return NameTypeDescription

assets

uint256

of underlying sent to receiver.

takeManagementAndPerformanceFees()

takeManagementAndPerformanceFees() external 

setFees()

setFees(struct Vault.FeeStructure newFees) external 

Value is in 1e18, e.g. 100% = 1e18 - 1 BPS = 1e12

Parameter NameTypeDescription

newFees

struct Vault.FeeStructure

New feeStructure.

setUseLocalFees()

setUseLocalFees(bool _useLocalFees) external 
Parameter NameTypeDescription

_useLocalFees

bool

true to use local fees, false to use the VaultFeeController contract.

setStaking()

setStaking(address _staking) external 
Parameter NameTypeDescription

_staking

address

Address of the staking contract.

setRegistry()

setRegistry(address _registry) external 
Parameter NameTypeDescription

_registry

address

The new _registry address.

withdrawAccruedFees()

withdrawAccruedFees() external 

we send funds now to the feeRecipient which is set on the feeController. We must make sure that this is not address(0) before withdrawing fees

pauseContract()

pauseContract() external 

unpauseContract()

unpauseContract() external 

Events

WithdrawalFee

WithdrawalFee(address to, uint256 amount)

PerformanceFee

PerformanceFee(uint256 amount)

ManagementFee

ManagementFee(uint256 amount)

FeesUpdated

FeesUpdated(struct Vault.FeeStructure previousFees, struct Vault.FeeStructure newFees)

StakingUpdated

StakingUpdated(address beforeAddress, address afterAddress)

RegistryUpdated

RegistryUpdated(address beforeAddress, address afterAddress)

UseLocalFees

UseLocalFees(bool useLocalFees)

Modifiers

takeFees()

takeFees()

Graphs

Dependency Graph

Inheritance Graph

Last updated