diff --git a/contracts/debtAllocators/GenericDebtAllocator.sol b/contracts/debtAllocators/GenericDebtAllocator.sol index a66d3d5..84c003b 100644 --- a/contracts/debtAllocators/GenericDebtAllocator.sol +++ b/contracts/debtAllocators/GenericDebtAllocator.sol @@ -82,13 +82,13 @@ contract GenericDebtAllocator is Governance { // Can't be more than 10_000. uint256 public debtRatio; + /// @notice Time to wait between debt updates. + uint256 public minimumWait; + /// @notice The minimum amount denominated in asset that will // need to be moved to trigger a debt update. uint256 public minimumChange; - /// @notice Time to wait between debt updates. - uint256 public minimumWait; - /// @notice Max loss to accept on debt updates in basis points. uint256 public maxDebtUpdateLoss; diff --git a/contracts/debtAllocators/YieldManager/Keeper.sol b/contracts/debtAllocators/YieldManager/Keeper.sol index 6db6c9d..df78427 100644 --- a/contracts/debtAllocators/YieldManager/Keeper.sol +++ b/contracts/debtAllocators/YieldManager/Keeper.sol @@ -53,7 +53,7 @@ contract Keeper is Governance { * @notice Add a new strategy, using the current `management` as the owner. * @param _strategy The address of the strategy. */ - function addNewStrategy(address _strategy) external onlyGovernance { + function addNewStrategy(address _strategy) external virtual onlyGovernance { address currentManager = IStrategy(_strategy).management(); require(strategyOwner[_strategy] == address(0), "already active"); require(IStrategy(_strategy).keeper() == address(this), "!keeper"); @@ -72,7 +72,7 @@ contract Keeper is Governance { function updateStrategyOwner( address _strategy, address _newOwner - ) external onlyStrategyOwner(_strategy) { + ) external virtual onlyStrategyOwner(_strategy) { require( _newOwner != address(0) && _newOwner != address(this) && @@ -86,7 +86,7 @@ contract Keeper is Governance { * @notice Removes the strategy. * @param _strategy The address of the strategy. */ - function removeStrategy(address _strategy) external { + function removeStrategy(address _strategy) external virtual { // Only governance or the strategy owner can call. if (msg.sender != governance) _checkStrategyOwner(_strategy); @@ -99,7 +99,7 @@ contract Keeper is Governance { * @notice Reports full profit for a strategy. * @param _strategy The address of the strategy. */ - function report(address _strategy) external onlyKeepers(_strategy) { + function report(address _strategy) external virtual onlyKeepers(_strategy) { // Report profits. IStrategy(_strategy).report(); } @@ -108,7 +108,7 @@ contract Keeper is Governance { * @notice Tends a strategy. * @param _strategy The address of the strategy. */ - function tend(address _strategy) external onlyKeepers(_strategy) { + function tend(address _strategy) external virtual onlyKeepers(_strategy) { // Tend. IStrategy(_strategy).tend(); } diff --git a/contracts/debtAllocators/YieldManager/YieldManager.sol b/contracts/debtAllocators/YieldManager/YieldManager.sol index 9a51d16..aab5c12 100644 --- a/contracts/debtAllocators/YieldManager/YieldManager.sol +++ b/contracts/debtAllocators/YieldManager/YieldManager.sol @@ -84,7 +84,7 @@ contract YieldManager is Governance { function updateAllocationPermissioned( address _vault, Allocation[] memory _newAllocations - ) public onlyGovernance { + ) public virtual onlyGovernance { // Move funds _allocate(_vault, _newAllocations); } @@ -113,6 +113,7 @@ contract YieldManager is Governance { Allocation[] memory _newAllocations ) external + virtual onlyProposersOrOpen returns (uint256 _currentYield, uint256 _afterYield) { @@ -213,7 +214,7 @@ contract YieldManager is Governance { function validateAllocation( address _vault, Allocation[] memory _newAllocations - ) external view returns (bool) { + ) external view virtual returns (bool) { // Get the total assets the vault has. uint256 _totalAssets = IVault(_vault).totalAssets(); @@ -245,7 +246,12 @@ contract YieldManager is Governance { function getCurrentAndExpectedYield( address _vault, Allocation[] memory _newAllocations - ) external view returns (uint256 _currentYield, uint256 _expectedYield) { + ) + external + view + virtual + returns (uint256 _currentYield, uint256 _expectedYield) + { // Get the total assets the vault has. uint256 _totalAssets = IVault(_vault).totalAssets(); @@ -290,7 +296,7 @@ contract YieldManager is Governance { function _allocate( address _vault, Allocation[] memory _newAllocations - ) internal { + ) internal virtual { address allocator = vaultAllocator[_vault]; require(allocator != address(0), "vault not added"); address _strategy; @@ -350,7 +356,7 @@ contract YieldManager is Governance { function setProposer( address _address, bool _allowed - ) external onlyGovernance { + ) external virtual onlyGovernance { proposer[_address] = _allowed; emit UpdateProposer(_address, _allowed); @@ -364,7 +370,7 @@ contract YieldManager is Governance { function setVaultAllocator( address _vault, address _allocator - ) external onlyGovernance { + ) external virtual onlyGovernance { vaultAllocator[_vault] = _allocator; emit UpdateVaultAllocator(_vault, _allocator); @@ -374,7 +380,7 @@ contract YieldManager is Governance { * @notice Sets the open status of the contract. * @param _open The new open status to set. */ - function setOpen(bool _open) external onlyGovernance { + function setOpen(bool _open) external virtual onlyGovernance { open = _open; emit UpdateOpen(_open);