From 7e8549fded285060eb9186bd333a2860045df2b6 Mon Sep 17 00:00:00 2001 From: Edmund Edgar Date: Fri, 8 Mar 2024 05:31:10 +0000 Subject: [PATCH] Use IArbitratorCore interface. Fix missing metadata, spurious log event, move pull-only function out of minimal parent contract. Fixes #83 --- .../MinimalAdjudicationFramework.sol | 4 --- .../Pull/AdjudicationFrameworkRequests.sol | 25 ++++++++----------- .../IMinimalAdjudicationFramework.sol | 2 -- 3 files changed, 11 insertions(+), 20 deletions(-) diff --git a/contracts/AdjudicationFramework/MinimalAdjudicationFramework.sol b/contracts/AdjudicationFramework/MinimalAdjudicationFramework.sol index 3f09fbaa..30940379 100644 --- a/contracts/AdjudicationFramework/MinimalAdjudicationFramework.sol +++ b/contracts/AdjudicationFramework/MinimalAdjudicationFramework.sol @@ -275,10 +275,6 @@ contract MinimalAdjudicationFramework is IMinimalAdjudicationFramework { // Getter functions only below here - function realitio() external view returns (address) { - return address(realityETH); - } - function isArbitrator(address arbitrator) external view returns (bool) { return _arbitrators.contains(arbitrator); } diff --git a/contracts/AdjudicationFramework/Pull/AdjudicationFrameworkRequests.sol b/contracts/AdjudicationFramework/Pull/AdjudicationFrameworkRequests.sol index 9b11d6da..3c390cb0 100644 --- a/contracts/AdjudicationFramework/Pull/AdjudicationFrameworkRequests.sol +++ b/contracts/AdjudicationFramework/Pull/AdjudicationFrameworkRequests.sol @@ -9,6 +9,8 @@ pragma solidity ^0.8.20; import {MinimalAdjudicationFramework} from "../MinimalAdjudicationFramework.sol"; import {EnumerableSet} from "@openzeppelin/contracts/utils/structs/EnumerableSet.sol"; import {BalanceHolder} from "@reality.eth/contracts/development/contracts/BalanceHolder.sol"; +import {IRealityETH} from "@reality.eth/contracts/development/contracts/IRealityETH.sol"; +import {IArbitratorCore} from "@reality.eth/contracts/development/contracts/IArbitratorCore.sol"; /* This contract sits between a Reality.eth instance and an Arbitrator. @@ -20,6 +22,7 @@ To the normal Arbitrator contracts that does its arbitration jobs, it looks like */ contract AdjudicationFrameworkRequests is + IArbitratorCore, MinimalAdjudicationFramework, BalanceHolder { @@ -55,18 +58,6 @@ contract AdjudicationFrameworkRequests is /// @dev Error thrown when too soon to cancel error TooSoonToCancel(); - event LogRequestArbitration( - bytes32 indexed questionId, - uint256 feePaid, - address requester, - uint256 remaining - ); - - event LogNotifyOfArbitrationRequest( - bytes32 indexed questionId, - address indexed user - ); - uint256 public dispute_fee; struct ArbitrationRequest { @@ -80,6 +71,10 @@ contract AdjudicationFrameworkRequests is mapping(bytes32 => ArbitrationRequest) public questionArbitrations; + // Metadata for anything the UI needs to know. + // TODO: Add a "tos" parameter pointing to a document that explains the adjudication principles, see #256 + string public metadata = "{}"; + /// @param _realityETH The reality.eth instance we adjudicate for /// @param _disputeFee The dispute fee we charge reality.eth users /// @param _forkArbitrator The arbitrator contract that escalates to an L1 fork, used for our governance @@ -180,8 +175,6 @@ contract AdjudicationFrameworkRequests is questionArbitrations[questionId].payer = requester; questionArbitrations[questionId].arbitrator = msg.sender; - - emit LogNotifyOfArbitrationRequest(questionId, requester); } /// @notice Clear the arbitrator setting of an arbitrator that has been delisted @@ -297,4 +290,8 @@ contract AdjudicationFrameworkRequests is realityETH.submitAnswerByArbitrator(questionId, answer, answerer); } + + function realitio() external view returns (IRealityETH) { + return realityETH; + } } diff --git a/contracts/AdjudicationFramework/interface/IMinimalAdjudicationFramework.sol b/contracts/AdjudicationFramework/interface/IMinimalAdjudicationFramework.sol index f727ad7e..687b1c90 100644 --- a/contracts/AdjudicationFramework/interface/IMinimalAdjudicationFramework.sol +++ b/contracts/AdjudicationFramework/interface/IMinimalAdjudicationFramework.sol @@ -37,8 +37,6 @@ interface IMinimalAdjudicationFramework is IMinimalAdjudicationFrameworkErrors { // Getter functions only below here - function realitio() external view returns (address); - function isArbitrator(address arbitrator) external view returns (bool); function isArbitratorPropositionFrozen(