Skip to content

Commit

Permalink
fix: role manager comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Schlagonia committed Oct 15, 2024
1 parent cac6bee commit 1303b0a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 deletions.
12 changes: 6 additions & 6 deletions src/managers/RoleManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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");

/*//////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -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);
Expand Down
7 changes: 5 additions & 2 deletions src/managers/RoleManagerFactory.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion src/test/managers/TestRoleManager.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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)));
Expand Down

0 comments on commit 1303b0a

Please sign in to comment.