diff --git a/contracts/smart-account/modules/BatchedSessionRouterModule.sol b/contracts/smart-account/modules/BatchedSessionRouterModule.sol index f4c7da29..d38efa4f 100644 --- a/contracts/smart-account/modules/BatchedSessionRouterModule.sol +++ b/contracts/smart-account/modules/BatchedSessionRouterModule.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: MIT pragma solidity 0.8.17; -/* solhint-disable function-max-lines,no-unused-import */ +/* solhint-disable function-max-lines */ import {BaseAuthorizationModule} from "./BaseAuthorizationModule.sol"; import {ISessionValidationModule} from "../interfaces/modules/ISessionValidationModule.sol"; @@ -11,7 +11,6 @@ import {_packValidationData} from "@account-abstraction/contracts/core/Helpers.s import {UserOperation} from "@account-abstraction/contracts/interfaces/UserOperation.sol"; import {IBatchedSessionRouterModule} from "../interfaces/modules/IBatchedSessionRouterModule.sol"; import {IAuthorizationModule} from "../interfaces/IAuthorizationModule.sol"; -import {ISignatureValidator} from "../interfaces/ISignatureValidator.sol"; /** * @title Batched Session Router diff --git a/contracts/smart-account/modules/ForwardFlowModule.sol b/contracts/smart-account/modules/ForwardFlowModule.sol index b91f25fb..8dcf2192 100644 --- a/contracts/smart-account/modules/ForwardFlowModule.sol +++ b/contracts/smart-account/modules/ForwardFlowModule.sol @@ -6,8 +6,6 @@ import {Enum} from "../common/Enum.sol"; import {ReentrancyGuard} from "../common/ReentrancyGuard.sol"; import {Math} from "@openzeppelin/contracts/utils/math/Math.sol"; -/* solhint-disable function-max-lines */ - struct Transaction { address to; Enum.Operation operation; @@ -248,11 +246,9 @@ contract ForwardFlowModule is ReentrancyGuard { } } - // We require some gas to emit the events (at least 2500) after the execution and some to - // perform code until the execution (7500 = call the external function + checks inside it) - // We also include the 1/64 in the check that is not send along with a call to counteract - // potential shortings because of EIP-150 - // Bitshift left 6 bits means multiplying by 64, just more gas efficient + // We need gas for events post-execution (~2500) and for code pre-execution (~7500: external call + checks). + // Including 1/64th for EIP-150 to address potential gas shortfalls. + // Bitshift left 6 bits (multiply by 64) is used for gas efficiency. if ( gasleft() < Math.max((_tx.targetTxGas << 6) / 63, _tx.targetTxGas + 2500) + 7500 @@ -285,9 +281,8 @@ contract ForwardFlowModule is ReentrancyGuard { } // Transfer transaction costs to tx.origin to avoid intermediate contract payments. - uint256 payment; if (refundInfo.gasPrice != 0) { - payment = _handlePayment( + uint256 payment = _handlePayment( smartAccount, startGas - gasleft(), refundInfo.baseGas, diff --git a/contracts/smart-account/test/upgrades/BaseSmartAccountNew.sol b/contracts/smart-account/test/upgrades/BaseSmartAccountNew.sol index 5e17690c..8bc47f6e 100644 --- a/contracts/smart-account/test/upgrades/BaseSmartAccountNew.sol +++ b/contracts/smart-account/test/upgrades/BaseSmartAccountNew.sol @@ -1,10 +1,6 @@ // SPDX-License-Identifier: GPL-3.0 pragma solidity 0.8.17; -/* solhint-disable avoid-low-level-calls */ -/* solhint-disable no-inline-assembly */ -/* solhint-disable reason-string */ - import {IAccount} from "@account-abstraction/contracts/interfaces/IAccount.sol"; import {IEntryPoint} from "@account-abstraction/contracts/interfaces/IEntryPoint.sol"; import {UserOperationLib, UserOperation} from "@account-abstraction/contracts/interfaces/UserOperation.sol"; diff --git a/contracts/smart-account/test/upgrades/v1/BaseSmartAccountV1.sol b/contracts/smart-account/test/upgrades/v1/BaseSmartAccountV1.sol index 1b938bba..8fdcb958 100644 --- a/contracts/smart-account/test/upgrades/v1/BaseSmartAccountV1.sol +++ b/contracts/smart-account/test/upgrades/v1/BaseSmartAccountV1.sol @@ -1,10 +1,6 @@ // SPDX-License-Identifier: GPL-3.0 pragma solidity 0.8.17; -/* solhint-disable avoid-low-level-calls */ -/* solhint-disable no-inline-assembly */ -/* solhint-disable reason-string */ - import {IAccount} from "@account-abstraction/contracts/interfaces/IAccount.sol"; import {IEntryPoint} from "@account-abstraction/contracts/interfaces/IEntryPoint.sol"; import {UserOperationLib, UserOperation} from "@account-abstraction/contracts/interfaces/UserOperation.sol"; diff --git a/contracts/smart-account/test/upgrades/v1/FallbackManagerV1.sol b/contracts/smart-account/test/upgrades/v1/FallbackManagerV1.sol index b46513ba..8a9bb392 100644 --- a/contracts/smart-account/test/upgrades/v1/FallbackManagerV1.sol +++ b/contracts/smart-account/test/upgrades/v1/FallbackManagerV1.sol @@ -14,7 +14,6 @@ abstract contract FallbackManagerV1 is SelfAuthorized, IFallbackManager { bytes32 internal constant FALLBACK_HANDLER_STORAGE_SLOT = 0x6c9a6c4a39284e37ed1cf53d337577d14212a4870fb976a4366c693b939918d4; - // solhint-disable-next-line payable-fallback,no-complex-fallback fallback() external { bytes32 slot = FALLBACK_HANDLER_STORAGE_SLOT; diff --git a/contracts/smart-account/test/upgrades/v1/SmartAccountV1.sol b/contracts/smart-account/test/upgrades/v1/SmartAccountV1.sol index c71bcec1..71779052 100644 --- a/contracts/smart-account/test/upgrades/v1/SmartAccountV1.sol +++ b/contracts/smart-account/test/upgrades/v1/SmartAccountV1.sol @@ -331,7 +331,7 @@ contract SmartAccountV1 is address payable refundReceiver ) private returns (uint256 payment) { if (tokenGasPriceFactor == 0) revert TokenGasPriceFactorCanNotBeZero(); - // solhint-disable-next-line avoid-tx-origin + address payable receiver = refundReceiver == address(0) ? payable(tx.origin) : refundReceiver; @@ -378,7 +378,7 @@ contract SmartAccountV1 is ) external returns (uint256 requiredGas) { require(tokenGasPriceFactor != 0, "invalid tokenGasPriceFactor"); uint256 startGas = gasleft(); - // solhint-disable-next-line avoid-tx-origin + address payable receiver = refundReceiver == address(0) ? payable(tx.origin) : refundReceiver;