Assessment reports>Extensible Vaults>Patch Review>Changes in contract structure

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 managedAssets in the contract has been removed. The return value of the totalAssets function has been changed from the sum of managedAssets and the contract’s asset balance to the sum of all managers’ totalBalance and the contract’s asset balance.

  • It inherited the contract Pausable. A sender with the DEFAULT_ADMIN_ROLE can pause or unpause certain functions — for example, functions deposit and withdraw.

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, asset and totalBalance, to comply with the new IManager interface.

    • The asset function returns the address of the asset that the contract can operate on.

    • The totalBalance function returns the sum of managedAssets and the contract’s asset balance.

  • The functions depositToAssetManager and withdrawFromAssetManager were added, allowing a sender with the ASSET_MANAGER_ROLE to withdraw assets from the contract or return assets to the contract. When using the depositToAssetManager function to withdraw assets from the contract, managedAssets increases by the same amount; using the withdrawFromAssetManager function does the opposite.

These are the changes related to yoVaultManager:

  • Two view functions were added, asset and totalBalance, to comply with the new IManager interface.

    • The asset function returns the underlying asset of the yoVault.

    • The totalBalance function 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 deposit has added a check to ensure that the number of shares obtained from depositing into the yoVault is greater than zero.

Additionally, the contract ManagedAssetVaultWithExtraData has been renamed to ExtensibleVaultWithExtraData.

Zellic © 2025Back to top ↑