Skip to content

Commit

Permalink
Add solhint Into github action (storyprotocol#36)
Browse files Browse the repository at this point in the history
Enable solhint check in github action for each PR
  • Loading branch information
kingster-will authored Jan 29, 2024
1 parent 0b4c31b commit 645ab14
Show file tree
Hide file tree
Showing 9 changed files with 15 additions and 11 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
build
coverage
out
lib
/lib
assets
node_modules
.next
Expand Down
1 change: 1 addition & 0 deletions contracts/AccessController.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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_,
Expand Down
1 change: 0 additions & 1 deletion contracts/IPAccountImpl.sol
Original file line number Diff line number Diff line change
Expand Up @@ -185,5 +185,4 @@ contract IPAccountImpl is IERC165, IIPAccount {
}
}
}

}
3 changes: 2 additions & 1 deletion contracts/governance/Governable.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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();
}
_;
Expand Down
1 change: 0 additions & 1 deletion contracts/lib/Errors.sol
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ library Errors {
error IPAccount__InvalidSignature();
error IPAccount__ExpiredSignature();


////////////////////////////////////////////////////////////////////////////
// Module //
////////////////////////////////////////////////////////////////////////////
Expand Down
7 changes: 3 additions & 4 deletions contracts/lib/GovernanceLib.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions contracts/lib/Licensing.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion contracts/registries/LicenseRegistry.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 645ab14

Please sign in to comment.