@@ -9,6 +9,7 @@ import DisputeTimeline from "components/disputeTimeline";
99import EvidenceTimeline from "components/evidenceTimeline" ;
1010import CrowdfundingCard from "components/crowdfundingCard" ;
1111import { ethers } from "ethers" ;
12+ import networkMap from "../ethereum/network-contract-mapping" ;
1213
1314import AlertMessage from "components/alertMessage" ;
1415
@@ -66,6 +67,11 @@ class DisputeDetails extends React.Component {
6667
6768 const { currentRuling, appealCost, multipliers, exceptionalContractAddresses, arbitrated } = this . props ;
6869
70+ //Means it is an EscrowV1 dispute, for which there are no calculations needed
71+ if ( networkMap [ this . props . network ] . ESCROW_V1_CONTRACTS . includes ( arbitrated ) ) {
72+ return appealCost ;
73+ }
74+
6975 let stake ;
7076
7177 if ( currentRuling == rulingOption || ( exceptionalContractAddresses . includes ( arbitrated ) && currentRuling == 0 ) ) {
@@ -373,6 +379,21 @@ class DisputeDetails extends React.Component {
373379 </ Card . Body >
374380 ) ;
375381
382+ renderEscrowV1AppealSection = ( disputePeriod , appealCallback , appealCost ) => (
383+ < Card . Body >
384+ < div className = "h1" > { disputePeriod == DISPUTE_PERIOD_APPEAL ? "Appeal the decision" : "Appeal period ended" } </ div >
385+ { disputePeriod == DISPUTE_PERIOD_APPEAL && < p className = "label" > In order to appeal the decision, you need to pay the appeal cost.</ p > }
386+ { disputePeriod == DISPUTE_PERIOD_APPEAL && (
387+ < Button
388+ onClick = { ( ) =>
389+ appealCallback ( 0 , ethers . formatEther ( appealCost ) )
390+ } >
391+ Appeal - { ethers . formatEther ( appealCost ) } ETH
392+ </ Button >
393+ ) }
394+ </ Card . Body >
395+ ) ;
396+
376397 // Helper method to render question section
377398 renderQuestionSection = ( metaevidenceJSON , arbitratorDisputeID ) => (
378399 < Card . Body className = { styles . question } >
@@ -444,7 +465,7 @@ class DisputeDetails extends React.Component {
444465 } ;
445466
446467 // Helper method to render appeal card conditionally
447- renderAppealCard = ( arbitratorDispute , disputePeriod , contributions , multipliers , appealCost , appealPeriod , arbitrated , totalWithdrawable , metaevidenceJSON , currentRuling , appealCallback , exceptionalContractAddresses , activeKey ) => {
468+ renderAppealCard = ( arbitratorDispute , disputePeriod , contributions , multipliers , appealCost , appealPeriod , arbitrated , totalWithdrawable , metaevidenceJSON , currentRuling , appealCallback , exceptionalContractAddresses , activeKey , isEscrowV1Dispute ) => {
448469 if ( ! arbitratorDispute || disputePeriod < DISPUTE_PERIOD_APPEAL || ! contributions || ! multipliers || ! appealCost || ! appealPeriod || ! arbitrated ) {
449470 return null ;
450471 }
@@ -455,7 +476,9 @@ class DisputeDetails extends React.Component {
455476 Appeal
456477 </ Accordion . Toggle >
457478 < Accordion . Collapse eventKey = "1" >
458- { this . renderAppealSection ( disputePeriod , totalWithdrawable , metaevidenceJSON , currentRuling , contributions , appealCallback , exceptionalContractAddresses , arbitrated ) }
479+ { isEscrowV1Dispute ?
480+ this . renderEscrowV1AppealSection ( disputePeriod , appealCallback , appealCost )
481+ : this . renderAppealSection ( disputePeriod , totalWithdrawable , metaevidenceJSON , currentRuling , contributions , appealCallback , exceptionalContractAddresses , arbitrated ) }
459482 </ Accordion . Collapse >
460483 </ Card >
461484 ) ;
@@ -557,7 +580,7 @@ class DisputeDetails extends React.Component {
557580 // Try to use Reality.eth parsed outcomes if available
558581 const realityOutcomes = this . findRealityOutcomes ( metaevidenceJSON ) ;
559582 const fallbackTitles = realityOutcomes || [ "Yes" , "No" ] ; // Basic fallback for Reality.eth questions
560-
583+
561584 fallbackTitles . forEach ( ( title , index ) => {
562585 cards . push (
563586 < Col key = { `fallback-${ index + 1 } ` } className = "pb-4" xl = { 8 } lg = { 12 } xs = { 24 } >
@@ -672,6 +695,7 @@ class DisputeDetails extends React.Component {
672695 render ( ) {
673696 const {
674697 arbitrated,
698+ network,
675699 metaevidenceJSON,
676700 evidences,
677701 arbitratorDisputeID,
@@ -702,6 +726,7 @@ class DisputeDetails extends React.Component {
702726 }
703727
704728 const disputePeriod = parseInt ( arbitratorDispute . period , 10 ) ;
729+ const isEscrowV1Dispute = networkMap [ network ] . ESCROW_V1_CONTRACTS . includes ( arbitrated ) ;
705730
706731 return (
707732 < section className = { styles . disputeDetails } >
@@ -720,7 +745,7 @@ class DisputeDetails extends React.Component {
720745 className = { `mt-4 ${ styles . accordion } ` }
721746 onSelect = { this . handleAccordionSelect }
722747 >
723- { this . renderAppealCard ( arbitratorDispute , disputePeriod , contributions , multipliers , appealCost , appealPeriod , arbitrated , totalWithdrawable , metaevidenceJSON , currentRuling , appealCallback , exceptionalContractAddresses , activeKey ) }
748+ { this . renderAppealCard ( arbitratorDispute , disputePeriod , contributions , multipliers , appealCost , appealPeriod , arbitrated , totalWithdrawable , metaevidenceJSON , currentRuling , appealCallback , exceptionalContractAddresses , activeKey , isEscrowV1Dispute ) }
724749
725750 < Card >
726751 < Accordion . Toggle className = { activeKey == 2 ? "open" : "closed" } as = { Card . Header } eventKey = "2" >
0 commit comments