Skip to content

Commit

Permalink
Update FeeBankCharger.sol: Refactoring the Modifier
Browse files Browse the repository at this point in the history
  • Loading branch information
0xScratch authored Aug 28, 2023
1 parent c90b5dd commit eb117c6
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion contracts/FeeBankCharger.sol
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,21 @@ contract FeeBankCharger is IFeeBankCharger {
* @dev Modifier to check if the sender is a feeBank contract.
*/
modifier onlyFeeBank() {
if (msg.sender != address(feeBank)) revert OnlyFeeBankAccess();
checkFeeBank();
_;
}

constructor(IERC20 token) {
feeBank = new FeeBank(this, token, msg.sender);
}

/**
* @dev Internal function to be called by the modifier
*/
function checkFeeBank() internal view {

Check failure on line 38 in contracts/FeeBankCharger.sol

View workflow job for this annotation

GitHub Actions / lint

'checkFeeBank' should start with _
if (msg.sender != address(feeBank)) revert OnlyFeeBankAccess();
}

/**
* @notice See {IFeeBankCharger-availableCredit}.
*/
Expand Down

0 comments on commit eb117c6

Please sign in to comment.