Skip to content

Commit

Permalink
style: fix linter warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
gas1cent committed Dec 14, 2023
1 parent a8371fd commit 59618d6
Show file tree
Hide file tree
Showing 9 changed files with 69 additions and 74 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ import {SafeERC20} from '@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol
import {FixedPointMathLib} from 'solmate/utils/FixedPointMathLib.sol';

// solhint-disable-next-line no-unused-import
import {IResolutionModule} from
'@defi-wonderland/prophet-core-contracts/solidity/interfaces/modules/resolution/IResolutionModule.sol';
import {Module, IModule} from '@defi-wonderland/prophet-core-contracts/solidity/contracts/Module.sol';
import {IOracle} from '@defi-wonderland/prophet-core-contracts/solidity/interfaces/IOracle.sol';

Expand Down
40 changes: 20 additions & 20 deletions solidity/interfaces/extensions/IBondEscalationAccounting.sol
Original file line number Diff line number Diff line change
Expand Up @@ -89,26 +89,6 @@ interface IBondEscalationAccounting is IAccountingExtension {
bytes32 indexed _requestId, bytes32 indexed _disputeId, address indexed _pledger, IERC20 _token, uint256 _amount
);

/*///////////////////////////////////////////////////////////////
STRUCTS
//////////////////////////////////////////////////////////////*/

/**
* @notice Contains the data of the result of an escalation. Is used by users to claim their pledges
* @param requestId The ID of the bond-escalated request
* @param forVotesWon Whether the for votes won the dispute
* @param token The address of the token being paid out
* @param amountPerPledger The amount of token paid to each of the winning pledgers
* @param bondEscalationModule The address of the bond escalation module that was used
*/
struct EscalationResult {
bytes32 requestId;
bool forVotesWon;
IERC20 token;
uint256 amountPerPledger;
IBondEscalationModule bondEscalationModule;
}

