diff --git a/contracts/apps/disputable/IAgreement.sol b/contracts/apps/disputable/IAgreement.sol index 333cb7a58..c91b56f63 100644 --- a/contracts/apps/disputable/IAgreement.sol +++ b/contracts/apps/disputable/IAgreement.sol @@ -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 { @@ -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); diff --git a/contracts/apps/disputable/IDisputable.sol b/contracts/apps/disputable/IDisputable.sol index 30e8ce783..f015feb67 100644 --- a/contracts/apps/disputable/IDisputable.sol +++ b/contracts/apps/disputable/IDisputable.sol @@ -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); @@ -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); } diff --git a/contracts/lib/arbitration/ITransactionFeesOracle.sol b/contracts/lib/arbitration/ITransactionFeesOracle.sol new file mode 100644 index 000000000..df0cd3bbf --- /dev/null +++ b/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); +} diff --git a/contracts/test/mocks/apps/disputable/DisputableAppMock.sol b/contracts/test/mocks/apps/disputable/DisputableAppMock.sol index 42b893a64..4e8d10ba1 100644 --- a/contracts/test/mocks/apps/disputable/DisputableAppMock.sol +++ b/contracts/test/mocks/apps/disputable/DisputableAppMock.sol @@ -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) { diff --git a/package.json b/package.json index 53449adaf..4d6c9c091 100644 --- a/package.json +++ b/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", diff --git a/test/contracts/apps/disputable/disputable_app.js b/test/contracts/apps/disputable/disputable_app.js index 84f3f903e..4f08896b9 100644 --- a/test/contracts/apps/disputable/disputable_app.js +++ b/test/contracts/apps/disputable/disputable_app.js @@ -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) @@ -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') })