Skip to content

Commit

Permalink
Further simplify FeeModel contracts since Coordinator now extends them
Browse files Browse the repository at this point in the history
  • Loading branch information
cygnusv committed Aug 11, 2023
1 parent 6e0b915 commit 3ac5ed9
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 8 deletions.
2 changes: 1 addition & 1 deletion contracts/contracts/coordination/Coordinator.sol
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ contract Coordinator is AccessControlDefaultAdminRules, FlatRateFeeModel {
uint256 _feeRatePerSecond
)
AccessControlDefaultAdminRules(0, _admin)
FlatRateFeeModel(_currency, _feeRatePerSecond, _stakes)
FlatRateFeeModel(_currency, _feeRatePerSecond)
{
application = _stakes;
timeout = _timeout;
Expand Down
7 changes: 2 additions & 5 deletions contracts/contracts/coordination/FlatRateFeeModel.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
pragma solidity ^0.8.0;

import "./IFeeModel.sol";
import "../../threshold/IAccessControlApplication.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";

/**
Expand All @@ -14,18 +13,16 @@ contract FlatRateFeeModel is IFeeModel {

IERC20 public immutable currency;
uint256 public immutable feeRatePerSecond;
IAccessControlApplication public immutable stakes;

constructor(IERC20 _currency, uint256 _feeRatePerSecond, address _stakes){
constructor(IERC20 _currency, uint256 _feeRatePerSecond){
currency = _currency;
feeRatePerSecond = _feeRatePerSecond;
stakes = IAccessControlApplication(_stakes);
}

function getRitualInitiationCost(
address[] calldata providers,
uint32 duration
) external view returns(uint256){
) public view returns(uint256){
uint256 size = providers.length;
require(duration > 0, "Invalid ritual duration");
require(size > 0, "Invalid ritual size");
Expand Down
2 changes: 0 additions & 2 deletions contracts/contracts/coordination/IFeeModel.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,12 @@
pragma solidity ^0.8.0;

import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "../../threshold/IAccessControlApplication.sol";

/**
* @title IFeeModel
* @notice IFeeModel
*/
interface IFeeModel {
function currency() external view returns(IERC20);
function stakes() external view returns(IAccessControlApplication);
function getRitualInitiationCost(address[] calldata providers, uint32 duration) external view returns(uint256);
}

0 comments on commit 3ac5ed9

Please sign in to comment.