Skip to content

Commit

Permalink
Remove unnecessary field from SFCState
Browse files Browse the repository at this point in the history
  • Loading branch information
thaarok committed Oct 24, 2024
1 parent 2a8fbf0 commit 5fd5442
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 9 deletions.
2 changes: 0 additions & 2 deletions contracts/sfc/SFC.sol
Original file line number Diff line number Diff line change
Expand Up @@ -331,8 +331,6 @@ contract SFC is SFCBase, Version {
}

snapshot.epochFee = ctx.epochFee;
snapshot.totalBaseRewardWeight = ctx.totalBaseRewardWeight;
snapshot.totalTxRewardWeight = ctx.totalTxRewardWeight;
if (totalSupply > snapshot.epochFee) {
totalSupply -= snapshot.epochFee;
} else {
Expand Down
1 change: 0 additions & 1 deletion contracts/sfc/SFCLib.sol
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,6 @@ contract SFCLib is SFCBase {
uint256 penalty = getSlashingPenalty(amount, isCheater, slashingRefundRatio[toValidatorID]);
delete getWithdrawalRequest[delegator][toValidatorID][wrID];

totalSlashedStake += penalty;
if (amount <= penalty) {
revert StakeIsFullySlashed();
}
Expand Down
4 changes: 0 additions & 4 deletions contracts/sfc/SFCState.sol
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@ contract SFCState is Initializable, Ownable {
uint256 public totalStake;
// total stake of active (OK_STATUS) validators (total weight)
uint256 public totalActiveStake;
// sum of penalties subtracted from successful withdrawals - TODO misleading - remove?
uint256 public totalSlashedStake;

// delegator => validator ID => stashed rewards (to be claimed/restaked)
mapping(address => mapping(uint256 => Rewards)) internal _rewardsStash;
Expand Down Expand Up @@ -88,8 +86,6 @@ contract SFCState is Initializable, Ownable {
uint256 endTime;
uint256 endBlock;
uint256 epochFee; // gas fees from txs in the epoch
uint256 totalBaseRewardWeight; // sum( stake * uptimeRatio ^ 2 ) TODO write only - remove?
uint256 totalTxRewardWeight; // sum( originatedTxsFee * uptimeRatio ) TODO write only - remove?
uint256 baseRewardPerSecond; // the base reward to divide among validators for each second of the epoch
uint256 totalStake; // total weight of all validators
uint256 totalSupply; // total supply of native tokens
Expand Down
2 changes: 0 additions & 2 deletions contracts/test/UnitTestSFC.sol
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,6 @@ interface SFCUnitTestI {
uint256 endTime,
uint256 endBlock,
uint256 epochFee,
uint256 totalBaseRewardWeight,
uint256 totalTxRewardWeight,
uint256 _baseRewardPerSecond,
uint256 totalStake,
uint256 totalSupply
Expand Down

0 comments on commit 5fd5442

Please sign in to comment.