Skip to content

Conversation

@clement-ux
Copy link
Collaborator

@clement-ux clement-ux commented Jan 7, 2026

Description

This PR aims:

  • to remove redeem()feature from VaultCore.sol and related contracts.
  • simplify inheritance across all XXXVaultCore contract

Remove redeem() feature.

  • Remove redeem() function, now all redeem will be async redeem.
  • Remove _redeem()implementation on all related VaultCore contract.
  • Remove calculateRedeemOutputs
  • Mark deprecated redeemFeeBps variable, as not used anymore.
  • Remove RedeemFeeUpdated event and setRedeemFeeBps().
  • Remove MAX_INT on VaultCore.sol as not used anymore.

Simplify VaultCore inheritance.

Because we are simplifying VaultCore.sol contract, it is now time to simplify inheritance across all VaultCore.sol and avoid nested and inheritance. All VaultContract will no directly inherit from VaultContract.sol and nothing else.

But there in OETHVaultCore.sol this variable _deprecated_wethAssetIndex. So all contract that are currently inheriting from OETHVaultCore.sol, should conserve this variable at the correct slot.

For the sake of simplicity, we can move _deprecated_wethAssetIndex in the VaultStorage.sol. This is not an issue for:

  • OUSDVaultCore, because this is a new variable added at the last slot.
  • OETHVaultCore, because it keep the same last variable (i.e. _deprecated_wethAssetIndex).
  • OSonicVaultCore, because it keep the same last variable (i.e. _deprecated_wethAssetIndex).
  • OETHBaseVaultCore, because it keep the same last variable (i.e. _deprecated_wethAssetIndex).
  • OETHPlumeVaultCore, because it keep the same last variable (i.e. _deprecated_wethAssetIndex).
  • We can remove the last gap on OETHVaultCore.sol, because OSonicVaultCore, OETHBaseVaultCore, OETHPlumeVaultCore don't have any storage variable.

Let's double check with a storage check:

## 🏦 OUSDVaultCore

### Before upgrade
$ cast storage 0x6b89f2410c45701E1456f9e2c5C3f8fAB5137B7A
| Field                  | Type        | Slot |
|------------------------|-------------|------|
| withdrawalClaimDelay   | uint256     | 78   |
| lastRebase             | uint64      | 79   |
| dripDuration           | uint64      | 79   |
| rebasePerSecondMax     | uint64      | 79   |
| rebasePerSecondTarget  | uint64      | 79   |
| __gap                  | uint256[43] | 80   |

### After upgrade
$ slither . --print variable-order
| Field                                    | Type        | Slot |
|------------------------------------------|-------------|------|
| VaultStorage.withdrawalClaimDelay        | uint256     | 78   |
| VaultStorage.lastRebase                  | uint64      | 79   |
| VaultStorage.dripDuration                | uint64      | 79   |
| VaultStorage.rebasePerSecondMax          | uint64      | 79   |
| VaultStorage.rebasePerSecondTarget       | uint64      | 79   |
| VaultStorage.defaultStrategy             | address     | 80   |
| VaultStorage.__gap                       | uint256[42] | 81   |
| VaultStorage._deprecated_wethAssetIndex  | uint256     | 123  |

---

## 🏦 OETHVaultCore

### Before upgrade
$ cast storage 0x22431cc134bD24171D71ba1470eA037b36a950D7
| Field                  | Type        | Slot |
|------------------------|-------------|------|
| withdrawalClaimDelay   | uint256     | 78   |
| lastRebase             | uint64      | 79   |
| dripDuration           | uint64      | 79   |
| rebasePerSecondMax     | uint64      | 79   |
| rebasePerSecondTarget  | uint64      | 79   |
| __gap                  | uint256[43] | 80   |
| wethAssetIndex         | uint256     | 123  |
| __gap                  | uint256[50] | 124  |

### After upgrade
$ slither . --print variable-order
| Field                                    | Type        | Slot |
|------------------------------------------|-------------|------|
| VaultStorage.withdrawalClaimDelay        | uint256     | 78   |
| VaultStorage.lastRebase                  | uint64      | 79   |
| VaultStorage.dripDuration                | uint64      | 79   |
| VaultStorage.rebasePerSecondMax          | uint64      | 79   |
| VaultStorage.rebasePerSecondTarget       | uint64      | 79   |
| VaultStorage.defaultStrategy             | address     | 80   |
| VaultStorage.__gap                       | uint256[42] | 81   |
| VaultStorage._deprecated_wethAssetIndex  | uint256     | 123  |

---

## 🏦 OETHBaseVaultCore

### Before upgrade
$ cast storage 0x9F0dF7799f6FDAd409300080cfF680f5A23df4b1
| Field                  | Type        | Slot |
|------------------------|-------------|------|
| withdrawalClaimDelay   | uint256     | 78   |
| lastRebase             | uint64      | 79   |
| dripDuration           | uint64      | 79   |
| rebasePerSecondMax     | uint64      | 79   |
| rebasePerSecondTarget  | uint64      | 79   |
| __gap                  | uint256[43] | 80   |
| wethAssetIndex         | uint256     | 123  |
| __gap                  | uint256[50] | 124  |