/*///////////////////////////////////////////////////////////////
ERRORS
//////////////////////////////////////////////////////////////*/
Expand All @@ -133,6 +113,26 @@ interface IBondEscalationAccounting is IAccountingExtension {
*/
error BondEscalationAccounting_AlreadySettled();

/*///////////////////////////////////////////////////////////////
STRUCTS
//////////////////////////////////////////////////////////////*/

/**
* @notice Contains the data of the result of an escalation. Is used by users to claim their pledges
* @param requestId The ID of the bond-escalated request
* @param forVotesWon Whether the for votes won the dispute
* @param token The address of the token being paid out
* @param amountPerPledger The amount of token paid to each of the winning pledgers
* @param bondEscalationModule The address of the bond escalation module that was used
*/
struct EscalationResult {
bytes32 requestId;
bool forVotesWon;
IERC20 token;
uint256 amountPerPledger;
IBondEscalationModule bondEscalationModule;
}

/*///////////////////////////////////////////////////////////////
VARIABLES
//////////////////////////////////////////////////////////////*/
Expand Down
18 changes: 9 additions & 9 deletions solidity/interfaces/modules/dispute/ICircuitResolverModule.sol
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,15 @@ import {IAccountingExtension} from '../../extensions/IAccountingExtension.sol';
* and the request is finalized.
*/
interface ICircuitResolverModule is IDisputeModule {
/*///////////////////////////////////////////////////////////////
ERRORS
//////////////////////////////////////////////////////////////*/

/**
* @notice Thrown when the verification of a response fails
*/
error CircuitResolverModule_VerificationFailed();

/*///////////////////////////////////////////////////////////////
STRUCTS
//////////////////////////////////////////////////////////////*/
Expand All @@ -41,15 +50,6 @@ interface ICircuitResolverModule is IDisputeModule {
uint256 bondSize;
}

/*///////////////////////////////////////////////////////////////
ERRORS
//////////////////////////////////////////////////////////////*/

/**
* @notice Thrown when the verification of a response fails
*/
error CircuitResolverModule_VerificationFailed();

/*///////////////////////////////////////////////////////////////
LOGIC
//////////////////////////////////////////////////////////////*/
Expand Down
24 changes: 12 additions & 12 deletions solidity/interfaces/modules/request/IHttpRequestModule.sol
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,18 @@ import {IAccountingExtension} from '../../../interfaces/extensions/IAccountingEx
* @notice Module allowing users to request HTTP calls
*/
interface IHttpRequestModule is IRequestModule {
/*///////////////////////////////////////////////////////////////
ENUMS
//////////////////////////////////////////////////////////////*/

/**
* @notice Available HTTP methods
*/
enum HttpMethod {
GET,
POST
}

/*///////////////////////////////////////////////////////////////
STRUCTS
//////////////////////////////////////////////////////////////*/
Expand All @@ -34,18 +46,6 @@ interface IHttpRequestModule is IRequestModule {
uint256 paymentAmount;
}

/*///////////////////////////////////////////////////////////////
ENUMS
//////////////////////////////////////////////////////////////*/

/**
* @notice Available HTTP methods
*/
enum HttpMethod {
GET,
POST
}

/*///////////////////////////////////////////////////////////////
LOGIC
//////////////////////////////////////////////////////////////*/
Expand Down
22 changes: 11 additions & 11 deletions solidity/interfaces/modules/resolution/IArbitratorModule.sol
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,6 @@ interface IArbitratorModule is IResolutionModule {
*/
error ArbitratorModule_InvalidResolutionStatus();

/*///////////////////////////////////////////////////////////////
STRUCTS
//////////////////////////////////////////////////////////////*/
/**
* @notice Parameters of the request as stored in the module
* @param arbitrator The address of the arbitrator
*/
struct RequestParameters {
address arbitrator;
}

/*///////////////////////////////////////////////////////////////
ENUMS
//////////////////////////////////////////////////////////////*/
Expand All @@ -53,6 +42,17 @@ interface IArbitratorModule is IResolutionModule {
Resolved // The arbitration process is resolved
}

/*///////////////////////////////////////////////////////////////
STRUCTS
//////////////////////////////////////////////////////////////*/
/**
* @notice Parameters of the request as stored in the module
* @param arbitrator The address of the arbitrator
*/
struct RequestParameters {
address arbitrator;
}

/*///////////////////////////////////////////////////////////////
LOGIC
//////////////////////////////////////////////////////////////*/
Expand Down
2 changes: 1 addition & 1 deletion solidity/test/unit/extensions/AccountingExtension.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import 'forge-std/Test.sol';

import {Helpers} from '../../utils/Helpers.sol';

import {Oracle, IOracle} from '@defi-wonderland/prophet-core-contracts/solidity/contracts/Oracle.sol';
import {IOracle} from '@defi-wonderland/prophet-core-contracts/solidity/contracts/Oracle.sol';
import {
AccountingExtension, IAccountingExtension, IERC20
} from '../../../contracts/extensions/AccountingExtension.sol';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ contract BaseTest is Test, Helpers {
// A mock tree verifier
ITreeVerifier public treeVerifier;
// Mock addresses
IERC20 public _token = IERC20(makeAddr('token'));
IERC20 public token = IERC20(makeAddr('token'));

// Mock request data
bytes32[32] internal _treeBranches = [
Expand Down Expand Up @@ -162,7 +162,7 @@ contract RootVerificationModule_Unit_DisputeResponse is BaseTest {
leavesToInsert: _leavesToInsert,
treeVerifier: treeVerifier,
accountingExtension: _accountingExtension,
bondToken: _token,
bondToken: token,
bondSize: _bondSize
})
);
Expand Down Expand Up @@ -202,7 +202,7 @@ contract RootVerificationModule_Unit_DisputeResponse is BaseTest {
leavesToInsert: _leavesToInsert,
treeVerifier: treeVerifier,
accountingExtension: _accountingExtension,
bondToken: _token,
bondToken: token,
bondSize: _bondSize
})
);
Expand Down Expand Up @@ -258,7 +258,7 @@ contract RootVerificationModule_Unit_DisputeResponse is BaseTest {
leavesToInsert: _leavesToInsert,
treeVerifier: treeVerifier,
accountingExtension: _accountingExtension,
bondToken: _token,
bondToken: token,
bondSize: _bondSize
})
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,15 +219,15 @@ contract BondEscalationResolutionModule_Unit_StartResolution is BaseTest {
}

contract BondEscalationResolutionModule_Unit_PledgeForDispute is BaseTest {
uint256 _percentageDiff = 20;
uint256 _timeUntilDeadline = 1001;
uint256 internal _percentageDiff = 20;
uint256 internal _timeUntilDeadline = 1001;

// block.timestamp < _inequalityData.time + _timeToBreakInequality
uint256 _timeToBreakInequality = 5000;
uint128 _startTime;
uint256 internal _timeToBreakInequality = 5000;
uint128 internal _startTime;

bytes32 _disputeId;
bytes32 _requestId;
bytes32 internal _disputeId;
bytes32 internal _requestId;

function setUp() public override {
super.setUp();
Expand Down Expand Up @@ -525,15 +525,15 @@ contract BondEscalationResolutionModule_Unit_PledgeForDispute is BaseTest {
}

contract BondEscalationResolutionModule_Unit_PledgeAgainstDispute is BaseTest {
uint256 _percentageDiff = 20;
uint256 _timeUntilDeadline = 1001;
uint256 internal _percentageDiff = 20;
uint256 internal _timeUntilDeadline = 1001;

// block.timestamp < _inequalityData.time + _timeToBreakInequality
uint256 _timeToBreakInequality = 5000;
uint128 _startTime;
uint256 internal _timeToBreakInequality = 5000;
uint128 internal _startTime;

bytes32 _disputeId;
bytes32 _requestId;
bytes32 internal _disputeId;
bytes32 internal _requestId;

function setUp() public override {
super.setUp();
Expand Down
3 changes: 0 additions & 3 deletions solidity/test/utils/Helpers.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@ pragma solidity ^0.8.19;

import {IOracle} from '@defi-wonderland/prophet-core-contracts/solidity/interfaces/IOracle.sol';
import {DSTestPlus} from '@defi-wonderland/solidity-utils/solidity/test/DSTestPlus.sol';
import {IERC20} from '@openzeppelin/contracts/token/ERC20/IERC20.sol';

import {IAccountingExtension} from '../../interfaces/extensions/IAccountingExtension.sol';
import {TestConstants} from './TestConstants.sol';

contract Helpers is DSTestPlus, TestConstants {
Expand Down

0 comments on commit 59618d6

Please sign in to comment.