11// SPDX-License-Identifier: GPL-3.0
22pragma solidity ^ 0.8.12 ;
33
4+ /* solhint-disable reason-string */
5+
46import "@openzeppelin/contracts/token/ERC20/IERC20.sol " ;
57import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol " ;
68
@@ -28,9 +30,9 @@ contract DepositPaymaster is BasePaymaster {
2830 using SafeERC20 for IERC20 ;
2931
3032 //calculated cost of the postOp
31- uint256 constant COST_OF_POST = 35000 ;
33+ uint256 constant public COST_OF_POST = 35000 ;
3234
33- IOracle private constant nullOracle = IOracle (address (0 ));
35+ IOracle private constant NULL_ORACLE = IOracle (address (0 ));
3436 mapping (IERC20 => IOracle) public oracles;
3537 mapping (IERC20 => mapping (address => uint256 )) public balances;
3638 mapping (address => uint256 ) public unlockBlock;
@@ -44,7 +46,7 @@ contract DepositPaymaster is BasePaymaster {
4446 * owner of the paymaster should add supported tokens
4547 */
4648 function addToken (IERC20 token , IOracle tokenPriceOracle ) external onlyOwner {
47- require (oracles[token] == nullOracle );
49+ require (oracles[token] == NULL_ORACLE );
4850 oracles[token] = tokenPriceOracle;
4951 }
5052
@@ -61,7 +63,7 @@ contract DepositPaymaster is BasePaymaster {
6163 function addDepositFor (IERC20 token , address account , uint256 amount ) external {
6264 //(sender must have approval for the paymaster)
6365 token.safeTransferFrom (msg .sender , address (this ), amount);
64- require (oracles[token] != nullOracle , "unsupported token " );
66+ require (oracles[token] != NULL_ORACLE , "unsupported token " );
6567 balances[token][account] += amount;
6668 if (msg .sender == account) {
6769 lockTokenDeposit ();
@@ -110,7 +112,7 @@ contract DepositPaymaster is BasePaymaster {
110112 */
111113 function getTokenValueOfEth (IERC20 token , uint256 ethBought ) internal view virtual returns (uint256 requiredTokens ) {
112114 IOracle oracle = oracles[token];
113- require (oracle != nullOracle , "DepositPaymaster: unsupported token " );
115+ require (oracle != NULL_ORACLE , "DepositPaymaster: unsupported token " );
114116 return oracle.getTokenValueOfEth (ethBought);
115117 }
116118
0 commit comments