@@ -29,6 +29,8 @@ contract Universe is DelegationTarget, Extractable, ITyped, Initializable, IUniv
29
29
bytes32 private tentativeWinningChildUniversePayoutDistributionHash;
30
30
uint256 private forkEndTime;
31
31
uint256 private forkReputationGoal;
32
+ uint256 private disputeThresholdForFork;
33
+ uint256 private initialReportMinValue;
32
34
mapping (uint256 => IFeeWindow) private feeWindows;
33
35
mapping (address => bool ) private markets;
34
36
mapping (bytes32 => IUniverse) private childUniverses;
@@ -45,6 +47,7 @@ contract Universe is DelegationTarget, Extractable, ITyped, Initializable, IUniv
45
47
parentUniverse = _parentUniverse;
46
48
parentPayoutDistributionHash = _parentPayoutDistributionHash;
47
49
reputationToken = ReputationTokenFactory (controller.lookup ("ReputationTokenFactory " )).createReputationToken (controller, this );
50
+ updateForkValues ();
48
51
require (reputationToken != address (0 ));
49
52
return true ;
50
53
}
@@ -54,18 +57,18 @@ contract Universe is DelegationTarget, Extractable, ITyped, Initializable, IUniv
54
57
require (isContainerForMarket (IMarket (msg .sender )));
55
58
forkingMarket = IMarket (msg .sender );
56
59
forkEndTime = controller.getTimestamp () + Reporting.getForkDurationSeconds ();
57
- // We pre calculate the amount of REP needed to determine a winner early in a fork. We assume maximum possible fork inflation in every fork so this is hard to achieve with every subsequent fork and may become impossible in some universes.
58
- if (parentUniverse != IUniverse (0 )) {
59
- uint256 _previousForkReputationGoal = parentUniverse.getForkReputationGoal ();
60
- forkReputationGoal = _previousForkReputationGoal + (_previousForkReputationGoal / Reporting.getForkMigrationPercentageBonusDivisor ());
61
- } else {
62
- // We're using a hardcoded supply value instead of getting the total REP supply from the token since at launch we will start out with a 0 supply token and users will migrate legacy REP to this token. Since the first fork may occur before all REP migrates we want to count that unmigrated REP too since it may participate in the fork eventually.
63
- forkReputationGoal = Reporting.getInitialREPSupply () / Reporting.getForkRepMigrationVictoryDivisor ();
64
- }
65
60
controller.getAugur ().logUniverseForked ();
66
61
return true ;
67
62
}
68
63
64
+ function updateForkValues () public returns (bool ) {
65
+ uint256 _totalRepSupply = reputationToken.getTotalTheoreticalSupply ();
66
+ forkReputationGoal = _totalRepSupply.div (2 ); // 50% of REP migrating results in a victory in a fork
67
+ disputeThresholdForFork = _totalRepSupply.div (80 ); // 1.25% of the total rep supply
68
+ initialReportMinValue = disputeThresholdForFork.div (3 ).div (2 ** 18 ) + 1 ; // This value will result in a maximum 20 round dispute sequence
69
+ return true ;
70
+ }
71
+
69
72
function getTypeName () public view returns (bytes32 ) {
70
73
return "Universe " ;
71
74
}
@@ -94,6 +97,14 @@ contract Universe is DelegationTarget, Extractable, ITyped, Initializable, IUniv
94
97
return forkReputationGoal;
95
98
}
96
99
100
+ function getDisputeThresholdForFork () public view returns (uint256 ) {
101
+ return disputeThresholdForFork;
102
+ }
103
+
104
+ function getInitialReportMinValue () public view returns (uint256 ) {
105
+ return initialReportMinValue;
106
+ }
107
+
97
108
function getFeeWindow (uint256 _feeWindowId ) public view returns (IFeeWindow) {
98
109
return feeWindows[_feeWindowId];
99
110
}
@@ -319,7 +330,7 @@ contract Universe is DelegationTarget, Extractable, ITyped, Initializable, IUniv
319
330
uint256 _incorrectDesignatedReportMarketsInPreviousWindow = _previousFeeWindow.getNumIncorrectDesignatedReportMarkets ();
320
331
uint256 _previousDesignatedReportStakeInAttoRep = designatedReportStakeInAttoRep[_previousFeeWindow];
321
332
322
- _currentDesignatedReportStakeInAttoRep = calculateFloatingValue (_incorrectDesignatedReportMarketsInPreviousWindow, _totalMarketsInPreviousWindow, Reporting.getTargetIncorrectDesignatedReportMarketsDivisor (), _previousDesignatedReportStakeInAttoRep, Reporting. getDefaultDesignatedReportStake (), Reporting. getDesignatedReportStakeFloor () );
333
+ _currentDesignatedReportStakeInAttoRep = calculateFloatingValue (_incorrectDesignatedReportMarketsInPreviousWindow, _totalMarketsInPreviousWindow, Reporting.getTargetIncorrectDesignatedReportMarketsDivisor (), _previousDesignatedReportStakeInAttoRep, initialReportMinValue, initialReportMinValue );
323
334
designatedReportStakeInAttoRep[_feeWindow] = _currentDesignatedReportStakeInAttoRep;
324
335
return _currentDesignatedReportStakeInAttoRep;
325
336
}
@@ -335,7 +346,7 @@ contract Universe is DelegationTarget, Extractable, ITyped, Initializable, IUniv
335
346
uint256 _designatedReportNoShowsInPreviousWindow = _previousFeeWindow.getNumDesignatedReportNoShows ();
336
347
uint256 _previousDesignatedReportNoShowBondInAttoRep = designatedReportNoShowBondInAttoRep[_previousFeeWindow];
337
348
338
- _currentDesignatedReportNoShowBondInAttoRep = calculateFloatingValue (_designatedReportNoShowsInPreviousWindow, _totalMarketsInPreviousWindow, Reporting.getTargetDesignatedReportNoShowsDivisor (), _previousDesignatedReportNoShowBondInAttoRep, Reporting. getDefaultDesignatedReportNoShowBond (), Reporting. getDesignatedReportNoShowBondFloor () );
349
+ _currentDesignatedReportNoShowBondInAttoRep = calculateFloatingValue (_designatedReportNoShowsInPreviousWindow, _totalMarketsInPreviousWindow, Reporting.getTargetDesignatedReportNoShowsDivisor (), _previousDesignatedReportNoShowBondInAttoRep, initialReportMinValue, initialReportMinValue );
339
350
designatedReportNoShowBondInAttoRep[_feeWindow] = _currentDesignatedReportNoShowBondInAttoRep;
340
351
return _currentDesignatedReportNoShowBondInAttoRep;
341
352
}
0 commit comments