diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6cecbc92..8a8f8f30 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -58,6 +58,12 @@ jobs: forge test -vvv --fork-url https://eth.drpc.org --fork-block-number 18613489 id: forge-test + - name: Run solhint + run: npx solhint contracts/**/*.sol + + - name: Run solhint + run: npx solhint contracts/*.sol + # - name: Gas Difference # run: # forge snapshot --gas-report --diff --desc diff --git a/.prettierignore b/.prettierignore index cf5eb8c1..90ca9a19 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1,7 +1,7 @@ build coverage out -lib +/lib assets node_modules .next diff --git a/contracts/AccessController.sol b/contracts/AccessController.sol index 57f45442..fc11863c 100644 --- a/contracts/AccessController.sol +++ b/contracts/AccessController.sol @@ -124,6 +124,7 @@ contract AccessController is IAccessController, Governable { /// @param to_ The recipient of the transaction. /// @param func_ The function selector. /// @return True if the function call is allowed, false otherwise. + // solhint-disable code-complexity function checkPermission( address ipAccount_, address signer_, diff --git a/contracts/IPAccountImpl.sol b/contracts/IPAccountImpl.sol index 84c6683a..5446fb77 100644 --- a/contracts/IPAccountImpl.sol +++ b/contracts/IPAccountImpl.sol @@ -185,5 +185,4 @@ contract IPAccountImpl is IERC165, IIPAccount { } } } - } diff --git a/contracts/governance/Governable.sol b/contracts/governance/Governable.sol index 214784aa..43991886 100644 --- a/contracts/governance/Governable.sol +++ b/contracts/governance/Governable.sol @@ -7,6 +7,7 @@ import { IGovernance } from "contracts/interfaces/governance/IGovernance.sol"; import { IGovernable } from "../interfaces/governance/IGovernable.sol"; import { ERC165Checker } from "@openzeppelin/contracts/utils/introspection/ERC165Checker.sol"; import { GovernanceLib } from "contracts/lib/GovernanceLib.sol"; + /// @title Governable /// @dev All contracts managed by governance should inherit from this contract. abstract contract Governable is IGovernable { @@ -15,7 +16,7 @@ abstract contract Governable is IGovernable { /// @dev Ensures that the function is called by the protocol admin. modifier onlyProtocolAdmin() { - if(!IGovernance(governance).hasRole(GovernanceLib.PROTOCOL_ADMIN, msg.sender)) { + if (!IGovernance(governance).hasRole(GovernanceLib.PROTOCOL_ADMIN, msg.sender)) { revert Errors.Governance__OnlyProtocolAdmin(); } _; diff --git a/contracts/lib/Errors.sol b/contracts/lib/Errors.sol index b1e1848f..2ce1269d 100644 --- a/contracts/lib/Errors.sol +++ b/contracts/lib/Errors.sol @@ -22,7 +22,6 @@ library Errors { error IPAccount__InvalidSignature(); error IPAccount__ExpiredSignature(); - //////////////////////////////////////////////////////////////////////////// // Module // //////////////////////////////////////////////////////////////////////////// diff --git a/contracts/lib/GovernanceLib.sol b/contracts/lib/GovernanceLib.sol index ae01de17..f51c987b 100644 --- a/contracts/lib/GovernanceLib.sol +++ b/contracts/lib/GovernanceLib.sol @@ -5,12 +5,11 @@ pragma solidity ^0.8.23; /// @title Governance /// @dev This library provides types for Story Protocol Governance. library GovernanceLib { - bytes32 public constant PROTOCOL_ADMIN = bytes32(0); - /// @notice An enum containing the different states the protocol can be in. - /// @param Unpaused The unpaused state. - /// @param Paused The paused state. + /// @notice An enum containing the different states the protocol can be in. + /// @param Unpaused The unpaused state. + /// @param Paused The paused state. enum ProtocolState { Unpaused, Paused diff --git a/contracts/lib/Licensing.sol b/contracts/lib/Licensing.sol index f80c5443..8241139d 100644 --- a/contracts/lib/Licensing.sol +++ b/contracts/lib/Licensing.sol @@ -5,8 +5,6 @@ import { IParamVerifier } from "../interfaces/licensing/IParamVerifier.sol"; import { Errors } from "./Errors.sol"; library Licensing { - - /// Identifies a license parameter (term) from a license framework struct Parameter { /// Contract that must check if the condition of the paremeter is set diff --git a/contracts/registries/LicenseRegistry.sol b/contracts/registries/LicenseRegistry.sol index 870a6a81..52e95031 100644 --- a/contracts/registries/LicenseRegistry.sol +++ b/contracts/registries/LicenseRegistry.sol @@ -439,7 +439,8 @@ contract LicenseRegistry is ERC1155, ILicenseRegistry { uint256[] memory ids, uint256[] memory values ) internal virtual override { - // We are interested in transfers, minting and burning are checked in mintLicense and linkIpToParent respectively. + // We are interested in transfers, minting and burning are checked in mintLicense and linkIpToParent + // respectively. if (from != address(0) && to != address(0)) { for (uint256 i = 0; i < ids.length; i++) { // Verify transfer params