Skip to content

Commit e05bb2a

Browse files
[Vault] Merge VaultAdmin and VaultCore (#2743)
* 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 <[email protected]>
1 parent 8d40e03 commit e05bb2a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+710
-3545
lines changed

contracts/README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,11 +125,10 @@ You can enable the "hot deploy" mode when doing fork testing development. The mo
125125
To enable Hot Deploys set the HOT_DEPLOY variable in the contracts/.env file. Enable various modes using comma separated flags to direct which contracts need source updated (in the node runtime):
126126

127127
- strategy -> strategy contract associated to fixture
128-
- vaultCore -> vaultCore or oethVaultCore depending on the nature of the fixture
129-
- vaultAdmin -> vaultAdmin or oethVaultAdmin depending on the nature of the fixture
128+
- vault -> OUSDVault or OETHVault depending on the nature of the fixture
130129
- harvester -> harvester or oethHarvester (not yet supported)
131130

132-
example: HOT_DEPLOY=strategy,vaultCore,vaultAdmin,harvester
131+
example: HOT_DEPLOY=strategy,vault,harvester
133132

134133
#### Supporting new fixtures / contracts
135134

contracts/contracts/interfaces/IVault.sol

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,6 @@ interface IVault {
4949

5050
function governor() external view returns (address);
5151

52-
function ADMIN_IMPLEMENTATION() external view returns (address);
53-
5452
// VaultAdmin.sol
5553
function setVaultBuffer(uint256 _vaultBuffer) external;
5654

@@ -167,8 +165,6 @@ interface IVault {
167165

168166
function initialize(address) external;
169167

170-
function setAdminImpl(address) external;
171-
172168
function addWithdrawalQueueLiquidity() external;
173169

174170
function requestWithdrawal(uint256 _amount)

contracts/contracts/mocks/MockOETHVault.sol

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
// SPDX-License-Identifier: BUSL-1.1
22
pragma solidity ^0.8.0;
33

4-
import { OETHVaultCore } from "../vault/OETHVaultCore.sol";
4+
import { OETHVault } from "../vault/OETHVault.sol";
55
import { StableMath } from "../utils/StableMath.sol";
66
import "../utils/Helpers.sol";
77

8-
contract MockOETHVault is OETHVaultCore {
8+
contract MockOETHVault is OETHVault {
99
using StableMath for uint256;
1010

11-
constructor(address _weth) OETHVaultCore(_weth) {
11+
constructor(address _weth) OETHVault(_weth) {
1212
_setGovernor(msg.sender);
1313
}
1414

contracts/contracts/mocks/MockOETHVaultAdmin.sol

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
// SPDX-License-Identifier: BUSL-1.1
22
pragma solidity ^0.8.0;
33

4-
import { OETHVaultAdmin } from "../vault/OETHVaultAdmin.sol";
4+
import { OETHVault } from "../vault/OETHVault.sol";
55

6-
contract MockOETHVaultAdmin is OETHVaultAdmin {
7-
constructor(address _weth) OETHVaultAdmin(_weth) {}
6+
contract MockOETHVault is OETHVault {
7+
constructor(address _weth) OETHVault(_weth) {}
88

99
// fetches the WETH amount in outstanding withdrawals
1010
function outstandingWithdrawalsAmount()

contracts/contracts/mocks/MockVault.sol

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
// SPDX-License-Identifier: BUSL-1.1
22
pragma solidity ^0.8.0;
33

4-
import { VaultCore } from "../vault/VaultCore.sol";
4+
import { VaultAdmin } from "../vault/VaultAdmin.sol";
55
import { StableMath } from "../utils/StableMath.sol";
66
import "../utils/Helpers.sol";
77

8-
contract MockVault is VaultCore {
8+
contract MockVault is VaultAdmin {
99
using StableMath for uint256;
1010

1111
uint256 storedTotalValue;
1212

13-
constructor(address _asset) VaultCore(_asset) {}
13+
constructor(address _asset) VaultAdmin(_asset) {}
1414

1515
function setTotalValue(uint256 _value) public {
1616
storedTotalValue = _value;
@@ -39,8 +39,4 @@ contract MockVault is VaultCore {
3939
return 0;
4040
}
4141
}
42-
43-
function setMaxSupplyDiff(uint256 _maxSupplyDiff) external onlyGovernor {
44-
maxSupplyDiff = _maxSupplyDiff;
45-
}
4642
}

contracts/contracts/vault/OETHBaseVaultAdmin.sol renamed to contracts/contracts/vault/OETHBaseVault.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ import { VaultAdmin } from "./VaultAdmin.sol";
77
* @title OETH Base VaultAdmin Contract
88
* @author Origin Protocol Inc
99
*/
10-
contract OETHBaseVaultAdmin is VaultAdmin {
10+
contract OETHBaseVault is VaultAdmin {
1111
constructor(address _weth) VaultAdmin(_weth) {}
1212
}

contracts/contracts/vault/OETHBaseVaultCore.sol

Lines changed: 0 additions & 12 deletions
This file was deleted.

contracts/contracts/vault/OETHPlumeVaultCore.sol renamed to contracts/contracts/vault/OETHPlumeVault.sol

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
// SPDX-License-Identifier: BUSL-1.1
22
pragma solidity ^0.8.0;
33

4-
import { VaultCore } from "./VaultCore.sol";
4+
import { VaultAdmin } from "./VaultAdmin.sol";
55

66
/**
7-
* @title OETH Plume VaultCore Contract
7+
* @title OETH Plume VaultAdmin Contract
88
* @author Origin Protocol Inc
99
*/
10-
contract OETHPlumeVaultCore is VaultCore {
11-
constructor(address _weth) VaultCore(_weth) {}
10+
contract OETHPlumeVault is VaultAdmin {
11+
constructor(address _weth) VaultAdmin(_weth) {}
1212

13-
// @inheritdoc VaultCore
13+
// @inheritdoc VaultAdmin
1414
function _mint(
1515
address,
1616
uint256 _amount,

contracts/contracts/vault/OETHVaultAdmin.sol renamed to contracts/contracts/vault/OETHVault.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ import { VaultAdmin } from "./VaultAdmin.sol";
77
* @title OETH VaultAdmin Contract
88
* @author Origin Protocol Inc
99
*/
10-
contract OETHVaultAdmin is VaultAdmin {
10+
contract OETHVault is VaultAdmin {
1111
constructor(address _weth) VaultAdmin(_weth) {}
1212
}

contracts/contracts/vault/OETHVaultCore.sol

Lines changed: 0 additions & 12 deletions
This file was deleted.

0 commit comments

Comments
 (0)