@@ -84,7 +84,7 @@ contract PublicDataStorage is Initializable, UUPSUpgradeable, OwnableUpgradeable
84
84
mapping (bytes32 => CycleDataInfo) dataInfos;
85
85
86
86
SortedScoreList.List scoreList;
87
- uint256 totalReward ; // 记录这个cycle的总奖励
87
+ uint256 totalAward ; // 记录这个cycle的总奖励
88
88
}
89
89
90
90
struct CycleOutputInfo {
@@ -96,6 +96,7 @@ contract PublicDataStorage is Initializable, UUPSUpgradeable, OwnableUpgradeable
96
96
uint256 _currectCycle;
97
97
mapping (uint256 => CycleInfo) _cycleInfos;
98
98
uint256 _startBlock;
99
+ uint64 _minRankingScore;
99
100
100
101
struct SysConfig {
101
102
uint32 minDepositRatio;
@@ -222,19 +223,19 @@ contract PublicDataStorage is Initializable, UUPSUpgradeable, OwnableUpgradeable
222
223
CycleInfo storage cycleInfo = _cycleInfos[cycleNumber];
223
224
// 如果cycle的reward为0,说明这个周期还没有开始
224
225
// 开始一个周期:从上个周期的奖励中拿20%
225
- if (cycleInfo.totalReward == 0 ) {
226
- uint256 lastCycleReward = _cycleInfos[_currectCycle].totalReward ;
226
+ if (cycleInfo.totalAward == 0 ) {
227
+ uint256 lastCycleReward = _cycleInfos[_currectCycle].totalAward ;
227
228
// 5%作为基金会收入
228
229
uint256 fundationIncome = lastCycleReward * 5 / 100 ;
229
230
gwtToken.transfer (foundationAddress, fundationIncome);
230
231
// 如果上一轮的获奖数据不足32个,剩余的奖金也滚动进此轮奖池
231
232
uint16 remainScore = _getRemainScore (_cycleInfos[_currectCycle].scoreList.length ());
232
233
uint256 remainReward = lastCycleReward * 4 * remainScore / totalRewardScore / 5 ;
233
234
234
- cycleInfo.totalReward = lastCycleReward - (lastCycleReward * 4 / 5 ) - fundationIncome + remainReward;
235
+ cycleInfo.totalAward = lastCycleReward - (lastCycleReward * 4 / 5 ) - fundationIncome + remainReward;
235
236
_currectCycle = cycleNumber;
236
237
237
- emit CycleStart (cycleNumber, cycleInfo.totalReward );
238
+ emit CycleStart (cycleNumber, cycleInfo.totalAward );
238
239
}
239
240
240
241
return cycleInfo;
@@ -243,7 +244,7 @@ contract PublicDataStorage is Initializable, UUPSUpgradeable, OwnableUpgradeable
243
244
244
245
function _addCycleReward (uint256 amount ) private {
245
246
CycleInfo storage cycleInfo = _ensureCurrentCycleStart ();
246
- cycleInfo.totalReward += amount;
247
+ cycleInfo.totalAward += amount;
247
248
}
248
249
249
250
// 计算这些空间对应多少GWT,单位是wei
@@ -307,7 +308,7 @@ contract PublicDataStorage is Initializable, UUPSUpgradeable, OwnableUpgradeable
307
308
}
308
309
309
310
function getCycleInfo (uint256 cycleNumber ) public view returns (CycleOutputInfo memory ) {
310
- return CycleOutputInfo (_cycleInfos[cycleNumber].totalReward , _cycleInfos[cycleNumber].scoreList.getSortedList ());
311
+ return CycleOutputInfo (_cycleInfos[cycleNumber].totalAward , _cycleInfos[cycleNumber].scoreList.getSortedList ());
311
312
}
312
313
313
314
function getPledgeInfo (address supplier ) public view returns (SupplierInfo memory ) {
@@ -585,7 +586,7 @@ contract PublicDataStorage is Initializable, UUPSUpgradeable, OwnableUpgradeable
585
586
require (dataInfo.score > 0 , "already withdraw " );
586
587
587
588
// 计算该得到多少奖励
588
- uint256 totalReward = cycleInfo.totalReward * 8 / 10 ;
589
+ uint256 totalReward = cycleInfo.totalAward * 8 / 10 ;
589
590
590
591
uint8 score = _getRewardScore (scoreListRanking);
591
592
// 如果数据总量不足32,那么多余的奖励沉淀在合约账户中
0 commit comments