Skip to content

Commit

Permalink
Fix lint:sol
Browse files Browse the repository at this point in the history
  • Loading branch information
cristovaoth committed Oct 31, 2023
1 parent 10b7701 commit 5165ce2
Show file tree
Hide file tree
Showing 14 changed files with 58 additions and 41 deletions.
29 changes: 15 additions & 14 deletions .solhint.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
{
"extends": "solhint:recommended",
"rules": {
"compiler-version": "off",
"func-visibility": [
"warn",
{
"ignoreConstructors": true
}
],
"not-rely-on-time": "off",
"reason-string": "off",
"no-empty-blocks": "off",
"avoid-low-level-calls": "off"
}
"extends": "solhint:recommended",
"rules": {
"compiler-version": "off",
"func-visibility": [
"warn",
{
"ignoreConstructors": true
}
],
"not-rely-on-time": "off",
"reason-string": "off",
"no-empty-blocks": "off",
"avoid-low-level-calls": "off",
"no-inline-assembly": "off"
}
}
1 change: 1 addition & 0 deletions .solhintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
./contracts/test
9 changes: 7 additions & 2 deletions contracts/core/GuardableModifier.sol
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
// SPDX-License-Identifier: LGPL-3.0-only
pragma solidity >=0.7.0 <0.9.0;

import "../guard/Guardable.sol";
import "./Modifier.sol";
import {Enum} from "@gnosis.pm/safe-contracts/contracts/common/Enum.sol";

import {Guardable} from "../guard/Guardable.sol";
import {IAvatar} from "../interfaces/IAvatar.sol";
import {IGuard} from "../interfaces/IGuard.sol";
import {Modifier} from "./Modifier.sol";
import {Module} from "./Module.sol";

