Skip to content

Commit 5fd5442

Browse files
committed
Remove unnecessary field from SFCState
1 parent 2a8fbf0 commit 5fd5442

File tree

4 files changed

+0
-9
lines changed

4 files changed

+0
-9
lines changed

contracts/sfc/SFC.sol

-2
Original file line numberDiff line numberDiff line change
@@ -331,8 +331,6 @@ contract SFC is SFCBase, Version {
331331
}
332332

333333
snapshot.epochFee = ctx.epochFee;
334-
snapshot.totalBaseRewardWeight = ctx.totalBaseRewardWeight;
335-
snapshot.totalTxRewardWeight = ctx.totalTxRewardWeight;
336334
if (totalSupply > snapshot.epochFee) {
337335
totalSupply -= snapshot.epochFee;
338336
} else {

contracts/sfc/SFCLib.sol

-1
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,6 @@ contract SFCLib is SFCBase {
316316
uint256 penalty = getSlashingPenalty(amount, isCheater, slashingRefundRatio[toValidatorID]);
317317
delete getWithdrawalRequest[delegator][toValidatorID][wrID];
318318

319-
totalSlashedStake += penalty;
320319
if (amount <= penalty) {
321320
revert StakeIsFullySlashed();
322321
}

contracts/sfc/SFCState.sol

-4
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,6 @@ contract SFCState is Initializable, Ownable {
4040
uint256 public totalStake;
4141
// total stake of active (OK_STATUS) validators (total weight)
4242
uint256 public totalActiveStake;
43-
// sum of penalties subtracted from successful withdrawals - TODO misleading - remove?
44-
uint256 public totalSlashedStake;
4543

4644
// delegator => validator ID => stashed rewards (to be claimed/restaked)
4745
mapping(address => mapping(uint256 => Rewards)) internal _rewardsStash;
@@ -88,8 +86,6 @@ contract SFCState is Initializable, Ownable {
8886
uint256 endTime;
8987
uint256 endBlock;
9088
uint256 epochFee; // gas fees from txs in the epoch
91-
uint256 totalBaseRewardWeight; // sum( stake * uptimeRatio ^ 2 ) TODO write only - remove?
92-
uint256 totalTxRewardWeight; // sum( originatedTxsFee * uptimeRatio ) TODO write only - remove?
9389
uint256 baseRewardPerSecond; // the base reward to divide among validators for each second of the epoch
9490
uint256 totalStake; // total weight of all validators
9591
uint256 totalSupply; // total supply of native tokens

contracts/test/UnitTestSFC.sol

-2
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,6 @@ interface SFCUnitTestI {
125125
uint256 endTime,
126126
uint256 endBlock,
127127
uint256 epochFee,
128-
uint256 totalBaseRewardWeight,
129-
uint256 totalTxRewardWeight,
130128
uint256 _baseRewardPerSecond,
131129
uint256 totalStake,
132130
uint256 totalSupply

0 commit comments

Comments
 (0)