From e019bbd673dc6ec09332ad5510b4061f5ee187bf Mon Sep 17 00:00:00 2001 From: shahafn Date: Thu, 9 Feb 2023 17:33:36 +0200 Subject: [PATCH] AA-146 N-12 Removing unused imports (#206) * Removing unused imports --------- Co-authored-by: Dror Tirosh --- contracts/interfaces/IAggregatedAccount.sol | 2 -- contracts/samples/DepositPaymaster.sol | 1 - contracts/samples/TokenPaymaster.sol | 1 - .../samples/gnosis/GnosisAccountFactory.sol | 7 ++++--- contracts/test/TestAggregatedAccount.sol | 2 -- contracts/test/TestSignatureAggregator.sol | 2 +- reports/gas-checker.txt | 20 +++++++++---------- 7 files changed, 15 insertions(+), 20 deletions(-) diff --git a/contracts/interfaces/IAggregatedAccount.sol b/contracts/interfaces/IAggregatedAccount.sol index d351c50..3a44b1d 100644 --- a/contracts/interfaces/IAggregatedAccount.sol +++ b/contracts/interfaces/IAggregatedAccount.sol @@ -1,9 +1,7 @@ // SPDX-License-Identifier: GPL-3.0 pragma solidity ^0.8.12; -import "./UserOperation.sol"; import "./IAccount.sol"; -import "./IAggregator.sol"; /** * Aggregated account that support IAggregator. diff --git a/contracts/samples/DepositPaymaster.sol b/contracts/samples/DepositPaymaster.sol index b8f9f86..0c8688d 100644 --- a/contracts/samples/DepositPaymaster.sol +++ b/contracts/samples/DepositPaymaster.sol @@ -6,7 +6,6 @@ pragma solidity ^0.8.12; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; -import "@openzeppelin/contracts/access/Ownable.sol"; import "../core/BasePaymaster.sol"; import "./IOracle.sol"; diff --git a/contracts/samples/TokenPaymaster.sol b/contracts/samples/TokenPaymaster.sol index acffbc1..5783a21 100644 --- a/contracts/samples/TokenPaymaster.sol +++ b/contracts/samples/TokenPaymaster.sol @@ -4,7 +4,6 @@ pragma solidity ^0.8.12; /* solhint-disable reason-string */ import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; -import "./SimpleAccount.sol"; import "../core/BasePaymaster.sol"; /** diff --git a/contracts/samples/gnosis/GnosisAccountFactory.sol b/contracts/samples/gnosis/GnosisAccountFactory.sol index 742edf2..8c04c4e 100644 --- a/contracts/samples/gnosis/GnosisAccountFactory.sol +++ b/contracts/samples/gnosis/GnosisAccountFactory.sol @@ -4,6 +4,7 @@ pragma solidity ^0.8.12; import "@openzeppelin/contracts/utils/Create2.sol"; import "@gnosis.pm/safe-contracts/contracts/proxies/GnosisSafeProxyFactory.sol"; import "./EIP4337Manager.sol"; + /** * A wrapper factory contract to deploy GnosisSafe as an Account-Abstraction wallet contract. */ @@ -47,9 +48,9 @@ contract GnosisSafeAccountFactory { } /** - * calculate the counterfactual address of this account as it would be returned by createAccount() - * (uses the same "create2 signature" used by GnosisSafeProxyFactory.createProxyWithNonce) - */ + * calculate the counterfactual address of this account as it would be returned by createAccount() + * (uses the same "create2 signature" used by GnosisSafeProxyFactory.createProxyWithNonce) + */ function getAddress(address owner,uint256 salt) public view returns (address) { bytes memory initializer = getInitializer(owner); //copied from deployProxyWithNonce diff --git a/contracts/test/TestAggregatedAccount.sol b/contracts/test/TestAggregatedAccount.sol index 074c32d..5d921f4 100644 --- a/contracts/test/TestAggregatedAccount.sol +++ b/contracts/test/TestAggregatedAccount.sol @@ -2,9 +2,7 @@ pragma solidity ^0.8.12; import "../interfaces/IAggregatedAccount.sol"; -import "../core/BaseAccount.sol"; import "../samples/SimpleAccount.sol"; -import "../interfaces/UserOperation.sol"; /** * test aggregated-signature account. diff --git a/contracts/test/TestSignatureAggregator.sol b/contracts/test/TestSignatureAggregator.sol index e80f4f0..97b9eb5 100644 --- a/contracts/test/TestSignatureAggregator.sol +++ b/contracts/test/TestSignatureAggregator.sol @@ -4,7 +4,7 @@ pragma solidity ^0.8.12; /* solhint-disable reason-string */ import "../interfaces/IAggregator.sol"; -import "hardhat/console.sol"; +import "../interfaces/IEntryPoint.sol"; import "../samples/SimpleAccount.sol"; /** diff --git a/reports/gas-checker.txt b/reports/gas-checker.txt index 1379136..385d9e4 100644 --- a/reports/gas-checker.txt +++ b/reports/gas-checker.txt @@ -8,28 +8,28 @@ ║ │ │ │ (delta for │ (compared to ║ ║ │ │ │ one UserOp) │ account.exec()) ║ ╟────────────────────────────────┼───────┼───────────────┼────────────────┼─────────────────────╢ -║ simple │ 1 │ 78087 │ │ ║ +║ simple │ 1 │ 78111 │ │ ║ ╟────────────────────────────────┼───────┼───────────────┼────────────────┼─────────────────────╢ -║ simple - diff from previous │ 2 │ │ 43573 │ 12528 ║ +║ simple - diff from previous │ 2 │ │ 43585 │ 12540 ║ ╟────────────────────────────────┼───────┼───────────────┼────────────────┼─────────────────────╢ -║ simple │ 10 │ 470473 │ │ ║ +║ simple │ 10 │ 470497 │ │ ║ ╟────────────────────────────────┼───────┼───────────────┼────────────────┼─────────────────────╢ -║ simple - diff from previous │ 11 │ │ 43744 │ 12699 ║ +║ simple - diff from previous │ 11 │ │ 43756 │ 12711 ║ ╟────────────────────────────────┼───────┼───────────────┼────────────────┼─────────────────────╢ ║ simple paymaster │ 1 │ 84411 │ │ ║ ╟────────────────────────────────┼───────┼───────────────┼────────────────┼─────────────────────╢ -║ simple paymaster with diff │ 2 │ │ 42598 │ 11553 ║ +║ simple paymaster with diff │ 2 │ │ 42574 │ 11529 ║ ╟────────────────────────────────┼───────┼───────────────┼────────────────┼─────────────────────╢ -║ simple paymaster │ 10 │ 467942 │ │ ║ +║ simple paymaster │ 10 │ 468002 │ │ ║ ╟────────────────────────────────┼───────┼───────────────┼────────────────┼─────────────────────╢ -║ simple paymaster with diff │ 11 │ │ 42758 │ 11713 ║ +║ simple paymaster with diff │ 11 │ │ 42698 │ 11653 ║ ╟────────────────────────────────┼───────┼───────────────┼────────────────┼─────────────────────╢ ║ big tx 5k │ 1 │ 179846 │ │ ║ ╟────────────────────────────────┼───────┼───────────────┼────────────────┼─────────────────────╢ -║ big tx - diff from previous │ 2 │ │ 144910 │ 17615 ║ +║ big tx - diff from previous │ 2 │ │ 144922 │ 17627 ║ ╟────────────────────────────────┼───────┼───────────────┼────────────────┼─────────────────────╢ -║ big tx 5k │ 10 │ 1489641 │ │ ║ +║ big tx 5k │ 10 │ 1489653 │ │ ║ ╟────────────────────────────────┼───────┼───────────────┼────────────────┼─────────────────────╢ -║ big tx - diff from previous │ 11 │ │ 146391 │ 19096 ║ +║ big tx - diff from previous │ 11 │ │ 146355 │ 19060 ║ ╚════════════════════════════════╧═══════╧═══════════════╧════════════════╧═════════════════════╝