abstract contract GuardableModifier is Module, Guardable, Modifier {
/// @dev Passes a transaction to be executed by the avatar.
Expand Down
7 changes: 5 additions & 2 deletions contracts/core/GuardableModule.sol
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
// SPDX-License-Identifier: LGPL-3.0-only
pragma solidity >=0.7.0 <0.9.0;

import "../guard/Guardable.sol";
import "./Module.sol";
import {Enum} from "@gnosis.pm/safe-contracts/contracts/common/Enum.sol";
import {IGuard} from "../interfaces/IGuard.sol";
import {Guardable} from "../guard/Guardable.sol";
import {Module} from "./Module.sol";
import {IAvatar} from "../interfaces/IAvatar.sol";

/// @title GuardableModule - A contract that can pass messages to a Module Manager contract if enabled by that contract.
abstract contract GuardableModule is Module, Guardable {
Expand Down
9 changes: 5 additions & 4 deletions contracts/core/Modifier.sol
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
// SPDX-License-Identifier: LGPL-3.0-only
pragma solidity >=0.7.0 <0.9.0;

import "../interfaces/IAvatar.sol";
import "../signature/ExecutionTracker.sol";
import "../signature/SignatureChecker.sol";
import "./Module.sol";
import {Enum} from "@gnosis.pm/safe-contracts/contracts/common/Enum.sol";
import {ExecutionTracker} from "../signature/ExecutionTracker.sol";
import {IAvatar} from "../interfaces/IAvatar.sol";
import {Module} from "./Module.sol";
import {SignatureChecker} from "../signature/SignatureChecker.sol";

/// @title Modifier Interface - A contract that sits between a Module and an Avatar and enforce some additional logic.
abstract contract Modifier is
Expand Down
6 changes: 4 additions & 2 deletions contracts/core/Module.sol
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
// SPDX-License-Identifier: LGPL-3.0-only
pragma solidity >=0.7.0 <0.9.0;

import "../factory/FactoryFriendly.sol";
import "../interfaces/IAvatar.sol";
import {Enum} from "@gnosis.pm/safe-contracts/contracts/common/Enum.sol";

import {FactoryFriendly} from "../factory/FactoryFriendly.sol";
import {IAvatar} from "../interfaces/IAvatar.sol";

/// @title Module Interface - A contract that can pass messages to a Module Manager contract if enabled by that contract.
abstract contract Module is FactoryFriendly {
Expand Down
2 changes: 1 addition & 1 deletion contracts/factory/FactoryFriendly.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/// @title Zodiac FactoryFriendly - A contract that allows other contracts to be initializable and pass bytes as arguments to define contract state
pragma solidity >=0.7.0 <0.9.0;

import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
import {OwnableUpgradeable} from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";

abstract contract FactoryFriendly is OwnableUpgradeable {
function setUp(bytes memory initializeParams) public virtual;
Expand Down
7 changes: 4 additions & 3 deletions contracts/guard/BaseGuard.sol
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
// SPDX-License-Identifier: LGPL-3.0-only
pragma solidity >=0.7.0 <0.9.0;

import "@gnosis.pm/safe-contracts/contracts/common/Enum.sol";
import "@openzeppelin/contracts/utils/introspection/IERC165.sol";
import "../interfaces/IGuard.sol";
import {Enum} from "@gnosis.pm/safe-contracts/contracts/common/Enum.sol";
import {IERC165} from "@openzeppelin/contracts/utils/introspection/IERC165.sol";

import {IGuard} from "../interfaces/IGuard.sol";

abstract contract BaseGuard is IERC165 {
function supportsInterface(
Expand Down
7 changes: 4 additions & 3 deletions contracts/guard/Guardable.sol
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
// SPDX-License-Identifier: LGPL-3.0-only
pragma solidity >=0.7.0 <0.9.0;

import "@gnosis.pm/safe-contracts/contracts/common/Enum.sol";
import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
import "./BaseGuard.sol";
import {OwnableUpgradeable} from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";

import {BaseGuard} from "../guard/BaseGuard.sol";
import {IGuard} from "../interfaces/IGuard.sol";

/// @title Guardable - A contract that manages fallback calls made to this contract
contract Guardable is OwnableUpgradeable {
Expand Down
2 changes: 1 addition & 1 deletion contracts/interfaces/IAvatar.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/// @title Zodiac Avatar - A contract that manages modules that can execute transactions via this contract.
pragma solidity >=0.7.0 <0.9.0;

import "@gnosis.pm/safe-contracts/contracts/common/Enum.sol";
import {Enum} from "@gnosis.pm/safe-contracts/contracts/common/Enum.sol";

interface IAvatar {
event EnabledModule(address module);
Expand Down
2 changes: 1 addition & 1 deletion contracts/interfaces/IGuard.sol
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: LGPL-3.0-only
pragma solidity >=0.7.0 <0.9.0;

import "@gnosis.pm/safe-contracts/contracts/common/Enum.sol";
import {Enum} from "@gnosis.pm/safe-contracts/contracts/common/Enum.sol";

interface IGuard {
function checkTransaction(
Expand Down
3 changes: 2 additions & 1 deletion contracts/signature/SignatureChecker.sol
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: LGPL-3.0-only
pragma solidity >=0.8.0 <0.9.0;

import "./IERC1271.sol";
import {IERC1271} from "./IERC1271.sol";

/// @title SignatureChecker - A contract that retrieves and validates signatures appended to transaction calldata.
/// @dev currently supports eip-712 and eip-1271 signatures
Expand Down Expand Up @@ -116,6 +116,7 @@ abstract contract SignatureChecker {
bytes calldata signature
) internal view returns (bool result) {
uint256 size;
// eslint-disable-line no-inline-assembly
assembly {
size := extcodesize(signer)
}
Expand Down
6 changes: 0 additions & 6 deletions contracts/test/Imports.sol

This file was deleted.

9 changes: 8 additions & 1 deletion contracts/test/TestGuard.sol
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
// SPDX-License-Identifier: LGPL-3.0-only
pragma solidity >=0.7.0 <0.9.0;

import "../core/GuardableModule.sol";
import {IERC165} from "@openzeppelin/contracts/utils/introspection/IERC165.sol";

import {BaseGuard} from "../guard/BaseGuard.sol";
import {Enum} from "@gnosis.pm/safe-contracts/contracts/common/Enum.sol";
import {FactoryFriendly} from "../factory/FactoryFriendly.sol";
import {GuardableModule} from "../core/GuardableModule.sol";

/* solhint-disable */

contract TestGuard is FactoryFriendly, BaseGuard {
event PreChecked(address sender);
Expand Down

0 comments on commit 5165ce2

Please sign in to comment.