Skip to content

Commit b0c07fe

Browse files
last minute collateral swap changes to the Vault (#1653)
* Removed _deprecated property from Strategy struct * Natspec update * skip forkOnly storage slot check deploys since we have changes the supported strategies storage slot layout --------- Co-authored-by: Domen Grabec <[email protected]>
1 parent 77e77f4 commit b0c07fe

File tree

5 files changed

+29
-9
lines changed

5 files changed

+29
-9
lines changed

contracts/contracts/vault/VaultAdmin.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,7 @@ contract VaultAdmin is VaultStorage {
367367
*/
368368
function approveStrategy(address _addr) external onlyGovernor {
369369
require(!strategies[_addr].isSupported, "Strategy already approved");
370-
strategies[_addr] = Strategy({ isSupported: true, _deprecated: 0 });
370+
strategies[_addr] = Strategy({ isSupported: true });
371371
allStrategies.push(_addr);
372372
emit StrategyApproved(_addr);
373373
}

contracts/contracts/vault/VaultCore.sol

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,7 @@ contract VaultCore is VaultStorage {
411411

412412
/**
413413
* @dev Internal to calculate total value of all assets held in Vault.
414-
* @return value Total value in ETH (1e18)
414+
* @return value Total value in base currency. eg USD or ETH (1e18)
415415
*/
416416
function _totalValueInVault() internal view returns (uint256 value) {
417417
uint256 assetCount = allAssets.length;
@@ -426,7 +426,7 @@ contract VaultCore is VaultStorage {
426426

427427
/**
428428
* @dev Internal to calculate total value of all assets held in Strategies.
429-
* @return value Total value in ETH (1e18)
429+
* @return value Total value in base currency. eg USD or ETH (1e18)
430430
*/
431431
function _totalValueInStrategies() internal view returns (uint256 value) {
432432
uint256 stratCount = allStrategies.length;
@@ -438,7 +438,7 @@ contract VaultCore is VaultStorage {
438438
/**
439439
* @dev Internal to calculate total value of all assets held by strategy.
440440
* @param _strategyAddr Address of the strategy
441-
* @return value Total value in ETH (1e18)
441+
* @return value Total value in base currency. eg USD or ETH (1e18)
442442
*/
443443
function _totalValueInStrategy(address _strategyAddr)
444444
internal

contracts/contracts/vault/VaultStorage.sol

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@ contract VaultStorage is Initializable, Governable {
7777
// Strategies approved for use by the Vault
7878
struct Strategy {
7979
bool isSupported;
80-
uint256 _deprecated; // Deprecated storage slot
8180
}
8281
/// @dev mapping of strategy contracts to their configiration
8382
mapping(address => Strategy) internal strategies;

contracts/deploy/052_upgrade_ousd_vault_harvester.js

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,19 @@ module.exports = deploymentWithGovernanceProposal(
2121

2222
// Deploy VaultAdmin and VaultCore contracts
2323
const cVaultProxy = await ethers.getContract("VaultProxy");
24-
const dVaultAdmin = await deployWithConfirmation("VaultAdmin");
25-
const dVaultCore = await deployWithConfirmation("VaultCore");
24+
const dVaultAdmin = await deployWithConfirmation(
25+
"VaultAdmin",
26+
[],
27+
undefined,
28+
true // incompatible storage layout
29+
);
30+
const dVaultCore = await deployWithConfirmation(
31+
"VaultCore",
32+
[],
33+
undefined,
34+
true // incompatible storage layout
35+
);
36+
2637
const cVault = await ethers.getContractAt("Vault", cVaultProxy.address);
2738

2839
// Deploy Oracle Router

contracts/deploy/057_drip_all.js

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,18 @@ module.exports = deploymentWithGovernanceProposal(
2323
const cVaultProxy = await ethers.getContract("VaultProxy");
2424
// const cHarvester = await ethers.getContract("Harvester");
2525

26-
const dVaultCore = await deployWithConfirmation("VaultCore");
27-
const dVaultAdmin = await deployWithConfirmation("VaultAdmin");
26+
const dVaultAdmin = await deployWithConfirmation(
27+
"VaultAdmin",
28+
[],
29+
undefined,
30+
true // incompatible storage layout
31+
);
32+
const dVaultCore = await deployWithConfirmation(
33+
"VaultCore",
34+
[],
35+
undefined,
36+
true // incompatible storage layout
37+
);
2838

2939
const cVaultCore = await ethers.getContract(
3040
"VaultCore",

0 commit comments

Comments
 (0)