diff --git a/src/managers/RoleManager.sol b/src/managers/RoleManager.sol index 4acc8c2..2d50f69 100644 --- a/src/managers/RoleManager.sol +++ b/src/managers/RoleManager.sol @@ -52,16 +52,16 @@ contract RoleManager is Positions { keccak256("Pending Governance"); /// @notice Position ID for "Governance". bytes32 public constant GOVERNANCE = keccak256("Governance"); - /// @notice Position ID for "brain". + /// @notice Position ID for "Brain". bytes32 public constant MANAGEMENT = keccak256("Management"); - /// @notice Position ID for "keeper". + /// @notice Position ID for "Keeper". bytes32 public constant KEEPER = keccak256("Keeper"); - /// @notice Position ID for the Registry. + /// @notice Position ID for the "Registry". bytes32 public constant REGISTRY = keccak256("Registry"); - /// @notice Position ID for the Accountant. + /// @notice Position ID for the "Accountant". bytes32 public constant ACCOUNTANT = keccak256("Accountant"); - /// @notice Position ID for Debt Allocator + /// @notice Position ID for the "Debt Allocator". bytes32 public constant DEBT_ALLOCATOR = keccak256("Debt Allocator"); /*////////////////////////////////////////////////////////////// @@ -106,7 +106,7 @@ contract RoleManager is Positions { chad = _governance; projectName = _projectName; - defaultProfitMaxUnlockTime = 10 days; + defaultProfitMaxUnlockTime = 7 days; // Governance gets all the roles. _setPositionHolder(GOVERNANCE, _governance); diff --git a/src/managers/RoleManagerFactory.sol b/src/managers/RoleManagerFactory.sol index 1b7dc29..ea535fa 100644 --- a/src/managers/RoleManagerFactory.sol +++ b/src/managers/RoleManagerFactory.sol @@ -87,7 +87,7 @@ contract RoleManagerFactory is Clonable { * a new V3 project to exist. * @param _name The name of the project * @param _governance The address of governance to use - * @param _management The address of management to use + * @param _management The address of management to use if any * @return _roleManager address of the newly created RoleManager for the project */ function newProject( @@ -107,9 +107,12 @@ contract RoleManagerFactory is Clonable { _fromAddressProvider(ACCOUNTANT_FACTORY) ).newAccountant(address(this), _governance); + // If management is not used, use governance as the default owner of the debt allocator. address _debtAllocator = DebtAllocatorFactory( _fromAddressProvider(DEBT_ALLOCATOR_FACTORY) - ).newDebtAllocator(_management); + ).newDebtAllocator( + _management != address(0) ? _management : _governance + ); // Clone and initialize the RoleManager. _roleManager = _clone(); diff --git a/src/test/managers/TestRoleManager.t.sol b/src/test/managers/TestRoleManager.t.sol index 16b3ead..1289fba 100644 --- a/src/test/managers/TestRoleManager.t.sol +++ b/src/test/managers/TestRoleManager.t.sol @@ -552,7 +552,7 @@ contract TestRoleManager is Setup { assertEq(newVault.roles(brain), brain_roles); assertEq(newVault.roles(address(keeper)), keeper_roles); assertEq(newVault.roles(vaultDebtAllocator), debt_allocator_roles); - assertEq(newVault.profitMaxUnlockTime(), 10 days); + assertEq(newVault.profitMaxUnlockTime(), 7 days); assertEq(address(newVault.accountant()), address(accountant)); assertTrue(accountant.vaults(address(newVault)));