From 0dbdea322375f182419691178766bd0a24f5f929 Mon Sep 17 00:00:00 2001 From: livingrockrises <90545960+livingrockrises@users.noreply.github.com> Date: Mon, 7 Oct 2024 17:08:44 +0400 Subject: [PATCH] chore: remove override modifier when not required --- .../sponsorship/BiconomySponsorshipPaymaster.sol | 4 ++-- contracts/token/BiconomyTokenPaymaster.sol | 13 +++++-------- test/unit/concrete/TestTokenPaymaster.t.sol | 1 - 3 files changed, 7 insertions(+), 11 deletions(-) diff --git a/contracts/sponsorship/BiconomySponsorshipPaymaster.sol b/contracts/sponsorship/BiconomySponsorshipPaymaster.sol index f0d351a..f5bc0f3 100644 --- a/contracts/sponsorship/BiconomySponsorshipPaymaster.sol +++ b/contracts/sponsorship/BiconomySponsorshipPaymaster.sol @@ -92,7 +92,7 @@ contract BiconomySponsorshipPaymaster is * @notice If _newVerifyingSigner is set to zero address, it will revert with an error. * After setting the new signer address, it will emit an event VerifyingSignerChanged. */ - function setSigner(address _newVerifyingSigner) external payable override onlyOwner { + function setSigner(address _newVerifyingSigner) external payable onlyOwner { if (_isContract(_newVerifyingSigner)) revert VerifyingSignerCanNotBeContract(); if (_newVerifyingSigner == address(0)) { revert VerifyingSignerCanNotBeZero(); @@ -124,7 +124,7 @@ contract BiconomySponsorshipPaymaster is * @param value The new value to be set as the unaccountedEPGasOverhead. * @notice only to be called by the owner of the contract. */ - function setUnaccountedGas(uint256 value) external payable override onlyOwner { + function setUnaccountedGas(uint256 value) external payable onlyOwner { if (value > UNACCOUNTED_GAS_LIMIT) { revert UnaccountedGasTooHigh(); } diff --git a/contracts/token/BiconomyTokenPaymaster.sol b/contracts/token/BiconomyTokenPaymaster.sol index a5a99f2..015a5b7 100644 --- a/contracts/token/BiconomyTokenPaymaster.sol +++ b/contracts/token/BiconomyTokenPaymaster.sol @@ -35,9 +35,6 @@ import "./swaps/Uniswapper.sol"; * applied, and how * to manage the assets received by the paymaster. */ - -// TODO: Review unnecessary overrides - contract BiconomyTokenPaymaster is IBiconomyTokenPaymaster, BasePaymaster, @@ -224,7 +221,7 @@ contract BiconomyTokenPaymaster is * @notice If _newVerifyingSigner is set to zero address, it will revert with an error. * After setting the new signer address, it will emit an event VerifyingSignerChanged. */ - function setSigner(address _newVerifyingSigner) external payable override onlyOwner { + function setSigner(address _newVerifyingSigner) external payable onlyOwner { if (_isContract(_newVerifyingSigner)) revert VerifyingSignerCanNotBeContract(); if (_newVerifyingSigner == address(0)) { revert VerifyingSignerCanNotBeZero(); @@ -241,7 +238,7 @@ contract BiconomyTokenPaymaster is * @param _newUnaccountedGas The new value to be set as the unaccounted gas value * @notice only to be called by the owner of the contract. */ - function setUnaccountedGas(uint256 _newUnaccountedGas) external payable override onlyOwner { + function setUnaccountedGas(uint256 _newUnaccountedGas) external payable onlyOwner { if (_newUnaccountedGas > UNACCOUNTED_GAS_LIMIT) { revert UnaccountedGasTooHigh(); } @@ -257,7 +254,7 @@ contract BiconomyTokenPaymaster is * @param _newIndependentPriceMarkup The new value to be set as the price markup * @notice only to be called by the owner of the contract. */ - function setPriceMarkup(uint256 _newIndependentPriceMarkup) external payable override onlyOwner { + function setPriceMarkup(uint256 _newIndependentPriceMarkup) external payable onlyOwner { if (_newIndependentPriceMarkup > MAX_PRICE_MARKUP || _newIndependentPriceMarkup < PRICE_DENOMINATOR) { // Not between 0% and 100% markup revert InvalidPriceMarkup(); @@ -274,7 +271,7 @@ contract BiconomyTokenPaymaster is * @param _newPriceExpiryDuration The new value to be set as the unaccounted gas value * @notice only to be called by the owner of the contract. */ - function setPriceExpiryDuration(uint256 _newPriceExpiryDuration) external payable override onlyOwner { + function setPriceExpiryDuration(uint256 _newPriceExpiryDuration) external payable onlyOwner { uint256 oldPriceExpiryDuration = priceExpiryDuration; assembly ("memory-safe") { sstore(priceExpiryDuration.slot, _newPriceExpiryDuration) @@ -307,7 +304,7 @@ contract BiconomyTokenPaymaster is * @param _oracle The oracle to use for the specified token * @notice only to be called by the owner of the contract. */ - function updateTokenDirectory(address _tokenAddress, IOracle _oracle) external payable override onlyOwner { + function updateTokenDirectory(address _tokenAddress, IOracle _oracle) external payable onlyOwner { if (_oracle.decimals() != 8) { // Token -> USD will always have 8 decimals revert InvalidOracleDecimals(); diff --git a/test/unit/concrete/TestTokenPaymaster.t.sol b/test/unit/concrete/TestTokenPaymaster.t.sol index 1648602..0d6c287 100644 --- a/test/unit/concrete/TestTokenPaymaster.t.sol +++ b/test/unit/concrete/TestTokenPaymaster.t.sol @@ -2,7 +2,6 @@ pragma solidity ^0.8.27; import "../../base/TestBase.sol"; -import { console2 } from "forge-std/src/console2.sol"; import { BiconomyTokenPaymaster, IBiconomyTokenPaymaster,