Skip to content

Commit e948841

Browse files
author
ßingen
authored
Disputable apps: add missing pieces for transaction fees module (#586)
* 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
1 parent 4b283dc commit e948841

File tree

6 files changed

+38
-12
lines changed

6 files changed

+38
-12
lines changed

contracts/apps/disputable/IAgreement.sol

+8-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ pragma solidity ^0.4.24;
77
import "../../acl/IACLOracle.sol";
88
import "../../lib/token/ERC20.sol";
99
import "../../lib/arbitration/IArbitrable.sol";
10+
import "../../lib/arbitration/ITransactionFeesOracle.sol";
1011

1112

1213
contract IAgreement is IArbitrable, IACLOracle {
@@ -61,7 +62,13 @@ contract IAgreement is IArbitrable, IACLOracle {
6162

6263
function getCurrentSettingId() external view returns (uint256);
6364

64-
function getSetting(uint256 _settingId) external view returns (IArbitrator arbitrator, string title, bytes content);
65+
function getSetting(uint256 _settingId) external view
66+
returns (
67+
IArbitrator arbitrator,
68+
ITransactionFeesOracle transactionFeesOracle,
69+
string title,
70+
bytes content
71+
);
6572

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

contracts/apps/disputable/IDisputable.sol

+3-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import "../../lib/standards/ERC165.sol";
1111

1212
contract IDisputable is ERC165 {
1313
bytes4 internal constant ERC165_INTERFACE_ID = bytes4(0x01ffc9a7);
14-
bytes4 internal constant DISPUTABLE_INTERFACE_ID = bytes4(0xef113021);
14+
bytes4 internal constant DISPUTABLE_INTERFACE_ID = bytes4(0x737c65f9);
1515

1616
event AgreementSet(IAgreement indexed agreement);
1717

@@ -39,4 +39,6 @@ contract IDisputable is ERC165 {
3939
function supportsInterface(bytes4 _interfaceId) external pure returns (bool) {
4040
return _interfaceId == DISPUTABLE_INTERFACE_ID || _interfaceId == ERC165_INTERFACE_ID;
4141
}
42+
43+
function appId() public view returns (bytes32);
4244
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
pragma solidity ^0.4.24;
2+
3+
import "../token/ERC20.sol";
4+
5+
6+
interface ITransactionFeesOracle {
7+
function setFee(bytes32 appId, ERC20 token, uint256 amount) external;
8+
function setFees(bytes32[] _appIds, ERC20[] _tokens, uint256[] _amounts) external;
9+
function unsetFee(bytes32 _appId) external;
10+
function unsetFees(bytes32[] _appIds) external;
11+
function getFee(bytes32 appId) external view returns (ERC20, uint256, address);
12+
}

contracts/test/mocks/apps/disputable/DisputableAppMock.sol

+8-5
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,14 @@ contract DisputableAppMock is DisputableAragonApp {
3636
function interfaceID() external pure returns (bytes4) {
3737
IDisputable iDisputable;
3838
return iDisputable.setAgreement.selector ^
39-
iDisputable.onDisputableActionChallenged.selector ^
40-
iDisputable.onDisputableActionAllowed.selector ^
41-
iDisputable.onDisputableActionRejected.selector ^
42-
iDisputable.onDisputableActionVoided.selector ^
43-
iDisputable.getAgreement.selector;
39+
iDisputable.onDisputableActionChallenged.selector ^
40+
iDisputable.onDisputableActionAllowed.selector ^
41+
iDisputable.onDisputableActionRejected.selector ^
42+
iDisputable.onDisputableActionVoided.selector ^
43+
iDisputable.getAgreement.selector ^
44+
iDisputable.canChallenge.selector ^
45+
iDisputable.canClose.selector ^
46+
iDisputable.appId.selector;
4447
}
4548

4649
function erc165interfaceID() external pure returns (bytes4) {

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@aragon/os",
3-
"version": "5.0.0-beta.0",
3+
"version": "5.0.0-beta.1",
44
"description": "Core contracts for Aragon",
55
"scripts": {
66
"compile": "truffle compile",

test/contracts/apps/disputable/disputable_app.js

+6-4
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ contract('DisputableApp', ([_, owner, agreement, anotherAgreement, someone]) =>
1414
let disputable, disputableBase, dao, acl
1515

1616
const ZERO_ADDRESS = '0x0000000000000000000000000000000000000000'
17+
const DISPUTABLE_INTERFACE = '0x737c65f9'
18+
const ERC165_INTERFACE = '0x01ffc9a7'
1719

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

4244
describe('supportsInterface', () => {
4345
it('supports ERC165', async () => {
44-
assert.isTrue(await disputable.supportsInterface('0x01ffc9a7'), 'does not support ERC165')
46+
assert.isTrue(await disputable.supportsInterface(ERC165_INTERFACE), 'does not support ERC165')
4547

46-
assert.equal(await disputable.ERC165_INTERFACE(), '0x01ffc9a7', 'ERC165 interface ID does not match')
48+
assert.equal(await disputable.ERC165_INTERFACE(), ERC165_INTERFACE, 'ERC165 interface ID does not match')
4749
assert.equal(await disputable.erc165interfaceID(), await disputable.ERC165_INTERFACE(), 'ERC165 interface ID does not match')
4850
})
4951

5052
it('supports IDisputable', async () => {
51-
assert.isTrue(await disputable.supportsInterface('0xef113021'), 'does not support IDisputable')
53+
assert.isTrue(await disputable.supportsInterface(DISPUTABLE_INTERFACE), 'does not support IDisputable')
5254

53-
assert.equal(await disputable.interfaceID(), '0xef113021')
55+
assert.equal(await disputable.interfaceID(), DISPUTABLE_INTERFACE)
5456
assert.equal(await disputable.DISPUTABLE_INTERFACE(), await disputable.interfaceID(), 'IDisputable interface ID does not match')
5557
})
5658

0 commit comments

Comments
 (0)