Changes in contract structure
Changes were made to the ManagedAssetVault, ManagerVault, and yoVaultManager contracts.
These are the changes related to ManagedAssetVault:
The contract ManagedAssetVault has been renamed to ExtensibleVault.
The logic for modifying
managedAssetsin the contract has been removed. The return value of thetotalAssetsfunction has been changed from the sum ofmanagedAssetsand the contract’s asset balance to the sum of all managers’totalBalanceand the contract’s asset balance.It inherited the contract Pausable. A sender with the
DEFAULT_ADMIN_ROLEcan pause or unpause certain functions — for example, functionsdepositandwithdraw.
These are the changes related to ManagerVault:
The contract ManagerVault has been renamed to ExternalManager and has inherited the contract ManagedAssetsBase.
The inherited contract ManagedAssetsBase contains the logic for modifying the state variable
managedAssets.Two view functions were added,
assetandtotalBalance, to comply with the newIManagerinterface.The
assetfunction returns the address of the asset that the contract can operate on.The
totalBalancefunction returns the sum ofmanagedAssetsand the contract’s asset balance.
The functions
depositToAssetManagerandwithdrawFromAssetManagerwere added, allowing a sender with theASSET_MANAGER_ROLEto withdraw assets from the contract or return assets to the contract. When using thedepositToAssetManagerfunction to withdraw assets from the contract,managedAssetsincreases by the same amount; using thewithdrawFromAssetManagerfunction does the opposite.
These are the changes related to yoVaultManager:
Two view functions were added,
assetandtotalBalance, to comply with the newIManagerinterface.The
assetfunction returns the underlying asset of theyoVault.The
totalBalancefunction returns the sum of the amount of assets corresponding to the shares held by the contract, assets pending redemption, and the contract’s asset balance.
The function
deposithas added a check to ensure that the number of shares obtained from depositing into theyoVaultis greater than zero.
Additionally, the contract ManagedAssetVaultWithExtraData has been renamed to ExtensibleVaultWithExtraData.