Skip to content

Commit

Permalink
disputables: improve interfaces
Browse files Browse the repository at this point in the history
  • Loading branch information
facuspagnuolo committed Jun 25, 2020
1 parent 1052f61 commit f4cde30
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 14 deletions.
2 changes: 0 additions & 2 deletions contracts/apps/disputable/DisputableAragonApp.sol
Expand Up @@ -27,8 +27,6 @@ contract DisputableAragonApp is IDisputable, AragonApp {
// bytes32 internal constant AGREEMENT_POSITION = keccak256("aragonOS.appStorage.agreement");
bytes32 internal constant AGREEMENT_POSITION = 0x6dbe80ccdeafbf5f3fff5738b224414f85e9370da36f61bf21c65159df7409e9;

event AgreementSet(IAgreement indexed agreement);

modifier onlyAgreement() {
require(address(_getAgreement()) == msg.sender, ERROR_SENDER_NOT_AGREEMENT);
_;
Expand Down
10 changes: 5 additions & 5 deletions contracts/apps/disputable/IAgreement.sol
Expand Up @@ -16,11 +16,11 @@ contract IAgreement is IArbitrable, IACLOracle {
event DisputableAppActivated(address indexed disputable);
event DisputableAppDeactivated(address indexed disputable);
event CollateralRequirementChanged(address indexed disputable, uint256 collateralRequirementId);
event ActionSubmitted(uint256 indexed actionId);
event ActionSubmitted(uint256 indexed actionId, address indexed disputable);
event ActionClosed(uint256 indexed actionId);
event ActionChallenged(uint256 indexed actionId, uint256 indexed challengeId);
event ActionSettled(uint256 indexed actionId, uint256 indexed challengeId);
event ActionDisputed(uint256 indexed actionId, uint256 indexed challengeId, uint256 indexed disputeId);
event ActionDisputed(uint256 indexed actionId, uint256 indexed challengeId);
event ActionAccepted(uint256 indexed actionId, uint256 indexed challengeId);
event ActionVoided(uint256 indexed actionId, uint256 indexed challengeId);
event ActionRejected(uint256 indexed actionId, uint256 indexed challengeId);
Expand All @@ -39,9 +39,9 @@ contract IAgreement is IArbitrable, IACLOracle {
function activate(
address _disputable,
ERC20 _collateralToken,
uint64 _challengeDuration,
uint256 _actionAmount,
uint256 _challengeAmount
uint256 _challengeAmount,
uint64 _challengeDuration
)
external;

Expand All @@ -53,7 +53,7 @@ contract IAgreement is IArbitrable, IACLOracle {

function challengeAction(uint256 _actionId, uint256 _settlementOffer, bool _finishedSubmittingEvidence, bytes _context) external;

function settle(uint256 _actionId) external;
function settleAction(uint256 _actionId) external;

function disputeAction(uint256 _actionId, bool _finishedSubmittingEvidence) external;

Expand Down
4 changes: 2 additions & 2 deletions contracts/apps/disputable/IDisputable.sol
Expand Up @@ -13,6 +13,8 @@ contract IDisputable is ERC165 {
bytes4 internal constant ERC165_INTERFACE_ID = bytes4(0x01ffc9a7);
bytes4 internal constant DISPUTABLE_INTERFACE_ID = bytes4(0xef113021);

event AgreementSet(IAgreement indexed agreement);

function setAgreement(IAgreement _agreement) external;

function onDisputableActionChallenged(uint256 _disputableActionId, uint256 _challengeId, address _challenger) external;
Expand All @@ -25,8 +27,6 @@ contract IDisputable is ERC165 {

function getAgreement() external view returns (IAgreement);

function getDisputableAction(uint256 _disputableActionId) external view returns (uint64 endDate, bool challenged, bool finished);

function canChallenge(uint256 _disputableActionId) external view returns (bool);

function canClose(uint256 _disputableActionId) external view returns (bool);
Expand Down
6 changes: 6 additions & 0 deletions contracts/lib/arbitration/IArbitrable.sol
Expand Up @@ -8,6 +8,12 @@ import "./IArbitrator.sol";
import "../../lib/standards/ERC165.sol";


/**
* @title Arbitrable interface
* @dev This interface is the one extended by `IAgreement` so it can be used by `IArbitrator`, its dispute resolution protocol.
* This interface was manually-copied from https://github.com/aragon/aragon-court/blob/v1.1.3/contracts/arbitration/IArbitrable.sol
* since we are using different solidity versions.
*/
contract IArbitrable is ERC165 {
bytes4 internal constant ERC165_INTERFACE_ID = bytes4(0x01ffc9a7);
bytes4 internal constant ARBITRABLE_INTERFACE_ID = bytes4(0x88f3ee69);
Expand Down
7 changes: 6 additions & 1 deletion contracts/lib/arbitration/IArbitrator.sol
Expand Up @@ -6,7 +6,12 @@ pragma solidity ^0.4.24;

import "../../lib/token/ERC20.sol";


/**
* @title Arbitrator interface
* @dev This interface is the one used by `IAgreement` as the dispute resolution protocol.
* This interface was manually-copied from https://github.com/aragon/aragon-court/blob/v1.1.3/contracts/arbitration/IArbitrator.sol
* since we are using different solidity versions.
*/
interface IArbitrator {
/**
* @dev Create a dispute over the Arbitrable sender with a number of possible rulings
Expand Down
4 changes: 0 additions & 4 deletions contracts/test/mocks/apps/disputable/DisputableAppMock.sol
Expand Up @@ -17,10 +17,6 @@ contract DisputableAppMock is DisputableAragonApp {
initialized();
}

function getDisputableAction(uint256 /*_disputableActionId*/) external view returns (uint64 endDate, bool challenged, bool finished) {
return (uint64(0), false, false);
}

function canChallenge(uint256 /*_disputableActionId*/) external view returns (bool) {
return true;
}
Expand Down

0 comments on commit f4cde30

Please sign in to comment.