Skip to content

Conversation

@clement-ux
Copy link
Collaborator

@clement-ux clement-ux commented Dec 9, 2025

Description

This pull request introduces significant refactoring and cleanup to the Vault interface and related contracts, with a focus on removing price provider and swapper logic, simplifying asset and strategy management, and updating mock contracts to match the new interfaces. These changes streamline the codebase, deprecate unused or redundant functionality, and improve clarity and maintainability.

Vault Interface Refactoring

  • Removed all price provider and swapper-related events and functions from the IVault interface, including setPriceProvider, priceProvider, swap logic, and associated configuration and events. Deprecated several functions and added new ones for strategy management and asset handling. [1] [2] [3] [4] [5] [6] [7]
  • Replaced asset-specific strategy functions with simplified versions: setDefaultStrategy/defaultStrategy instead of per-asset strategies, and removed asset configuration queries. [1] [2]

Removal of Price Provider Logic

  • Commented out or removed all uses of priceProvider in AbstractHarvester, MockEvilReentrantContract, and BridgedWOETHStrategy, replacing them with direct oracle references or dummy values for test compatibility. [1] [2] [3] [4] [5] [6] [7] [8]

Asset and Strategy Handling Updates

  • Updated asset support and strategy functions in mock vaults and related contracts to align with the new interface, including changes to asset tracking and initialization. [1] [2] [3] [4]
  • Modified minting logic in OETHPlumeVaultCore and MockRebornMinter to use the new asset and amount parameters and removed unnecessary minimum checks. [1] [2] [3]

Deprecation and Cleanup

  • Removed the unused OETHVault.sol contract and other deprecated logic, further simplifying the codebase and removing references to outdated functionality.

Constructor and Initialization Updates

  • Updated constructors in mock contracts and strategies to match the new interface requirements, including passing assets and oracles directly. [1] [2] [3]

These changes collectively modernize the Vault architecture, improve testability, and remove legacy code paths.

Code Change Checklist

To be completed before internal review begins:

  • The contract code is complete
  • Executable deployment file
  • Fork tests that test after the deployment file runs
  • Unit tests *if needed
  • The owner has done a full checklist review of the code + tests

Internal review:

  • Two approvals by internal reviewers

Deploy checklist

Two reviewers complete the following checklist:

- [ ] All deployed contracts are listed in the deploy PR's description
- [ ] Deployed contract's verified code (and all dependencies) match the code in master
- [ ] Contract constructors have correct arguments
- [ ] The transactions that interacted with the newly deployed contract match the deploy script.
- [ ] Governance proposal matches the deploy script
- [ ] Smoke tests pass after fork test execution of the governance proposal

… improve clarity by removing deprecated functions and updating asset handling methods.
…itialization by using address(0) for backing asset.
…address, simplifying price retrieval and enhancing clarity
…nstructors for improved clarity and functionality
…y by removing unused variables and consolidating test cases
…et address, update test fixtures to use USDC instead of USDS, and simplify Dripper and VaultValueChecker tests by removing unused variables and consolidating logic.
clement-ux and others added 9 commits January 7, 2026 11:11
* refactor: remove deprecated asset structure and related mappings from VaultStorage

* refactor: remove deprecated mint function parameters and related tests

* refactor: remove unused parameters from _mint and mint functions

* refactor: remove unnecessary blank lines in test files

* refactor: change internal mappings to private for better encapsulation
* refactor: remove deprecated asset structure and related mappings from VaultStorage

* refactor: remove deprecated mint function parameters and related tests

* refactor: remove unused parameters from _mint and mint functions

* refactor: remove unnecessary blank lines in test files

* refactor: change internal mappings to private for better encapsulation

* refactor: simplify asset mappings by changing from mapping to single uint256
* Remove redeem functionality and related events from vault contracts

* Refactor vault contracts to inherit from VaultCore, removing deprecated OETHVaultCore references and relocating legacy code for consistency.

* Fix tests after redeem has been removed (#2738)

* Remove calculateRedeemOutputs view function from Vault

* Removed redeem, fund and yield Hardhat task

* FIxed unit tests

* Fixed fork tests

* Fix Base fork tests

* Fixed Base Curve AMO fork tests

* Removed redeemFeeBps from Sonic fork tests

* Fix Base and Sonic unit tests

* Prettier

* Remove hardhat fund from node script

* Fix OUSD AMO fork tests

* Fix AMO fork tests

* Remove unused gap variable from OUSDVaultCore contract

---------

Co-authored-by: Nick Addison <nick@addisonbrown.com.au>
IStrategy strategy = IStrategy(_strategyAddr);
address[] memory rewardTokens = strategy.getRewardTokenAddresses();
IOracle priceProvider = IOracle(IVault(vaultAddress).priceProvider());
//IOracle priceProvider = IOracle(IVault(vaultAddress).priceProvider());
Copy link

@pandadefi pandadefi Jan 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not delete the code instead of commenting it? You will always be able to find it back with the git history.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed in commit 71f9057

// Start with drip duration disabled
dripDuration = 1;
// Start with drip duration: 7 days
dripDuration = 604800;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably never going to be used since no new vault is scheduled

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you mean by the vault is scheduled?
We are now using the dripDuration in all the Vaults

clement-ux and others added 6 commits January 12, 2026 15:01
* Refactor vault contracts to remove deprecated implementations and simplify admin structure

* Refactor vault contracts to unify admin structure and simplify deployment scripts

* move zapper to dedicated folder

* Refactor vault upgrade scripts to unify implementation names and simplify deployment actions

* Updated hot deploy with new Vault contracts

* Update Vault contract diagrams

* Add OSVault contract and update deployment script references

---------

Co-authored-by: Nicholas Addison <nick@addisonbrown.com.au>
naddison36
naddison36 previously approved these changes Jan 13, 2026
Copy link
Collaborator

@naddison36 naddison36 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good

// Start with drip duration disabled
dripDuration = 1;
// Start with drip duration: 7 days
dripDuration = 604800;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you mean by the vault is scheduled?
We are now using the dripDuration in all the Vaults

IStrategy strategy = IStrategy(_strategyAddr);
address[] memory rewardTokens = strategy.getRewardTokenAddresses();
IOracle priceProvider = IOracle(IVault(vaultAddress).priceProvider());
//IOracle priceProvider = IOracle(IVault(vaultAddress).priceProvider());
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed in commit 71f9057

);
require(_assets.length == _amounts.length, "Parameter length mismatch");
require(
_assets.length == 1 &&
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we removed the redeem function we also removed the calculateRedeemOutputs

* @title Origin Sonic VaultAdmin contract on Sonic
* @author Origin Protocol Inc
*/
contract OSonicVault is VaultAdmin {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this now replaced by OSVault?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants