From 790cbefa054646d2f9e99504ffe2b78544ecd129 Mon Sep 17 00:00:00 2001 From: Daniel Von Fange Date: Wed, 5 Apr 2023 14:09:52 -0400 Subject: [PATCH 1/2] Flipper N-10 explicit visibilitiy --- contracts/contracts/vault/VaultCore.sol | 6 +++--- contracts/contracts/vault/VaultStorage.sol | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/contracts/contracts/vault/VaultCore.sol b/contracts/contracts/vault/VaultCore.sol index 6943de2966..271bb340fc 100644 --- a/contracts/contracts/vault/VaultCore.sol +++ b/contracts/contracts/vault/VaultCore.sol @@ -26,12 +26,12 @@ contract VaultCore is VaultStorage { using StableMath for uint256; using SafeMath for uint256; // max signed int - uint256 constant MAX_INT = 2**255 - 1; + uint256 internal constant MAX_INT = 2**255 - 1; // max un-signed int - uint256 constant MAX_UINT = + uint256 internal constant MAX_UINT = 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff; // impl contract address - address immutable SELF = address(this); + address internal immutable SELF = address(this); /** * @dev Verifies that the rebasing is not paused. diff --git a/contracts/contracts/vault/VaultStorage.sol b/contracts/contracts/vault/VaultStorage.sol index 3942a923ab..bfae9fc8cb 100644 --- a/contracts/contracts/vault/VaultStorage.sol +++ b/contracts/contracts/vault/VaultStorage.sol @@ -112,7 +112,7 @@ contract VaultStorage is Initializable, Governable { // Deprecated: Tokens that should be swapped for stablecoins address[] private _deprecated_swapTokens; - uint256 constant MINT_MINIMUM_ORACLE = 99800000; + uint256 internal constant MINT_MINIMUM_ORACLE = 99800000; // Meta strategy that is allowed to mint/burn OUSD without changing collateral address public ousdMetaStrategy = address(0); From 4b36c616e6bc05a9d8a7c76efabf9761fac5552d Mon Sep 17 00:00:00 2001 From: Daniel Von Fange Date: Wed, 5 Apr 2023 14:20:27 -0400 Subject: [PATCH 2/2] Flipper N-12 typos --- contracts/contracts/vault/VaultAdmin.sol | 2 +- contracts/contracts/vault/VaultCore.sol | 8 ++++---- contracts/contracts/vault/VaultStorage.sol | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/contracts/contracts/vault/VaultAdmin.sol b/contracts/contracts/vault/VaultAdmin.sol index 9b0d6e051d..d17340a4d2 100644 --- a/contracts/contracts/vault/VaultAdmin.sol +++ b/contracts/contracts/vault/VaultAdmin.sol @@ -369,7 +369,7 @@ contract VaultAdmin is VaultStorage { */ function setDripDuration(uint64 _durationSeconds) external onlyGovernor { dripper.dripDuration = _durationSeconds; - emit DriperDurationChanged(_durationSeconds); + emit DripperDurationChanged(_durationSeconds); } /** diff --git a/contracts/contracts/vault/VaultCore.sol b/contracts/contracts/vault/VaultCore.sol index 271bb340fc..4323871fff 100644 --- a/contracts/contracts/vault/VaultCore.sol +++ b/contracts/contracts/vault/VaultCore.sol @@ -387,7 +387,7 @@ contract VaultCore is VaultStorage { * @dev Update the supply of ousd * * 1. Calculate new gains, splitting gains between the dripper and protocol reserve - * 2. Drip out from the driper and update the dripper storage + * 2. Drip out from the dripper and update the dripper storage * 3. Distribute yield, splitting between trustee fees and rebasing * the remaining post dripper funds to users * @@ -460,7 +460,7 @@ contract VaultCore is VaultStorage { } // Rebase remaining to users - // Invarient: must only increase OUSD supply. + // Invariant: must only increase OUSD supply. // Can only increase because: // ousdSupply + yield >= ousdSupply and yield > fee oUSD.changeSupply(ousdSupply + yield); @@ -502,7 +502,7 @@ contract VaultCore is VaultStorage { /** * @dev Internal to calculate total value of all assets held in Vault. - * @return value Total value in ETH (1e18) + * @return value Total value in USD (1e18) */ function _totalValueInVault() internal view returns (uint256 value) { for (uint256 y = 0; y < allAssets.length; y++) { @@ -517,7 +517,7 @@ contract VaultCore is VaultStorage { /** * @dev Internal to calculate total value of all assets held in Strategies. - * @return value Total value in ETH (1e18) + * @return value Total value in USD (1e18) */ function _totalValueInStrategies() internal view returns (uint256 value) { for (uint256 i = 0; i < allStrategies.length; i++) { diff --git a/contracts/contracts/vault/VaultStorage.sol b/contracts/contracts/vault/VaultStorage.sol index bfae9fc8cb..7da82ac851 100644 --- a/contracts/contracts/vault/VaultStorage.sol +++ b/contracts/contracts/vault/VaultStorage.sol @@ -47,7 +47,7 @@ contract VaultStorage is Initializable, Governable { event YieldReceived(uint256 _yield); event YieldDistribution(address _to, uint256 _yield, uint256 _fee); event ProtocolReserveBpsChanged(uint256 _basis); - event DriperDurationChanged(uint256 _seconds); + event DripperDurationChanged(uint256 _seconds); event TrusteeFeeBpsChanged(uint256 _basis); event TrusteeAddressChanged(address _address); event NetOusdMintForStrategyThresholdChanged(uint256 _threshold);