Skip to content

Commit

Permalink
Extract role to approve fee model
Browse files Browse the repository at this point in the history
  • Loading branch information
vzotova committed Jan 28, 2025
1 parent 941cd34 commit 5893d61
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion contracts/contracts/coordination/Coordinator.sol
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ contract Coordinator is Initializable, AccessControlDefaultAdminRulesUpgradeable
}

bytes32 public constant TREASURY_ROLE = keccak256("TREASURY_ROLE");
bytes32 public constant FEE_MODEL_MANAGER_ROLE = keccak256("FEE_MODEL_MANAGER_ROLE");

ITACoChildApplication public immutable application;
uint96 private immutable minAuthorization; // TODO use child app for checking eligibility
Expand Down Expand Up @@ -646,7 +647,7 @@ contract Coordinator is Initializable, AccessControlDefaultAdminRulesUpgradeable
}
}

function approveFeeModel(IFeeModel feeModel) external onlyRole(TREASURY_ROLE) {
function approveFeeModel(IFeeModel feeModel) external onlyRole(FEE_MODEL_MANAGER_ROLE) {
require(!feeModelsRegistry[feeModel], "Fee model already approved");
feeModelsRegistry[feeModel] = true;
emit FeeModelApproved(feeModel);
Expand Down
3 changes: 2 additions & 1 deletion tests/test_coordinator.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,9 @@ def fee_model(project, deployer, coordinator, erc20, treasury):
contract = project.FlatRateFeeModel.deploy(
coordinator.address, erc20.address, FEE_RATE, sender=deployer
)
coordinator.grantRole(coordinator.TREASURY_ROLE(), treasury, sender=deployer)
coordinator.grantRole(coordinator.FEE_MODEL_MANAGER_ROLE(), treasury, sender=deployer)
coordinator.approveFeeModel(contract.address, sender=treasury)
coordinator.grantRole(coordinator.TREASURY_ROLE(), treasury, sender=deployer)
return contract


Expand Down

0 comments on commit 5893d61

Please sign in to comment.