Skip to content

Commit

Permalink
ci: fix solhint warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
clauBv23 committed Aug 21, 2024
1 parent 8135b8f commit 99f5cef
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions contracts/src/mocks/plugin/CustomExecutorMock.sol
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ contract CustomExecutorMock {
if (callId == bytes32(0)) {
revert Failed();
} else if (callId == bytes32(uint256(123))) {
// solhint-disable-next-line reason-string, custom-errors
revert();
} else {
emit Executed(msg.sender, callId, _actions, allowFailureMap, failureMap, execResults);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ contract ProposalMock is Proposal {
// We don't need to test these below functions as they will be tested in the actual plugins.
// This mock contract is only used to test `supportsInterface` function.

// solhint-disable no-empty-blocks
function createProposal(
bytes memory data,
IDAO.Action[] memory actions,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ contract ProposalUpgradeableMock is ProposalUpgradeable {
// We don't need to test these below functions as they will be tested in the actual plugins.
// This mock contract is only used to test `supportsInterface` function.

// solhint-disable no-empty-blocks
function createProposal(
bytes memory data,
IDAO.Action[] memory actions,
Expand Down
2 changes: 2 additions & 0 deletions contracts/src/plugin/Plugin.sol
Original file line number Diff line number Diff line change
Expand Up @@ -134,12 +134,14 @@ abstract contract Plugin is IPlugin, ERC165, DaoAuthorizable, ProtocolVersion {
bool success;
bytes memory data;

// solhint-disable-next-line avoid-low-level-calls
(success, data) = _target.delegatecall(
abi.encodeCall(IDAO.execute, (_callId, _actions, _allowFailureMap))
);

if (!success) {
if (data.length > 0) {
// solhint-disable-next-line no-inline-assembly
assembly {
let returndata_size := mload(data)
revert(add(32, data), returndata_size)
Expand Down
2 changes: 2 additions & 0 deletions contracts/src/plugin/PluginCloneable.sol
Original file line number Diff line number Diff line change
Expand Up @@ -149,12 +149,14 @@ abstract contract PluginCloneable is
bool success;
bytes memory data;

// solhint-disable-next-line avoid-low-level-calls
(success, data) = _target.delegatecall(
abi.encodeCall(IDAO.execute, (_callId, _actions, _allowFailureMap))
);

if (!success) {
if (data.length > 0) {
// solhint-disable-next-line no-inline-assembly
assembly {
let returndata_size := mload(data)
revert(add(32, data), returndata_size)
Expand Down
2 changes: 2 additions & 0 deletions contracts/src/plugin/PluginUUPSUpgradeable.sol
Original file line number Diff line number Diff line change
Expand Up @@ -164,12 +164,14 @@ abstract contract PluginUUPSUpgradeable is
bool success;
bytes memory data;

// solhint-disable-next-line avoid-low-level-calls
(success, data) = _target.delegatecall(
abi.encodeCall(IDAO.execute, (_callId, _actions, _allowFailureMap))
);

if (!success) {
if (data.length > 0) {
// solhint-disable-next-line no-inline-assembly
assembly {
let returndata_size := mload(data)
revert(add(32, data), returndata_size)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ pragma solidity ^0.8.8;
import {CountersUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/CountersUpgradeable.sol";
import {ERC165Upgradeable} from "@openzeppelin/contracts-upgradeable/utils/introspection/ERC165Upgradeable.sol";

import {IDAO} from "../../../dao/IDAO.sol";
import {IProposal} from "./IProposal.sol";

/// @title ProposalUpgradeable
Expand Down

0 comments on commit 99f5cef

Please sign in to comment.