diff --git a/contracts/Managers/RoleManager.sol b/contracts/Managers/RoleManager.sol index a0dd97d..a171540 100644 --- a/contracts/Managers/RoleManager.sol +++ b/contracts/Managers/RoleManager.sol @@ -487,6 +487,20 @@ contract RoleManager is Positions { _setRole(_vault, Position(_keeper, _positions[KEEPER].roles)); } + function updateVaultName( + address _vault, + string calldata _name + ) external onlyPositionHolder(GOVERNANCE) { + // TODO + } + + function updateVaultSymbol( + address _vault, + string calldata _symbol + ) external onlyPositionHolder(GOVERNANCE) { + // TODO + } + /** * @notice Removes a vault from the RoleManager. * @dev This will NOT un-endorse the vault from the registry. diff --git a/contracts/addressProviders/ProtocolAddressProvider.vy b/contracts/addressProviders/ProtocolAddressProvider.vy index 91a4915..686efab 100644 --- a/contracts/addressProviders/ProtocolAddressProvider.vy +++ b/contracts/addressProviders/ProtocolAddressProvider.vy @@ -24,19 +24,21 @@ event UpdateGovernance: #### CONSTANTS #### # General Periphery Contracts. -ROUTER: constant(bytes32) = keccak256("ROUTER") -KEEPER: constant(bytes32) = keccak256("KEEPER") -APR_ORACLE: constant(bytes32) = keccak256("APR ORACLE") -RELEASE_REGISTRY: constant(bytes32) = keccak256("RELEASE REGISTRY") -BASE_FEE_PROVIDER: constant(bytes32) = keccak256("BASE FEE PROVIDER") -COMMON_REPORT_TRIGGER: constant(bytes32) = keccak256("COMMON REPORT TRIGGER") +ROUTER: constant(bytes32) = keccak256("Router") +KEEPER: constant(bytes32) = keccak256("Keeper") +APR_ORACLE: constant(bytes32) = keccak256("APR Oracle") +RELEASE_REGISTRY: constant(bytes32) = keccak256("Release Registry") +BASE_FEE_PROVIDER: constant(bytes32) = keccak256("Base Fee Provider") +COMMON_REPORT_TRIGGER: constant(bytes32) = keccak256("Common Report Trigger") # Periphery Factory contracts. -AUCTION_FACTORY: constant(bytes32) = keccak256("AUCTION FACTORY") -SPLITTER_FACTORY: constant(bytes32) = keccak256("SPLITTER FACTORY") -REGISTRY_FACTORY: constant(bytes32) = keccak256("REGISTRY FACTORY") -ALLOCATOR_FACTORY: constant(bytes32) = keccak256("ALLOCATOR FACTORY") -ACCOUNTANT_FACTORY: constant(bytes32) = keccak256("ACCOUNTANT FACTORY") +AUCTION_FACTORY: constant(bytes32) = keccak256("Auction Factory") +SPLITTER_FACTORY: constant(bytes32) = keccak256("Splitter Factory") +REGISTRY_FACTORY: constant(bytes32) = keccak256("Registry Factory") +ALLOCATOR_FACTORY: constant(bytes32) = keccak256("Allocator Factory") +ACCOUNTANT_FACTORY: constant(bytes32) = keccak256("Accountant Factory") + +PROJECT_DEPLOYER: constant(bytes32) = keccak256("Project Deployer") name: public(constant(String[34])) = "Yearn V3 Protocol Address Provider" diff --git a/contracts/debtAllocators/DebtAllocator.sol b/contracts/debtAllocators/DebtAllocator.sol index 4b220c5..4fbf622 100644 --- a/contracts/debtAllocators/DebtAllocator.sol +++ b/contracts/debtAllocators/DebtAllocator.sol @@ -213,15 +213,13 @@ contract DebtAllocator is Governance { address _strategy, uint256 _targetDebt ) public virtual onlyKeepers { - IVault vault = IVault(_vault); - // If going to 0 record full balance first. if (_targetDebt == 0) { - vault.process_report(_strategy); + IVault(_vault).process_report(_strategy); } // Update debt with the default max loss. - vault.update_debt(_strategy, _targetDebt, maxDebtUpdateLoss); + IVault(_vault).update_debt(_strategy, _targetDebt, maxDebtUpdateLoss); // Update the last time the strategies debt was updated. _strategyConfigs[_vault][_strategy].lastUpdate = uint96( diff --git a/tests/debtAllocators/test_debt_optimizer_applicator.py b/tests/debtAllocators/test_debt_optimizer_applicator.py index 0e71564..b3432d6 100644 --- a/tests/debtAllocators/test_debt_optimizer_applicator.py +++ b/tests/debtAllocators/test_debt_optimizer_applicator.py @@ -6,10 +6,7 @@ def test_setup(debt_optimizer_applicator, debt_allocator, brain): assert debt_optimizer_applicator.managers(brain) == False - assert ( - debt_optimizer_applicator.debtAllocator() - == debt_allocator.address - ) + assert debt_optimizer_applicator.debtAllocator() == debt_allocator.address def test_set_managers(debt_optimizer_applicator, brain, user): @@ -75,7 +72,13 @@ def test_set_ratios( assert event.newMaxRatio == max assert event.newTotalDebtRatio == target assert debt_allocator.totalDebtRatio(vault) == target - assert debt_allocator.getStrategyConfig(vault, strategy) == (True, target, max, 0, 0) + assert debt_allocator.getStrategyConfig(vault, strategy) == ( + True, + target, + max, + 0, + 0, + ) new_strategy = create_strategy() vault.add_strategy(new_strategy, sender=daddy) @@ -109,5 +112,17 @@ def test_set_ratios( assert event.newMaxRatio == 2_000 * 1.2 assert debt_allocator.totalDebtRatio(vault) == 10_000 - assert debt_allocator.getStrategyConfig(vault, strategy) == (True, 8_000, 9_000, 0, 0) - assert debt_allocator.getStrategyConfig(vault, new_strategy) == (True, 2_000, 2_000 * 1.2, 0, 0) + assert debt_allocator.getStrategyConfig(vault, strategy) == ( + True, + 8_000, + 9_000, + 0, + 0, + ) + assert debt_allocator.getStrategyConfig(vault, new_strategy) == ( + True, + 2_000, + 2_000 * 1.2, + 0, + 0, + ) diff --git a/tests/utils/constants.py b/tests/utils/constants.py index ff3692a..898de93 100644 --- a/tests/utils/constants.py +++ b/tests/utils/constants.py @@ -43,14 +43,14 @@ class ChangeType(IntFlag): class AddressIds: - ROUTER = to_bytes32("ROUTER") - KEEPER = to_bytes32("KEEPER") - APR_ORACLE = to_bytes32("APR ORACLE") - RELEASE_REGISTRY = to_bytes32("RELEASE REGISTRY") - BASE_FEE_PROVIDER = to_bytes32("BASE FEE PROVIDER") - COMMON_REPORT_TRIGGER = to_bytes32("COMMON REPORT TRIGGER") - AUCTION_FACTORY = to_bytes32("AUCTION FACTORY") - SPLITTER_FACTORY = to_bytes32("SPLITTER FACTORY") - REGISTRY_FACTORY = to_bytes32("REGISTRY FACTORY") - ALLOCATOR_FACTORY = to_bytes32("ALLOCATOR FACTORY") - ACCOUNTANT_FACTORY = to_bytes32("ACCOUNTANT FACTORY") + ROUTER = to_bytes32("Router") + KEEPER = to_bytes32("Keeper") + APR_ORACLE = to_bytes32("APR Oracle") + RELEASE_REGISTRY = to_bytes32("Release Registry") + BASE_FEE_PROVIDER = to_bytes32("Base Fee Provider") + COMMON_REPORT_TRIGGER = to_bytes32("Common Report Trigger") + AUCTION_FACTORY = to_bytes32("Auction Factory") + SPLITTER_FACTORY = to_bytes32("Splitter Factory") + REGISTRY_FACTORY = to_bytes32("Registry Factory") + ALLOCATOR_FACTORY = to_bytes32("Allocator Factory") + ACCOUNTANT_FACTORY = to_bytes32("Accountant Factory")