### After upgrade
$ slither . --print variable-order
| Field                                    | Type        | Slot |
|------------------------------------------|-------------|------|
| VaultStorage.withdrawalClaimDelay        | uint256     | 78   |
| VaultStorage.lastRebase                  | uint64      | 79   |
| VaultStorage.dripDuration                | uint64      | 79   |
| VaultStorage.rebasePerSecondMax          | uint64      | 79   |
| VaultStorage.rebasePerSecondTarget       | uint64      | 79   |
| VaultStorage.defaultStrategy             | address     | 80   |
| VaultStorage.__gap                       | uint256[42] | 81   |
| VaultStorage._deprecated_wethAssetIndex  | uint256     | 123  |

---

## 🏦 OSonicVaultCore

### Before upgrade
$ cast storage 0xd66afaA7Fe071162d055B3CC703CC1eAED836CF3
| Field                  | Type        | Slot |
|------------------------|-------------|------|
| withdrawalClaimDelay   | uint256     | 78   |
| lastRebase             | uint64      | 79   |
| dripDuration           | uint64      | 79   |
| rebasePerSecondMax     | uint64      | 79   |
| rebasePerSecondTarget  | uint64      | 79   |
| __gap                  | uint256[43] | 80   |
| wethAssetIndex         | uint256     | 123  |
| __gap                  | uint256[50] | 124  |

### After upgrade
$ slither . --print variable-order
| Field                                    | Type        | Slot |
|------------------------------------------|-------------|------|
| VaultStorage.withdrawalClaimDelay        | uint256     | 78   |
| VaultStorage.lastRebase                  | uint64      | 79   |
| VaultStorage.dripDuration                | uint64      | 79   |
| VaultStorage.rebasePerSecondMax          | uint64      | 79   |
| VaultStorage.rebasePerSecondTarget       | uint64      | 79   |
| VaultStorage.defaultStrategy             | address     | 80   |
| VaultStorage.__gap                       | uint256[42] | 81   |
| VaultStorage._deprecated_wethAssetIndex  | uint256     | 123  |

---

## 🏦 OETHPlumeVaultCore

### Before upgrade
| Field                  | Type        | Slot |
|------------------------|-------------|------|
| withdrawalClaimDelay   | uint256     | 78   |
| lastRebase             | uint64      | 79   |
| dripDuration           | uint64      | 79   |
| rebasePerSecondMax     | uint64      | 79   |
| rebasePerSecondTarget  | uint64      | 79   |
| __gap                  | uint256[43] | 80   |
| wethAssetIndex         | uint256     | 123  |
| __gap                  | uint256[50] | 124  |

### After upgrade
$ slither . --print variable-order
| Field                                    | Type        | Slot |
|------------------------------------------|-------------|------|
| VaultStorage.withdrawalClaimDelay        | uint256     | 78   |
| VaultStorage.lastRebase                  | uint64      | 79   |
| VaultStorage.dripDuration                | uint64      | 79   |
| VaultStorage.rebasePerSecondMax          | uint64      | 79   |
| VaultStorage.rebasePerSecondTarget       | uint64      | 79   |
| VaultStorage.defaultStrategy             | address     | 80   |
| VaultStorage.__gap                       | uint256[42] | 81   |
| VaultStorage._deprecated_wethAssetIndex  | uint256     | 123  |

clement-ux and others added 4 commits January 7, 2026 22:03
…ed OETHVaultCore references and relocating legacy code for consistency.
* 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
@codecov
Copy link

codecov bot commented Jan 8, 2026

Codecov Report

❌ Patch coverage is 92.30769% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 35.69%. Comparing base (5bf6ee7) to head (d7b8090).
⚠️ Report is 1 commits behind head on clement/simplify-ousd.

Files with missing lines Patch % Lines
contracts/contracts/vault/OETHPlumeVaultCore.sol 0.00% 1 Missing ⚠️
Additional details and impacted files
@@                    Coverage Diff                    @@
##           clement/simplify-ousd    #2737      +/-   ##
=========================================================
+ Coverage                  34.20%   35.69%   +1.49%     
=========================================================
  Files                        128      128              
  Lines                       5514     5471      -43     
  Branches                    1460     1443      -17     
=========================================================
+ Hits                        1886     1953      +67     
+ Misses                      3627     3517     -110     
  Partials                       1        1              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@naddison36 naddison36 marked this pull request as ready for review January 8, 2026 09:31
@clement-ux clement-ux merged commit 6258a96 into clement/simplify-ousd Jan 8, 2026
16 of 17 checks passed
@clement-ux clement-ux deleted the clement/simplify-ousd-remove-redeem branch January 8, 2026 09:36
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.

3 participants