@reality.eth/contracts 3.0.1 → 3.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -3
- package/chains/chainid.network.json +7691 -1349
- package/chains/deployments/1/ETH/RealityETH-3.0.json +4 -1
- package/chains/deployments/1/SWISE/RealityETH_ERC20-3.0.json +7 -0
- package/chains/deployments/10/OETH/RealityETH-3.0.json +6 -0
- package/chains/deployments/100/GNO/RealityETH_ERC20-3.0.json +7 -0
- package/chains/deployments/100/SWISE/RealityETH_ERC20-3.0.json +7 -0
- package/chains/deployments/100/XDAI/RealityETH-3.0.json +3 -1
- package/chains/deployments/1337702/ETH/RealityETH-3.0.json +6 -0
- package/chains/deployments/4/ETH/RealityETH-3.0.json +3 -1
- package/chains/deployments/42/ETH/RealityETH-3.0.json +2 -1
- package/chains/deployments/56/DEXE/RealityETH_ERC20-3.0.json +7 -0
- package/chains/deployments/69/OETH/RealityETH-3.0.json +6 -0
- package/chains/deployments/77/XDAI/RealityETH-2.1-rc1.json +1 -3
- package/chains/deployments/777/CTH/RealityETH-3.0.json +6 -0
- package/chains/supported.json +23 -3
- package/development/contracts/Arbitrator.sol +7 -6
- package/development/contracts/BalanceHolder.sol +4 -2
- package/development/contracts/{BalanceHolderERC20.sol → BalanceHolder_ERC20.sol} +3 -2
- package/development/contracts/IArbitrator.sol +4 -7
- package/development/contracts/IArbitratorForeignProxy.sol +12 -0
- package/development/contracts/IBalanceHolder.sol +3 -1
- package/development/contracts/IBalanceHolder_ERC20.sol +11 -0
- package/development/contracts/IERC20.sol +1 -1
- package/development/contracts/IOwned.sol +1 -1
- package/development/contracts/IRealityETH.sol +63 -0
- package/development/contracts/IRealityETH_ERC20.sol +67 -0
- package/development/contracts/Owned.sol +4 -2
- package/development/contracts/RealityETH-3.0.sol +4 -82
- package/development/contracts/RealityETH_ERC20-3.0.sol +3 -3
- package/generated/chains.json +95 -22
- package/generated/contracts.json +89 -7
- package/generated/tokens.json +34 -2
- package/index.js +9 -4
- package/package.json +3 -3
- package/scripts/deploy.js +14 -3
- package/scripts/fetch_and_reformat_chains_json.js +31 -0
- package/scripts/{format_abi.js → format_json.js} +0 -0
- package/scripts/generate_chains_json.js +3 -0
- package/scripts/send_funds.js +52 -0
- package/tokens/CTH.json +7 -0
- package/tokens/DEXE.json +7 -0
- package/tokens/ETH.json +2 -1
- package/tokens/GNO.json +1 -0
- package/tokens/OETH.json +8 -0
- package/tokens/SWISE.json +8 -0
- package/development/contracts/IRealitio.sol +0 -44
- package/development/contracts/MultiSigWallet.sol +0 -391
- package/development/contracts/Realitio.sol +0 -756
- package/development/contracts/RealitioERC20.sol +0 -825
- package/development/contracts/RealitioSafeMath256.sol +0 -36
- package/development/contracts/RealitioSafeMath32.sol +0 -17
- package/development/contracts/Realitio_v2_1.sol +0 -819
- package/development/contracts/SplitterWallet.sol +0 -142
- package/tests/python/test_wallet.py +0 -185
|
@@ -2,5 +2,8 @@
|
|
|
2
2
|
"address": "0x5b7dD1E86623548AF054A4985F7fc8Ccbb554E2c",
|
|
3
3
|
"block": 13194676,
|
|
4
4
|
"notes": null,
|
|
5
|
-
"arbitrators": {
|
|
5
|
+
"arbitrators": {
|
|
6
|
+
"0x728cba71a3723caab33ea416cb46e2cc9215a596": "Kleros (General Court)",
|
|
7
|
+
"0xf72cfd1b34a91a64f9a98537fe63fbab7530adca": "Kleros DAO Governance (Technical Court)"
|
|
8
|
+
}
|
|
6
9
|
}
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
"block": 27103177,
|
|
4
4
|
"notes": null,
|
|
5
5
|
"arbitrators": {
|
|
6
|
-
"
|
|
6
|
+
"0x99489d7bb33539f3d1a401741e56e8f02b9ae0cf": "Kleros (General Court)",
|
|
7
|
+
"0xb9fdd2904cbcc5543F02DB948B2CE59Ef10A950E": "Kleros DAO Governance (Technical Court)"
|
|
7
8
|
}
|
|
8
9
|
}
|
package/chains/supported.json
CHANGED
|
@@ -2,22 +2,30 @@
|
|
|
2
2
|
"1": {
|
|
3
3
|
"hostedRPC": "https://eth-mainnet.alchemyapi.io/v2/c9uS--nIxEOjVjh0AJlNttMaqUXQy8gR",
|
|
4
4
|
"explorerURL": "https://etherscan.io",
|
|
5
|
-
"graphURL": "https://api.thegraph.com/subgraphs/name/realityeth/realityeth"
|
|
5
|
+
"graphURL": "https://api.thegraph.com/subgraphs/name/realityeth/realityeth",
|
|
6
|
+
"network_name": "mainnet"
|
|
6
7
|
},
|
|
7
8
|
"3": {
|
|
8
9
|
"hostedRPC": "https://ropsten.infura.io/tSrhlXUe1sNEO5ZWhpUK",
|
|
9
10
|
"explorerURL": "https://ropsten.etherscan.io",
|
|
10
|
-
"graphURL": "https://api.thegraph.com/subgraphs/name/realityeth/realityeth-ropsten"
|
|
11
|
+
"graphURL": "https://api.thegraph.com/subgraphs/name/realityeth/realityeth-ropsten",
|
|
12
|
+
"network_name": "ropsten"
|
|
11
13
|
},
|
|
12
14
|
"4": {
|
|
13
15
|
"hostedRPC": "https://eth-rinkeby.alchemyapi.io/v2/m2Op-gK2G1RiwtWHr6QB_JH9-ry0A6do",
|
|
14
16
|
"explorerURL": "https://rinkeby.etherscan.io",
|
|
15
|
-
"graphURL": "https://api.thegraph.com/subgraphs/name/realityeth/realityeth-rinkeby"
|
|
17
|
+
"graphURL": "https://api.thegraph.com/subgraphs/name/realityeth/realityeth-rinkeby",
|
|
18
|
+
"network_name": "rinkeby"
|
|
16
19
|
},
|
|
17
20
|
"8": {
|
|
18
21
|
"hostedRPC": "https://rpc.octano.dev",
|
|
19
22
|
"explorerURL": "https://ubqblockexplorer.com/"
|
|
20
23
|
},
|
|
24
|
+
"10": {
|
|
25
|
+
"hostedRPC": "https://mainnet.optimism.io",
|
|
26
|
+
"explorerURL": "https://optimistic.etherscan.io",
|
|
27
|
+
"graphURL": "https://api.thegraph.com/subgraphs/name/realityeth/realityeth-optimism"
|
|
28
|
+
},
|
|
21
29
|
"42": {
|
|
22
30
|
"explorerURL": "https://kovan.etherscan.io",
|
|
23
31
|
"graphURL": "https://api.thegraph.com/subgraphs/name/realityeth/realityeth-kovan"
|
|
@@ -27,6 +35,11 @@
|
|
|
27
35
|
"graphURL": "https://api.thegraph.com/subgraphs/name/realityeth/realityeth-bsc",
|
|
28
36
|
"network_name": "bsc"
|
|
29
37
|
},
|
|
38
|
+
"69": {
|
|
39
|
+
"hostedRPC": "https://kovan.optimism.io",
|
|
40
|
+
"explorerURL": "https://kovan-optimistic.etherscan.io",
|
|
41
|
+
"network_name": "kovan"
|
|
42
|
+
},
|
|
30
43
|
"77": {
|
|
31
44
|
"explorerURL": "https://blockscout.com/poa/sokol",
|
|
32
45
|
"graphURL": "https://api.thegraph.com/subgraphs/name/realityeth/realityeth-sokol",
|
|
@@ -43,6 +56,10 @@
|
|
|
43
56
|
"graphURL": "https://api.thegraph.com/subgraphs/name/realityeth/realityeth-polygon",
|
|
44
57
|
"network_name": "matic"
|
|
45
58
|
},
|
|
59
|
+
"777": {
|
|
60
|
+
"explorerURL": "https://explore.cheapswap.io/",
|
|
61
|
+
"network_name": "cheapeth"
|
|
62
|
+
},
|
|
46
63
|
"43114": {
|
|
47
64
|
"explorerURL": "https://cchain.explorer.avax.network/",
|
|
48
65
|
"graphURL": "https://api.thegraph.com/subgraphs/name/realityeth/realityeth-ava",
|
|
@@ -53,5 +70,8 @@
|
|
|
53
70
|
},
|
|
54
71
|
"421611": {
|
|
55
72
|
"network_name": "arbitrum-rinkeby"
|
|
73
|
+
},
|
|
74
|
+
"1337702": {
|
|
75
|
+
"network_name": "kintsugi"
|
|
56
76
|
}
|
|
57
77
|
}
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
// SPDX-License-Identifier: GPL-3.0-only
|
|
2
2
|
|
|
3
|
-
pragma solidity ^0.8.
|
|
3
|
+
pragma solidity ^0.8.10;
|
|
4
4
|
|
|
5
|
-
import './
|
|
5
|
+
import './IArbitrator.sol';
|
|
6
|
+
import './IRealityETH.sol';
|
|
6
7
|
import './IERC20.sol';
|
|
7
8
|
import './Owned.sol';
|
|
8
9
|
|
|
9
|
-
contract Arbitrator is Owned {
|
|
10
|
+
contract Arbitrator is Owned, IArbitrator {
|
|
10
11
|
|
|
11
|
-
|
|
12
|
+
IRealityETH public realitio;
|
|
12
13
|
|
|
13
14
|
mapping(bytes32 => uint256) public arbitration_bounties;
|
|
14
15
|
|
|
@@ -49,7 +50,7 @@ contract Arbitrator is Owned {
|
|
|
49
50
|
|
|
50
51
|
/// @notice Returns the Realitio contract address - deprecated in favour of realitio()
|
|
51
52
|
function realitycheck()
|
|
52
|
-
external view returns(
|
|
53
|
+
external view returns(IRealityETH) {
|
|
53
54
|
return realitio;
|
|
54
55
|
}
|
|
55
56
|
|
|
@@ -58,7 +59,7 @@ contract Arbitrator is Owned {
|
|
|
58
59
|
function setRealitio(address addr)
|
|
59
60
|
onlyOwner
|
|
60
61
|
public {
|
|
61
|
-
realitio =
|
|
62
|
+
realitio = IRealityETH(addr);
|
|
62
63
|
emit LogSetRealitio(addr);
|
|
63
64
|
}
|
|
64
65
|
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
// SPDX-License-Identifier: GPL-3.0-only
|
|
2
2
|
|
|
3
|
-
pragma solidity ^0.8.
|
|
3
|
+
pragma solidity ^0.8.10;
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
import './IBalanceHolder.sol';
|
|
6
|
+
|
|
7
|
+
contract BalanceHolder is IBalanceHolder {
|
|
6
8
|
|
|
7
9
|
mapping(address => uint256) public balanceOf;
|
|
8
10
|
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
// SPDX-License-Identifier: GPL-3.0-only
|
|
2
2
|
|
|
3
|
-
pragma solidity ^0.8.
|
|
3
|
+
pragma solidity ^0.8.10;
|
|
4
4
|
|
|
5
5
|
import './IERC20.sol';
|
|
6
|
+
import './IBalanceHolder_ERC20.sol';
|
|
6
7
|
|
|
7
|
-
contract
|
|
8
|
+
contract BalanceHolder_ERC20 is IBalanceHolder_ERC20 {
|
|
8
9
|
|
|
9
10
|
IERC20 public token;
|
|
10
11
|
|
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
// SPDX-License-Identifier: GPL-3.0-only
|
|
2
2
|
|
|
3
|
-
pragma solidity ^0.8.
|
|
3
|
+
pragma solidity ^0.8.10;
|
|
4
4
|
|
|
5
|
-
import './
|
|
5
|
+
import './IRealityETH.sol';
|
|
6
6
|
import './IERC20.sol';
|
|
7
7
|
import './IOwned.sol';
|
|
8
8
|
|
|
9
9
|
interface IArbitrator {
|
|
10
10
|
function metadata ( ) external view returns ( string memory );
|
|
11
|
-
function owner ( ) external view returns ( address );
|
|
12
11
|
function arbitration_bounties ( bytes32 ) external view returns ( uint256 );
|
|
13
|
-
function realitio ( ) external view returns (
|
|
14
|
-
function realitycheck ( ) external view returns (
|
|
12
|
+
function realitio ( ) external view returns ( IRealityETH );
|
|
13
|
+
function realitycheck ( ) external view returns ( IRealityETH );
|
|
15
14
|
function setRealitio ( address addr ) external;
|
|
16
15
|
function setDisputeFee ( uint256 fee ) external;
|
|
17
16
|
function setCustomDisputeFee ( bytes32 question_id, uint256 fee ) external;
|
|
@@ -23,6 +22,4 @@ interface IArbitrator {
|
|
|
23
22
|
function withdrawERC20 ( IERC20 _token, address addr ) external;
|
|
24
23
|
function callWithdraw ( ) external;
|
|
25
24
|
function setMetaData ( string memory _metadata ) external;
|
|
26
|
-
function foreignProxy() external returns (address);
|
|
27
|
-
function foreignChainId() external returns (uint256);
|
|
28
25
|
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// SPDX-License-Identifier: GPL-3.0-only
|
|
2
|
+
|
|
3
|
+
pragma solidity ^0.8.10;
|
|
4
|
+
|
|
5
|
+
import './IArbitrator.sol';
|
|
6
|
+
import './IERC20.sol';
|
|
7
|
+
import './IOwned.sol';
|
|
8
|
+
|
|
9
|
+
interface IArbitrator {
|
|
10
|
+
function foreignProxy() external returns (address);
|
|
11
|
+
function foreignChainId() external returns (uint256);
|
|
12
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// SPDX-License-Identifier: GPL-3.0-only
|
|
2
|
+
|
|
3
|
+
pragma solidity ^0.8.10;
|
|
4
|
+
|
|
5
|
+
import './IERC20.sol';
|
|
6
|
+
|
|
7
|
+
interface IBalanceHolder_ERC20 {
|
|
8
|
+
function withdraw ( ) external;
|
|
9
|
+
function balanceOf ( address ) external view returns ( uint256 );
|
|
10
|
+
function token ( ) external view returns ( IERC20 );
|
|
11
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
// SPDX-License-Identifier: GPL-3.0-only
|
|
2
|
+
|
|
3
|
+
pragma solidity ^0.8.10;
|
|
4
|
+
|
|
5
|
+
import './IBalanceHolder.sol';
|
|
6
|
+
|
|
7
|
+
interface IRealityETH is IBalanceHolder {
|
|
8
|
+
event LogAnswerReveal (bytes32 indexed question_id, address indexed user, bytes32 indexed answer_hash, bytes32 answer, uint256 nonce, uint256 bond);
|
|
9
|
+
event LogCancelArbitration (bytes32 indexed question_id);
|
|
10
|
+
event LogClaim (bytes32 indexed question_id, address indexed user, uint256 amount);
|
|
11
|
+
event LogFinalize (bytes32 indexed question_id, bytes32 indexed answer);
|
|
12
|
+
event LogFundAnswerBounty (bytes32 indexed question_id, uint256 bounty_added, uint256 bounty, address indexed user);
|
|
13
|
+
event LogMinimumBond (bytes32 indexed question_id, uint256 min_bond);
|
|
14
|
+
event LogNewAnswer (bytes32 answer, bytes32 indexed question_id, bytes32 history_hash, address indexed user, uint256 bond, uint256 ts, bool is_commitment);
|
|
15
|
+
event LogNewQuestion (bytes32 indexed question_id, address indexed user, uint256 template_id, string question, bytes32 indexed content_hash, address arbitrator, uint32 timeout, uint32 opening_ts, uint256 nonce, uint256 created);
|
|
16
|
+
event LogNewTemplate (uint256 indexed template_id, address indexed user, string question_text);
|
|
17
|
+
event LogNotifyOfArbitrationRequest (bytes32 indexed question_id, address indexed user);
|
|
18
|
+
event LogReopenQuestion (bytes32 indexed question_id, bytes32 indexed reopened_question_id);
|
|
19
|
+
event LogSetQuestionFee (address arbitrator, uint256 amount);
|
|
20
|
+
|
|
21
|
+
function assignWinnerAndSubmitAnswerByArbitrator (bytes32 question_id, bytes32 answer, address payee_if_wrong, bytes32 last_history_hash, bytes32 last_answer_or_commitment_id, address last_answerer) external;
|
|
22
|
+
function cancelArbitration (bytes32 question_id) external;
|
|
23
|
+
function claimMultipleAndWithdrawBalance (bytes32[] calldata question_ids, uint256[] calldata lengths, bytes32[] calldata hist_hashes, address[] calldata addrs, uint256[] calldata bonds, bytes32[] calldata answers) external;
|
|
24
|
+
function claimWinnings (bytes32 question_id, bytes32[] calldata history_hashes, address[] calldata addrs, uint256[] calldata bonds, bytes32[] calldata answers) external;
|
|
25
|
+
function createTemplate (string calldata content) external returns (uint256);
|
|
26
|
+
function notifyOfArbitrationRequest (bytes32 question_id, address requester, uint256 max_previous) external;
|
|
27
|
+
function setQuestionFee (uint256 fee) external;
|
|
28
|
+
function submitAnswerByArbitrator (bytes32 question_id, bytes32 answer, address answerer) external;
|
|
29
|
+
function submitAnswerReveal (bytes32 question_id, bytes32 answer, uint256 nonce, uint256 bond) external;
|
|
30
|
+
function askQuestion (uint256 template_id, string calldata question, address arbitrator, uint32 timeout, uint32 opening_ts, uint256 nonce) external payable returns (bytes32);
|
|
31
|
+
function askQuestionWithMinBond (uint256 template_id, string calldata question, address arbitrator, uint32 timeout, uint32 opening_ts, uint256 nonce, uint256 min_bond) external payable returns (bytes32);
|
|
32
|
+
function createTemplateAndAskQuestion (string calldata content, string calldata question, address arbitrator, uint32 timeout, uint32 opening_ts, uint256 nonce) external payable returns (bytes32);
|
|
33
|
+
function fundAnswerBounty (bytes32 question_id) external payable;
|
|
34
|
+
function reopenQuestion (uint256 template_id, string calldata question, address arbitrator, uint32 timeout, uint32 opening_ts, uint256 nonce, uint256 min_bond, bytes32 reopens_question_id) external payable returns (bytes32);
|
|
35
|
+
function submitAnswer (bytes32 question_id, bytes32 answer, uint256 max_previous) external payable;
|
|
36
|
+
function submitAnswerCommitment (bytes32 question_id, bytes32 answer_hash, uint256 max_previous, address _answerer) external payable;
|
|
37
|
+
function submitAnswerFor (bytes32 question_id, bytes32 answer, uint256 max_previous, address answerer) external payable;
|
|
38
|
+
function arbitrator_question_fees (address) external view returns (uint256);
|
|
39
|
+
function commitments (bytes32) external view returns (uint32 reveal_ts, bool is_revealed, bytes32 revealed_answer);
|
|
40
|
+
function getArbitrator (bytes32 question_id) external view returns (address);
|
|
41
|
+
function getBestAnswer (bytes32 question_id) external view returns (bytes32);
|
|
42
|
+
function getBond (bytes32 question_id) external view returns (uint256);
|
|
43
|
+
function getBounty (bytes32 question_id) external view returns (uint256);
|
|
44
|
+
function getContentHash (bytes32 question_id) external view returns (bytes32);
|
|
45
|
+
function getFinalAnswer (bytes32 question_id) external view returns (bytes32);
|
|
46
|
+
function getFinalAnswerIfMatches (bytes32 question_id, bytes32 content_hash, address arbitrator, uint32 min_timeout, uint256 min_bond) external view returns (bytes32);
|
|
47
|
+
function getFinalizeTS (bytes32 question_id) external view returns (uint32);
|
|
48
|
+
function getHistoryHash (bytes32 question_id) external view returns (bytes32);
|
|
49
|
+
function getMinBond (bytes32 question_id) external view returns (uint256);
|
|
50
|
+
function getOpeningTS (bytes32 question_id) external view returns (uint32);
|
|
51
|
+
function getTimeout (bytes32 question_id) external view returns (uint32);
|
|
52
|
+
function isFinalized (bytes32 question_id) external view returns (bool);
|
|
53
|
+
function isPendingArbitration (bytes32 question_id) external view returns (bool);
|
|
54
|
+
function isSettledTooSoon (bytes32 question_id) external view returns (bool);
|
|
55
|
+
function question_claims (bytes32) external view returns (address payee, uint256 last_bond, uint256 queued_funds);
|
|
56
|
+
function questions (bytes32) external view returns (bytes32 content_hash, address arbitrator, uint32 opening_ts, uint32 timeout, uint32 finalize_ts, bool is_pending_arbitration, uint256 bounty, bytes32 best_answer, bytes32 history_hash, uint256 bond, uint256 min_bond);
|
|
57
|
+
function reopened_questions (bytes32) external view returns (bytes32);
|
|
58
|
+
function reopener_questions (bytes32) external view returns (bool);
|
|
59
|
+
function resultFor (bytes32 question_id) external view returns (bytes32);
|
|
60
|
+
function resultForOnceSettled (bytes32 question_id) external view returns (bytes32);
|
|
61
|
+
function template_hashes (uint256) external view returns (bytes32);
|
|
62
|
+
function templates (uint256) external view returns (uint256);
|
|
63
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
// SPDX-License-Identifier: GPL-3.0-only
|
|
2
|
+
|
|
3
|
+
pragma solidity ^0.8.10;
|
|
4
|
+
|
|
5
|
+
import './IBalanceHolder_ERC20.sol';
|
|
6
|
+
|
|
7
|
+
interface IRealityETH_ERC20 is IBalanceHolder_ERC20 {
|
|
8
|
+
event LogAnswerReveal (bytes32 indexed question_id, address indexed user, bytes32 indexed answer_hash, bytes32 answer, uint256 nonce, uint256 bond);
|
|
9
|
+
event LogCancelArbitration (bytes32 indexed question_id);
|
|
10
|
+
event LogClaim (bytes32 indexed question_id, address indexed user, uint256 amount);
|
|
11
|
+
event LogFinalize (bytes32 indexed question_id, bytes32 indexed answer);
|
|
12
|
+
event LogFundAnswerBounty (bytes32 indexed question_id, uint256 bounty_added, uint256 bounty, address indexed user);
|
|
13
|
+
event LogMinimumBond (bytes32 indexed question_id, uint256 min_bond);
|
|
14
|
+
event LogNewAnswer (bytes32 answer, bytes32 indexed question_id, bytes32 history_hash, address indexed user, uint256 bond, uint256 ts, bool is_commitment);
|
|
15
|
+
event LogNewQuestion (bytes32 indexed question_id, address indexed user, uint256 template_id, string question, bytes32 indexed content_hash, address arbitrator, uint32 timeout, uint32 opening_ts, uint256 nonce, uint256 created);
|
|
16
|
+
event LogNewTemplate (uint256 indexed template_id, address indexed user, string question_text);
|
|
17
|
+
event LogNotifyOfArbitrationRequest (bytes32 indexed question_id, address indexed user);
|
|
18
|
+
event LogReopenQuestion (bytes32 indexed question_id, bytes32 indexed reopened_question_id);
|
|
19
|
+
event LogSetQuestionFee (address arbitrator, uint256 amount);
|
|
20
|
+
|
|
21
|
+
function askQuestion (uint256 template_id, string calldata question, address arbitrator, uint32 timeout, uint32 opening_ts, uint256 nonce) external returns (bytes32);
|
|
22
|
+
function askQuestionERC20 (uint256 template_id, string calldata question, address arbitrator, uint32 timeout, uint32 opening_ts, uint256 nonce, uint256 tokens) external returns (bytes32);
|
|
23
|
+
function askQuestionWithMinBondERC20 (uint256 template_id, string calldata question, address arbitrator, uint32 timeout, uint32 opening_ts, uint256 nonce, uint256 min_bond, uint256 tokens) external returns (bytes32);
|
|
24
|
+
function assignWinnerAndSubmitAnswerByArbitrator (bytes32 question_id, bytes32 answer, address payee_if_wrong, bytes32 last_history_hash, bytes32 last_answer_or_commitment_id, address last_answerer) external;
|
|
25
|
+
function cancelArbitration (bytes32 question_id) external;
|
|
26
|
+
function claimMultipleAndWithdrawBalance (bytes32[] calldata question_ids, uint256[] calldata lengths, bytes32[] calldata hist_hashes, address[] calldata addrs, uint256[] calldata bonds, bytes32[] calldata answers) external;
|
|
27
|
+
function claimWinnings (bytes32 question_id, bytes32[] calldata history_hashes, address[] calldata addrs, uint256[] calldata bonds, bytes32[] calldata answers) external;
|
|
28
|
+
function createTemplate (string calldata content) external returns (uint256);
|
|
29
|
+
function createTemplateAndAskQuestion (string calldata content, string calldata question, address arbitrator, uint32 timeout, uint32 opening_ts, uint256 nonce) external returns (bytes32);
|
|
30
|
+
function fundAnswerBountyERC20 (bytes32 question_id, uint256 tokens) external;
|
|
31
|
+
function notifyOfArbitrationRequest (bytes32 question_id, address requester, uint256 max_previous) external;
|
|
32
|
+
function reopenQuestionERC20 (uint256 template_id, string calldata question, address arbitrator, uint32 timeout, uint32 opening_ts, uint256 nonce, uint256 min_bond, bytes32 reopens_question_id, uint256 tokens) external returns (bytes32);
|
|
33
|
+
function setQuestionFee (uint256 fee) external;
|
|
34
|
+
function setToken (address _token) external;
|
|
35
|
+
function submitAnswerByArbitrator (bytes32 question_id, bytes32 answer, address answerer) external;
|
|
36
|
+
function submitAnswerCommitmentERC20 (bytes32 question_id, bytes32 answer_hash, uint256 max_previous, address _answerer, uint256 tokens) external;
|
|
37
|
+
function submitAnswerERC20 (bytes32 question_id, bytes32 answer, uint256 max_previous, uint256 tokens) external;
|
|
38
|
+
function submitAnswerForERC20 (bytes32 question_id, bytes32 answer, uint256 max_previous, address answerer, uint256 tokens) external;
|
|
39
|
+
function submitAnswerReveal (bytes32 question_id, bytes32 answer, uint256 nonce, uint256 bond) external;
|
|
40
|
+
function arbitrator_question_fees (address) external view returns (uint256);
|
|
41
|
+
function commitments (bytes32) external view returns (uint32 reveal_ts, bool is_revealed, bytes32 revealed_answer);
|
|
42
|
+
function getArbitrator (bytes32 question_id) external view returns (address);
|
|
43
|
+
function getBestAnswer (bytes32 question_id) external view returns (bytes32);
|
|
44
|
+
function getBond (bytes32 question_id) external view returns (uint256);
|
|
45
|
+
function getBounty (bytes32 question_id) external view returns (uint256);
|
|
46
|
+
function getContentHash (bytes32 question_id) external view returns (bytes32);
|
|
47
|
+
function getFinalAnswer (bytes32 question_id) external view returns (bytes32);
|
|
48
|
+
function getFinalAnswerIfMatches (bytes32 question_id, bytes32 content_hash, address arbitrator, uint32 min_timeout, uint256 min_bond) external view returns (bytes32);
|
|
49
|
+
function getFinalizeTS (bytes32 question_id) external view returns (uint32);
|
|
50
|
+
function getHistoryHash (bytes32 question_id) external view returns (bytes32);
|
|
51
|
+
function getMinBond (bytes32 question_id) external view returns (uint256);
|
|
52
|
+
function getOpeningTS (bytes32 question_id) external view returns (uint32);
|
|
53
|
+
function getTimeout (bytes32 question_id) external view returns (uint32);
|
|
54
|
+
function isFinalized (bytes32 question_id) external view returns (bool);
|
|
55
|
+
function isPendingArbitration (bytes32 question_id) external view returns (bool);
|
|
56
|
+
function isSettledTooSoon (bytes32 question_id) external view returns (bool);
|
|
57
|
+
function question_claims (bytes32) external view returns (address payee, uint256 last_bond, uint256 queued_funds);
|
|
58
|
+
function questions (bytes32) external view returns (bytes32 content_hash, address arbitrator, uint32 opening_ts, uint32 timeout, uint32 finalize_ts, bool is_pending_arbitration, uint256 bounty, bytes32 best_answer, bytes32 history_hash, uint256 bond, uint256 min_bond);
|
|
59
|
+
function reopened_questions (bytes32) external view returns (bytes32);
|
|
60
|
+
function reopener_questions (bytes32) external view returns (bool);
|
|
61
|
+
function resultFor (bytes32 question_id) external view returns (bytes32);
|
|
62
|
+
function resultForOnceSettled (bytes32 question_id) external view returns (bytes32);
|
|
63
|
+
function template_hashes (uint256) external view returns (bytes32);
|
|
64
|
+
function templates (uint256) external view returns (uint256);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
// SPDX-License-Identifier: GPL-3.0-only
|
|
2
2
|
|
|
3
|
-
pragma solidity ^0.8.
|
|
3
|
+
pragma solidity ^0.8.10;
|
|
4
|
+
|
|
5
|
+
import './IRealityETH.sol';
|
|
4
6
|
|
|
5
7
|
import './BalanceHolder.sol';
|
|
6
8
|
|
|
7
|
-
contract RealityETH_v3_0 is BalanceHolder {
|
|
9
|
+
contract RealityETH_v3_0 is BalanceHolder, IRealityETH {
|
|
8
10
|
|
|
9
11
|
address constant NULL_ADDRESS = address(0);
|
|
10
12
|
|
|
@@ -27,86 +29,6 @@ contract RealityETH_v3_0 is BalanceHolder {
|
|
|
27
29
|
// bytes32(-2). By convention we use bytes32(-1) for "invalid", although the contract does not handle this.
|
|
28
30
|
bytes32 constant UNRESOLVED_ANSWER = 0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe;
|
|
29
31
|
|
|
30
|
-
event LogSetQuestionFee(
|
|
31
|
-
address arbitrator,
|
|
32
|
-
uint256 amount
|
|
33
|
-
);
|
|
34
|
-
|
|
35
|
-
event LogNewTemplate(
|
|
36
|
-
uint256 indexed template_id,
|
|
37
|
-
address indexed user,
|
|
38
|
-
string question_text
|
|
39
|
-
);
|
|
40
|
-
|
|
41
|
-
event LogNewQuestion(
|
|
42
|
-
bytes32 indexed question_id,
|
|
43
|
-
address indexed user,
|
|
44
|
-
uint256 template_id,
|
|
45
|
-
string question,
|
|
46
|
-
bytes32 indexed content_hash,
|
|
47
|
-
address arbitrator,
|
|
48
|
-
uint32 timeout,
|
|
49
|
-
uint32 opening_ts,
|
|
50
|
-
uint256 nonce,
|
|
51
|
-
uint256 created
|
|
52
|
-
);
|
|
53
|
-
|
|
54
|
-
event LogMinimumBond(
|
|
55
|
-
bytes32 indexed question_id,
|
|
56
|
-
uint256 min_bond
|
|
57
|
-
);
|
|
58
|
-
|
|
59
|
-
event LogFundAnswerBounty(
|
|
60
|
-
bytes32 indexed question_id,
|
|
61
|
-
uint256 bounty_added,
|
|
62
|
-
uint256 bounty,
|
|
63
|
-
address indexed user
|
|
64
|
-
);
|
|
65
|
-
|
|
66
|
-
event LogNewAnswer(
|
|
67
|
-
bytes32 answer,
|
|
68
|
-
bytes32 indexed question_id,
|
|
69
|
-
bytes32 history_hash,
|
|
70
|
-
address indexed user,
|
|
71
|
-
uint256 bond,
|
|
72
|
-
uint256 ts,
|
|
73
|
-
bool is_commitment
|
|
74
|
-
);
|
|
75
|
-
|
|
76
|
-
event LogAnswerReveal(
|
|
77
|
-
bytes32 indexed question_id,
|
|
78
|
-
address indexed user,
|
|
79
|
-
bytes32 indexed answer_hash,
|
|
80
|
-
bytes32 answer,
|
|
81
|
-
uint256 nonce,
|
|
82
|
-
uint256 bond
|
|
83
|
-
);
|
|
84
|
-
|
|
85
|
-
event LogNotifyOfArbitrationRequest(
|
|
86
|
-
bytes32 indexed question_id,
|
|
87
|
-
address indexed user
|
|
88
|
-
);
|
|
89
|
-
|
|
90
|
-
event LogCancelArbitration(
|
|
91
|
-
bytes32 indexed question_id
|
|
92
|
-
);
|
|
93
|
-
|
|
94
|
-
event LogFinalize(
|
|
95
|
-
bytes32 indexed question_id,
|
|
96
|
-
bytes32 indexed answer
|
|
97
|
-
);
|
|
98
|
-
|
|
99
|
-
event LogClaim(
|
|
100
|
-
bytes32 indexed question_id,
|
|
101
|
-
address indexed user,
|
|
102
|
-
uint256 amount
|
|
103
|
-
);
|
|
104
|
-
|
|
105
|
-
event LogReopenQuestion(
|
|
106
|
-
bytes32 indexed question_id,
|
|
107
|
-
bytes32 indexed reopened_question_id
|
|
108
|
-
);
|
|
109
|
-
|
|
110
32
|
struct Question {
|
|
111
33
|
bytes32 content_hash;
|
|
112
34
|
address arbitrator;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
// SPDX-License-Identifier: GPL-3.0-only
|
|
2
2
|
|
|
3
|
-
pragma solidity ^0.8.
|
|
3
|
+
pragma solidity ^0.8.10;
|
|
4
4
|
|
|
5
|
-
import './
|
|
5
|
+
import './BalanceHolder_ERC20.sol';
|
|
6
6
|
|
|
7
|
-
contract RealityETH_ERC20_v3_0 is
|
|
7
|
+
contract RealityETH_ERC20_v3_0 is BalanceHolder_ERC20 {
|
|
8
8
|
|
|
9
9
|
address constant NULL_ADDRESS = address(0);
|
|
10
10
|
|