Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🙈 Remove ignore linting rules #147

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -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";
Expand All @@ -11,7 +11,7 @@ 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
Expand Down Expand Up @@ -130,7 +130,6 @@ contract BatchedSessionRouter is
}

/**
* @inheritdoc ISignatureValidator
* @dev isValidSignature according to BaseAuthorizationModule
* @param _dataHash Hash of the data to be validated.
* @param _signature Signature over the the _dataHash.
Expand Down
13 changes: 4 additions & 9 deletions contracts/smart-account/modules/ForwardFlowModule.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down
4 changes: 0 additions & 4 deletions contracts/smart-account/test/upgrades/BaseSmartAccountNew.sol
Original file line number Diff line number Diff line change
@@ -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";
Expand Down
Original file line number Diff line number Diff line change
@@ -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";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
4 changes: 2 additions & 2 deletions contracts/smart-account/test/upgrades/v1/SmartAccountV1.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
Loading