Skip to content

Commit

Permalink
Disputable apps: add missing pieces for transaction fees module (#586)
Browse files Browse the repository at this point in the history
* Disputable apps: add missing pieces for transaction fees module

* arbitration: Add IAragonCourtArbitrator

* arbitration: Remove IAragonCourtArbitrator

* 5.0.0-beta.1

* disputable apps: fixes after rebase on next

* disputable apps: Add ITransactionFeesOracle to Agreement settings
  • Loading branch information
ßingen committed Jun 30, 2020
1 parent 4b283dc commit e948841
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 12 deletions.
9 changes: 8 additions & 1 deletion contracts/apps/disputable/IAgreement.sol
Expand Up @@ -7,6 +7,7 @@ pragma solidity ^0.4.24;
import "../../acl/IACLOracle.sol";
import "../../lib/token/ERC20.sol";
import "../../lib/arbitration/IArbitrable.sol";
import "../../lib/arbitration/ITransactionFeesOracle.sol";


contract IAgreement is IArbitrable, IACLOracle {
Expand Down Expand Up @@ -61,7 +62,13 @@ contract IAgreement is IArbitrable, IACLOracle {

function getCurrentSettingId() external view returns (uint256);

function getSetting(uint256 _settingId) external view returns (IArbitrator arbitrator, string title, bytes content);
function getSetting(uint256 _settingId) external view
returns (
IArbitrator arbitrator,
ITransactionFeesOracle transactionFeesOracle,
string title,
bytes content
);

function getDisputableInfo(address _disputable) external view returns (bool registered, uint256 currentCollateralRequirementId);

Expand Down
4 changes: 3 additions & 1 deletion contracts/apps/disputable/IDisputable.sol
Expand Up @@ -11,7 +11,7 @@ import "../../lib/standards/ERC165.sol";

contract IDisputable is ERC165 {
bytes4 internal constant ERC165_INTERFACE_ID = bytes4(0x01ffc9a7);
bytes4 internal constant DISPUTABLE_INTERFACE_ID = bytes4(0xef113021);
bytes4 internal constant DISPUTABLE_INTERFACE_ID = bytes4(0x737c65f9);

event AgreementSet(IAgreement indexed agreement);

Expand Down Expand Up @@ -39,4 +39,6 @@ contract IDisputable is ERC165 {
function supportsInterface(bytes4 _interfaceId) external pure returns (bool) {
return _interfaceId == DISPUTABLE_INTERFACE_ID || _interfaceId == ERC165_INTERFACE_ID;
}

function appId() public view returns (bytes32);
}
12 changes: 12 additions & 0 deletions contracts/lib/arbitration/ITransactionFeesOracle.sol
@@ -0,0 +1,12 @@
pragma solidity ^0.4.24;

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


interface ITransactionFeesOracle {
function setFee(bytes32 appId, ERC20 token, uint256 amount) external;
function setFees(bytes32[] _appIds, ERC20[] _tokens, uint256[] _amounts) external;
function unsetFee(bytes32 _appId) external;
function unsetFees(bytes32[] _appIds) external;
function getFee(bytes32 appId) external view returns (ERC20, uint256, address);
}
13 changes: 8 additions & 5 deletions contracts/test/mocks/apps/disputable/DisputableAppMock.sol
Expand Up @@ -36,11 +36,14 @@ contract DisputableAppMock is DisputableAragonApp {
function interfaceID() external pure returns (bytes4) {
IDisputable iDisputable;
return iDisputable.setAgreement.selector ^
iDisputable.onDisputableActionChallenged.selector ^
iDisputable.onDisputableActionAllowed.selector ^
iDisputable.onDisputableActionRejected.selector ^
iDisputable.onDisputableActionVoided.selector ^
iDisputable.getAgreement.selector;
iDisputable.onDisputableActionChallenged.selector ^
iDisputable.onDisputableActionAllowed.selector ^
iDisputable.onDisputableActionRejected.selector ^
iDisputable.onDisputableActionVoided.selector ^
iDisputable.getAgreement.selector ^
iDisputable.canChallenge.selector ^
iDisputable.canClose.selector ^
iDisputable.appId.selector;
}

function erc165interfaceID() external pure returns (bytes4) {
Expand Down
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "@aragon/os",
"version": "5.0.0-beta.0",
"version": "5.0.0-beta.1",
"description": "Core contracts for Aragon",
"scripts": {
"compile": "truffle compile",
Expand Down
10 changes: 6 additions & 4 deletions test/contracts/apps/disputable/disputable_app.js
Expand Up @@ -14,6 +14,8 @@ contract('DisputableApp', ([_, owner, agreement, anotherAgreement, someone]) =>
let disputable, disputableBase, dao, acl

const ZERO_ADDRESS = '0x0000000000000000000000000000000000000000'
const DISPUTABLE_INTERFACE = '0x737c65f9'
const ERC165_INTERFACE = '0x01ffc9a7'

before('deploy DAO', async () => {
const kernelBase = await Kernel.new(true)
Expand Down Expand Up @@ -41,16 +43,16 @@ contract('DisputableApp', ([_, owner, agreement, anotherAgreement, someone]) =>

describe('supportsInterface', () => {
it('supports ERC165', async () => {
assert.isTrue(await disputable.supportsInterface('0x01ffc9a7'), 'does not support ERC165')
assert.isTrue(await disputable.supportsInterface(ERC165_INTERFACE), 'does not support ERC165')

assert.equal(await disputable.ERC165_INTERFACE(), '0x01ffc9a7', 'ERC165 interface ID does not match')
assert.equal(await disputable.ERC165_INTERFACE(), ERC165_INTERFACE, 'ERC165 interface ID does not match')
assert.equal(await disputable.erc165interfaceID(), await disputable.ERC165_INTERFACE(), 'ERC165 interface ID does not match')
})

it('supports IDisputable', async () => {
assert.isTrue(await disputable.supportsInterface('0xef113021'), 'does not support IDisputable')
assert.isTrue(await disputable.supportsInterface(DISPUTABLE_INTERFACE), 'does not support IDisputable')

assert.equal(await disputable.interfaceID(), '0xef113021')
assert.equal(await disputable.interfaceID(), DISPUTABLE_INTERFACE)
assert.equal(await disputable.DISPUTABLE_INTERFACE(), await disputable.interfaceID(), 'IDisputable interface ID does not match')
})

Expand Down

0 comments on commit e948841

Please sign in to comment.