Skip to content

Commit

Permalink
Remove the copy-pasted reality.eth fork of reality.eth v3, replace it…
Browse files Browse the repository at this point in the history
… with reality.eth v4 via npm
  • Loading branch information
edmundedgar committed Mar 6, 2024
1 parent f5e967b commit 1697fbd
Show file tree
Hide file tree
Showing 24 changed files with 65 additions and 2,664 deletions.
29 changes: 18 additions & 11 deletions contracts/AdjudicationFramework/MinimalAdjudicationFramework.sol
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ pragma solidity ^0.8.20;
/* solhint-disable quotes */
/* solhint-disable not-rely-on-time */

import {IRealityETH} from "./../lib/reality-eth/interfaces/IRealityETH.sol";
import {IRealityETH} from "@reality.eth/contracts/development/contracts/IRealityETH.sol";
import {IRealityETHHistoryVerification} from "@reality.eth/contracts/development/contracts/IRealityETHHistoryVerification.sol";
import {Strings} from "@openzeppelin/contracts/utils/Strings.sol";
import {EnumerableSet} from "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";
import {IMinimalAdjudicationFramework} from "./interface/IMinimalAdjudicationFramework.sol";
Expand All @@ -27,6 +28,8 @@ contract MinimalAdjudicationFramework is IMinimalAdjudicationFramework {
error OnlyAllowlistedActor();
/// @dev Error thrown when multiple modifications are requested at once
error NoMultipleModificationsAtOnce();
/// @dev Invalid history supplied for unfinalized question
error InvalidHistorySupplied();

// Iterable list contains list of allowlisted arbitrators
uint256 public constant ARB_DISPUTE_TIMEOUT = 86400;
Expand Down Expand Up @@ -216,20 +219,24 @@ contract MinimalAdjudicationFramework is IMinimalAdjudicationFramework {

bytes32 answer;
uint256 bond;
// Normally you call this right after posting your answer so your final answer will be the current answer
// If someone has since submitted a different answer, you need to pass in the history from now until yours
// Normally you call this right after posting your answer so your final answer will be the current best answer
// If someone has since submitted a different answer, you need to pass in the history from now back to yours
if (historyHashes.length == 0) {
answer = realityETH.getBestAnswer(questionId);
bond = realityETH.getBond(questionId);
} else {
(answer, bond) = realityETH
.getEarliestAnswerFromSuppliedHistoryOrRevert(
questionId,
historyHashes,
addrs,
bonds,
answers
);
if (
!IRealityETHHistoryVerification(address(realityETH))
.isHistoryOfUnfinalizedQuestionValid(
questionId,
historyHashes,
addrs,
bonds,
answers
)
) revert InvalidHistorySupplied();
answer = answers[answers.length - 1];
bond = bonds[bonds.length - 1];
}

if (answer != bytes32(uint256(1))) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ pragma solidity ^0.8.20;
/* solhint-disable quotes */
/* solhint-disable not-rely-on-time */

import {BalanceHolder} from "./../../lib/reality-eth/BalanceHolder.sol";
import {MinimalAdjudicationFramework} from "../MinimalAdjudicationFramework.sol";
import {EnumerableSet} from "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";
import {BalanceHolder} from "@reality.eth/contracts/development/contracts/BalanceHolder.sol";

/*
This contract sits between a Reality.eth instance and an Arbitrator.
Expand Down
2 changes: 1 addition & 1 deletion contracts/L2ForkArbitrator.sol
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ pragma solidity ^0.8.20;
/* solhint-disable var-name-mixedcase */
import {L2ChainInfo} from "./L2ChainInfo.sol";
import {L1GlobalForkRequester} from "./L1GlobalForkRequester.sol";
import {IRealityETH} from "./lib/reality-eth/interfaces/IRealityETH.sol";
import {IRealityETH} from "@reality.eth/contracts/development/contracts/IRealityETH.sol";
import {CalculateMoneyBoxAddress} from "./lib/CalculateMoneyBoxAddress.sol";

import {IPolygonZkEVMBridge} from "@RealityETH/zkevm-contracts/contracts/interfaces/IPolygonZkEVMBridge.sol";
Expand Down
206 changes: 0 additions & 206 deletions contracts/lib/reality-eth/Arbitrator.sol

This file was deleted.

18 changes: 0 additions & 18 deletions contracts/lib/reality-eth/BalanceHolder.sol

This file was deleted.

23 changes: 0 additions & 23 deletions contracts/lib/reality-eth/BalanceHolder_ERC20.sol

This file was deleted.

20 changes: 0 additions & 20 deletions contracts/lib/reality-eth/Owned.sol

This file was deleted.

Loading

0 comments on commit 1697fbd

Please sign in to comment.