Skip to content

Commit

Permalink
⚡️ staking: drop redundant update
Browse files Browse the repository at this point in the history
  • Loading branch information
itofarina committed Aug 8, 2024
1 parent f6de53b commit 394bd9b
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 25 deletions.
48 changes: 24 additions & 24 deletions .gas-snapshot
Original file line number Diff line number Diff line change
Expand Up @@ -461,19 +461,19 @@ StakedEXATest:invariantNoDuplicatedReward() (runs: 10, calls: 5000, reverts: 0)
StakedEXATest:invariantRewardsUpOnly() (runs: 10, calls: 5000, reverts: 0)
StakedEXATest:invariantShareValueIsOne() (runs: 10, calls: 5000, reverts: 0)
StakedEXATest:testAlreadyListedError() (gas: 41653)
StakedEXATest:testAvgIndex(uint256[3],uint256[2]) (runs: 256, μ: 1215911, ~: 1274346)
StakedEXATest:testAvgStartTime(uint256[3],uint256[2]) (runs: 256, μ: 1202284, ~: 1260719)
StakedEXATest:testAvgIndex(uint256[3],uint256[2]) (runs: 256, μ: 1209470, ~: 1248899)
StakedEXATest:testAvgStartTime(uint256[3],uint256[2]) (runs: 256, μ: 1195843, ~: 1235272)
StakedEXATest:testBalanceOfDeposit(uint80) (runs: 256, μ: 355441, ~: 362487)
StakedEXATest:testBalanceOfWithdraw(uint256) (runs: 256, μ: 60547, ~: 60554)
StakedEXATest:testCanChangeRewardsDurationWhenDisabled() (gas: 168929)
StakedEXATest:testClaimAfterHarvest() (gas: 840855)
StakedEXATest:testClaimAndUnstake() (gas: 1486266)
StakedEXATest:testClaimAndWithdrawAfterRefTime() (gas: 1091264)
StakedEXATest:testClaimBeforeFirstHarvest() (gas: 539902)
StakedEXATest:testDepositEvent(uint256) (runs: 256, μ: 364336, ~: 364035)
StakedEXATest:testDepositShouldClaim(uint256[2],uint32) (runs: 256, μ: 827158, ~: 742160)
StakedEXATest:testDepositWithdrawAvgStartTimeAndIndex(uint256[3],uint256,uint256[5]) (runs: 256, μ: 1751113, ~: 1809540)
StakedEXATest:testEarnedWithTime(uint256) (runs: 256, μ: 35420, ~: 35700)
StakedEXATest:testDepositEvent(uint256) (runs: 256, μ: 364339, ~: 364059)
StakedEXATest:testDepositShouldClaim(uint256[2],uint32) (runs: 256, μ: 827143, ~: 742148)
StakedEXATest:testDepositWithdrawAvgStartTimeAndIndex(uint256[3],uint256,uint256[5]) (runs: 256, μ: 1757469, ~: 1809127)
StakedEXATest:testEarnedWithTime(uint256) (runs: 256, μ: 35422, ~: 35700)
StakedEXATest:testEmergencyAdminCanPauseNotUnpause() (gas: 159083)
StakedEXATest:testFinishDistributionEmitEvent() (gas: 402739)
StakedEXATest:testFinishDistributionLetsClaimUnclaimed() (gas: 1516941)
Expand All @@ -483,9 +483,9 @@ StakedEXATest:testFinishDistributionTransfersRemainingToSavings() (gas: 112203)
StakedEXATest:testGrantRevokeEmergencyAdmin() (gas: 107238)
StakedEXATest:testGrantRevokePauser() (gas: 107257)
StakedEXATest:testHandlerClaim(uint8) (runs: 256, μ: 302723, ~: 302723)
StakedEXATest:testHandlerDeposit(uint80) (runs: 256, μ: 799294, ~: 810106)
StakedEXATest:testHandlerHarvest(uint64) (runs: 256, μ: 333505, ~: 332884)
StakedEXATest:testHandlerNotifyRewardAmount(uint64) (runs: 256, μ: 128491, ~: 124447)
StakedEXATest:testHandlerDeposit(uint80) (runs: 256, μ: 798691, ~: 810106)
StakedEXATest:testHandlerHarvest(uint64) (runs: 256, μ: 333359, ~: 332884)
StakedEXATest:testHandlerNotifyRewardAmount(uint64) (runs: 256, μ: 127277, ~: 123325)
StakedEXATest:testHandlerSetDuration(uint32) (runs: 256, μ: 144991, ~: 164510)
StakedEXATest:testHandlerWithdraw(uint256) (runs: 256, μ: 70017, ~: 70024)
StakedEXATest:testHarvest() (gas: 197934)
Expand All @@ -494,16 +494,16 @@ StakedEXATest:testHarvestEffectOnRewardData() (gas: 190936)
StakedEXATest:testHarvestEmitsRewardAmountNotified() (gas: 188932)
StakedEXATest:testHarvestZero() (gas: 236769)
StakedEXATest:testInitialValues() (gas: 89096)
StakedEXATest:testInsufficientBalanceError(uint256) (runs: 256, μ: 65339, ~: 65475)
StakedEXATest:testInsufficientBalanceError(uint256) (runs: 256, μ: 64217, ~: 64353)
StakedEXATest:testMultipleClaimsVsOne() (gas: 26036303)
StakedEXATest:testMultipleHarvests() (gas: 461984)
StakedEXATest:testNoRewardsAfterPeriod(uint256) (runs: 256, μ: 1569608, ~: 1576154)
StakedEXATest:testNoRewardsAfterPeriod(uint256) (runs: 256, μ: 1569724, ~: 1576154)
StakedEXATest:testNotPausingRoleError() (gas: 39503)
StakedEXATest:testNotifyRewardAmount(uint256,uint256) (runs: 256, μ: 131163, ~: 131110)
StakedEXATest:testNotifyRewardWithUnderlyingAsset() (gas: 501808)
StakedEXATest:testNotifyRewardAmount(uint256,uint256) (runs: 256, μ: 130061, ~: 129986)
StakedEXATest:testNotifyRewardWithUnderlyingAsset() (gas: 497688)
StakedEXATest:testOnlyAdminEnableReward() (gas: 1198763)
StakedEXATest:testOnlyAdminFinishDistribution() (gas: 190966)
StakedEXATest:testOnlyAdminNotifyRewardAmount() (gas: 204608)
StakedEXATest:testOnlyAdminNotifyRewardAmount() (gas: 203486)
StakedEXATest:testOnlyAdminSetProvider() (gas: 143592)
StakedEXATest:testOnlyAdminSetProviderRatio() (gas: 143239)
StakedEXATest:testOnlyAdminSetRewardsDuration() (gas: 152845)
Expand All @@ -515,13 +515,13 @@ StakedEXATest:testPauserCanPauseUnpause() (gas: 157833)
StakedEXATest:testPenaltyGrowthRange() (gas: 67211)
StakedEXATest:testPenaltyThresholdRange() (gas: 37156)
StakedEXATest:testPermitAndDeposit() (gas: 373089)
StakedEXATest:testResetDepositAfterRefTime(uint256) (runs: 256, μ: 1020704, ~: 1020382)
StakedEXATest:testRewardAmountNotifiedEvent(uint256) (runs: 256, μ: 105863, ~: 106687)
StakedEXATest:testRewardNotListedError() (gas: 1114684)
StakedEXATest:testRewardPaidEvent(uint256,uint256) (runs: 256, μ: 816057, ~: 874723)
StakedEXATest:testRewardsAmounts(uint256) (runs: 256, μ: 1577077, ~: 1576667)
StakedEXATest:testResetDepositAfterRefTime(uint256) (runs: 256, μ: 1020709, ~: 1020430)
StakedEXATest:testRewardAmountNotifiedEvent(uint256) (runs: 256, μ: 104756, ~: 105577)
StakedEXATest:testRewardNotListedError() (gas: 1109575)
StakedEXATest:testRewardPaidEvent(uint256,uint256) (runs: 256, μ: 814113, ~: 862889)
StakedEXATest:testRewardsAmounts(uint256) (runs: 256, μ: 1577084, ~: 1576695)
StakedEXATest:testRewardsDurationSetEvent(uint40) (runs: 256, μ: 52073, ~: 52056)
StakedEXATest:testSetDuration(uint256,uint40) (runs: 256, μ: 59008, ~: 59260)
StakedEXATest:testSetDuration(uint256,uint40) (runs: 256, μ: 59004, ~: 59260)
StakedEXATest:testSetMarketAddressZero() (gas: 37124)
StakedEXATest:testSetMarketOnlyAdmin() (gas: 1266966)
StakedEXATest:testSetMinTime() (gas: 81993)
Expand All @@ -533,10 +533,10 @@ StakedEXATest:testSetSavingsZeroAddressError() (gas: 37284)
StakedEXATest:testTotalSupplyDeposit(uint80) (runs: 256, μ: 354934, ~: 361980)
StakedEXATest:testTotalSupplyWithdraw(uint256) (runs: 256, μ: 61972, ~: 61979)
StakedEXATest:testUntransferable(uint80) (runs: 256, μ: 374598, ~: 382543)
StakedEXATest:testWithdrawEvent(uint256) (runs: 256, μ: 520351, ~: 520040)
StakedEXATest:testWithdrawSameAmountRewardsShouldEqual(uint256,uint256) (runs: 256, μ: 1079922, ~: 1143318)
StakedEXATest:testWithdrawWithRewards(uint256) (runs: 256, μ: 879790, ~: 879479)
StakedEXATest:testZeroRateError() (gas: 59289)
StakedEXATest:testWithdrawEvent(uint256) (runs: 256, μ: 520356, ~: 520076)
StakedEXATest:testWithdrawSameAmountRewardsShouldEqual(uint256,uint256) (runs: 256, μ: 1078051, ~: 1143318)
StakedEXATest:testWithdrawWithRewards(uint256) (runs: 256, μ: 879795, ~: 879515)
StakedEXATest:testZeroRateError() (gas: 58180)
StakingPreviewerTest:testAllClaimable() (gas: 431408)
StakingPreviewerTest:testAllClaimed() (gas: 632923)
StakingPreviewerTest:testAllEarned() (gas: 316426)
Expand Down
1 change: 0 additions & 1 deletion contracts/StakedEXA.sol
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,6 @@ contract StakedEXA is
/// @param reward The reward token.
/// @param amount The amount of reward tokens.
function notifyRewardAmount(IERC20 reward, uint256 amount) external onlyRole(DEFAULT_ADMIN_ROLE) {
updateIndex(reward);
notifyRewardAmount(reward, amount, msg.sender);
}

Expand Down

0 comments on commit 394bd9b

Please sign in to comment.