Skip to content

Commit

Permalink
⚡️ rewards: reusing storage pointers
Browse files Browse the repository at this point in the history
  • Loading branch information
santichez committed Apr 21, 2023
1 parent 4fe8a12 commit 7d787e7
Show file tree
Hide file tree
Showing 3 changed files with 112 additions and 110 deletions.
5 changes: 5 additions & 0 deletions .changeset/nine-taxis-buy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@exactly-protocol/protocol": patch
---

⚡️ rewards: reusing storage pointers
136 changes: 68 additions & 68 deletions .gas-snapshot
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,8 @@ PreviewerTest:testAccountsWithAccountOnlyDeposit() (gas: 817676)
PreviewerTest:testAccountsWithAccountThatHasBalances() (gas: 1567906)
PreviewerTest:testAccountsWithEmptyAccount() (gas: 669155)
PreviewerTest:testAccountsWithIntermediateOperationsReturningAccurateAmounts() (gas: 13294487)
PreviewerTest:testActualTimeBeforeStartDistributionRewards() (gas: 6888767)
PreviewerTest:testEmptyExactly() (gas: 5179580)
PreviewerTest:testActualTimeBeforeStartDistributionRewards() (gas: 6741390)
PreviewerTest:testEmptyExactly() (gas: 5033079)
PreviewerTest:testExactlyReturningInterestRateModelData() (gas: 665268)
PreviewerTest:testFixedAvailableLiquidityProjectingNewFloatingDebt() (gas: 9569199)
PreviewerTest:testFixedPoolsA() (gas: 15067776)
Expand All @@ -152,7 +152,7 @@ PreviewerTest:testFlexibleAvailableLiquidity() (gas: 13524973)
PreviewerTest:testFlexibleBorrowSharesAndAssets() (gas: 3491385)
PreviewerTest:testFloatingAvailableLiquidityProjectingNewFloatingDebt() (gas: 9137700)
PreviewerTest:testFloatingRateAndUtilization() (gas: 935395)
PreviewerTest:testJustUpdatedRewardRatesShouldStillReturnRate() (gas: 6218888)
PreviewerTest:testJustUpdatedRewardRatesShouldStillReturnRate() (gas: 6071501)
PreviewerTest:testMaxBorrowAssetsCapacity() (gas: 2045904)
PreviewerTest:testMaxBorrowAssetsCapacityForAccountWithShortfall() (gas: 7884676)
PreviewerTest:testMaxBorrowAssetsCapacityPerMarket() (gas: 9309731)
Expand Down Expand Up @@ -198,11 +198,11 @@ PreviewerTest:testPreviewWithdrawAtMaturityWithMaturedMaturity() (gas: 193941)
PreviewerTest:testPreviewWithdrawAtMaturityWithOneUnit() (gas: 202895)
PreviewerTest:testPreviewWithdrawAtMaturityWithSameTimestamp() (gas: 193846)
PreviewerTest:testPreviewWithdrawAtMaturityWithZeroAmount() (gas: 202941)
PreviewerTest:testReturnRewardAssetUsdPrice() (gas: 6248321)
PreviewerTest:testRewardsRate() (gas: 7008998)
PreviewerTest:testRewardsRateAfterDistributionEnd() (gas: 6379477)
PreviewerTest:testRewardsRateOnlyWithFixedBorrows() (gas: 6135726)
PreviewerTest:testRewardsRateWithMarketWithDifferentDecimals() (gas: 14432988)
PreviewerTest:testReturnRewardAssetUsdPrice() (gas: 6101335)
PreviewerTest:testRewardsRate() (gas: 6860244)
PreviewerTest:testRewardsRateAfterDistributionEnd() (gas: 6231477)
PreviewerTest:testRewardsRateOnlyWithFixedBorrows() (gas: 5988973)
PreviewerTest:testRewardsRateWithMarketWithDifferentDecimals() (gas: 14284234)
PriceFeedDoubleTest:testPriceFeedDoubleReturningAccurateDecimals() (gas: 433282)
PriceFeedDoubleTest:testPriceFeedDoubleReturningPrice() (gas: 26143)
PriceFeedDoubleTest:testPriceFeedDoubleWithActualOnChainValues() (gas: 30976)
Expand All @@ -213,65 +213,65 @@ PriceFeedWrapperTest:testPriceFeedWrapperReturningPriceAfterRebase() (gas: 22863
PriceFeedWrapperTest:testPriceFeedWrapperWithActualOnChainValues() (gas: 30295)
PriceFeedWrapperTest:testPriceFeedWrapperWithNegativePriceShouldRevert() (gas: 42290)
PriceFeedWrapperTest:testPriceFeedWrapperWithUsdPriceFeed() (gas: 1054289)
RewardsControllerTest:testAccrueRewardsForWholeDistributionPeriod() (gas: 1031797)
RewardsControllerTest:testAccrueRewardsWithBadDebtClearingOfFixedBorrow() (gas: 2091491)
RewardsControllerTest:testAccrueRewardsWithRepayOfBorrowBalance() (gas: 1136759)
RewardsControllerTest:testAccrueRewardsWithRepayOfFixedBorrowBalance() (gas: 1254260)
RewardsControllerTest:testAccrueRewardsWithSeizeOfAllDepositShares() (gas: 1316201)
RewardsControllerTest:testAfterDistributionPeriodEnd() (gas: 1531572)
RewardsControllerTest:testAllClaimableUSDCWithAnotherAccountInPool() (gas: 1995108)
RewardsControllerTest:testAllClaimableUSDCWithDeposit() (gas: 1588138)
RewardsControllerTest:testAllClaimableUSDCWithFloatingBorrow() (gas: 1419648)
RewardsControllerTest:testAllClaimableUSDCWithFloatingRefund() (gas: 1327867)
RewardsControllerTest:testAllClaimableUSDCWithFloatingRepay() (gas: 1333197)
RewardsControllerTest:testAllClaimableUSDCWithMint() (gas: 1219409)
RewardsControllerTest:testAllClaimableUSDCWithRedeem() (gas: 1276290)
RewardsControllerTest:testAllClaimableUSDCWithTransfer() (gas: 1919524)
RewardsControllerTest:testAllClaimableUSDCWithTransferFrom() (gas: 1792951)
RewardsControllerTest:testAllClaimableUSDCWithWithdraw() (gas: 1277338)
RewardsControllerTest:testAllClaimableWETH() (gas: 1199957)
RewardsControllerTest:testAllClaimableWithMaturedFixedPool() (gas: 1067334)
RewardsControllerTest:testAllClaimableWithTimeElapsedZero() (gas: 1200083)
RewardsControllerTest:testClaim() (gas: 1002712)
RewardsControllerTest:testClaimAll() (gas: 1756424)
RewardsControllerTest:testClaimMarketWithoutRewards() (gas: 939901)
RewardsControllerTest:testClaimWithNotEnabledRewardAsset() (gas: 1040586)
RewardsControllerTest:testConfigSettingNewStartWithOnGoingDistributionShouldNotUpdate() (gas: 367206)
RewardsControllerTest:testConfigWithDistributionNotYetStartedShouldNotFail() (gas: 497317)
RewardsControllerTest:testConfigWithTransitionFactorHigherOrEqThanCap() (gas: 147139)
RewardsControllerTest:testConfigWithZeroDepositAllocationWeightFactorShouldRevert() (gas: 91969)
RewardsControllerTest:testDifferentDistributionTimeForDifferentRewards() (gas: 1571465)
RewardsControllerTest:testEmitAccrue() (gas: 1024854)
RewardsControllerTest:testEmitClaimRewards() (gas: 919164)
RewardsControllerTest:testEmitConfigUpdate() (gas: 385024)
RewardsControllerTest:testEmitIndexUpdate() (gas: 1092145)
RewardsControllerTest:testLastUndistributed() (gas: 1551470)
RewardsControllerTest:testOperationAfterDistributionEnded() (gas: 627356)
RewardsControllerTest:testOperationsBeforeDistributionStart() (gas: 1267595)
RewardsControllerTest:testSetDistributionConfigWithDifferentDecimals() (gas: 9777426)
RewardsControllerTest:testSetDistributionOperationShouldUpdateIndex() (gas: 112809)
RewardsControllerTest:testSetDistributionWithOnGoingMarketOperations() (gas: 972212)
RewardsControllerTest:testSetHigherTotalDistribution() (gas: 1336241)
RewardsControllerTest:testSetLowerAndEqualDistributionPeriodThanCurrentTimestampShouldRevert() (gas: 914102)
RewardsControllerTest:testSetLowerAndEqualTotalDistributionThanReleasedShouldRevert() (gas: 911893)
RewardsControllerTest:testSetLowerDistributionPeriod() (gas: 1563634)
RewardsControllerTest:testSetLowerDistributionPeriodAndLowerTotalDistribution() (gas: 1566403)
RewardsControllerTest:testSetLowerTotalDistribution() (gas: 1336154)
RewardsControllerTest:testSetNewDistributionPeriod() (gas: 2073872)
RewardsControllerTest:testSetNewDistributionPeriodAfterDistributionEnds() (gas: 1162065)
RewardsControllerTest:testSetNewTargetDebt() (gas: 1249846)
RewardsControllerTest:testSetNewTargetDebtAfterDistributionEnds() (gas: 1281468)
RewardsControllerTest:testSetNewTargetDebtWithClaimOnlyAtEnd() (gas: 1132357)
RewardsControllerTest:testSetNewTreasuryFeeShouldImpactAllocation() (gas: 514055)
RewardsControllerTest:testSetTargetDebtMultipleTimes() (gas: 1809851)
RewardsControllerTest:testSetTargetDebtMultipleTimesAfterEnd() (gas: 1814432)
RewardsControllerTest:testSetTotalDistributionMultipleTimes() (gas: 1306118)
RewardsControllerTest:testTriggerHandleBorrowHookBeforeUpdatingFloatingDebt() (gas: 1305161)
RewardsControllerTest:testUpdateConfig() (gas: 1074805)
RewardsControllerTest:testUpdateIndexesWithUtilizationEqualToOne() (gas: 1007666)
RewardsControllerTest:testUpdateIndexesWithUtilizationHigherThanOne() (gas: 1059213)
RewardsControllerTest:testUpdateWithTotalDebtZeroShouldUpdateLastUndistributed() (gas: 426489)
RewardsControllerTest:testUtilizationEqualZero() (gas: 625092)
RewardsControllerTest:testWithTwelveFixedPools() (gas: 4020477)
RewardsControllerTest:testAccrueRewardsForWholeDistributionPeriod() (gas: 1027423)
RewardsControllerTest:testAccrueRewardsWithBadDebtClearingOfFixedBorrow() (gas: 2088721)
RewardsControllerTest:testAccrueRewardsWithRepayOfBorrowBalance() (gas: 1133752)
RewardsControllerTest:testAccrueRewardsWithRepayOfFixedBorrowBalance() (gas: 1251392)
RewardsControllerTest:testAccrueRewardsWithSeizeOfAllDepositShares() (gas: 1313393)
RewardsControllerTest:testAfterDistributionPeriodEnd() (gas: 1524504)
RewardsControllerTest:testAllClaimableUSDCWithAnotherAccountInPool() (gas: 1983232)
RewardsControllerTest:testAllClaimableUSDCWithDeposit() (gas: 1579808)
RewardsControllerTest:testAllClaimableUSDCWithFloatingBorrow() (gas: 1414012)
RewardsControllerTest:testAllClaimableUSDCWithFloatingRefund() (gas: 1321236)
RewardsControllerTest:testAllClaimableUSDCWithFloatingRepay() (gas: 1326566)
RewardsControllerTest:testAllClaimableUSDCWithMint() (gas: 1213773)
RewardsControllerTest:testAllClaimableUSDCWithRedeem() (gas: 1269580)
RewardsControllerTest:testAllClaimableUSDCWithTransfer() (gas: 1909129)
RewardsControllerTest:testAllClaimableUSDCWithTransferFrom() (gas: 1785250)
RewardsControllerTest:testAllClaimableUSDCWithWithdraw() (gas: 1270628)
RewardsControllerTest:testAllClaimableWETH() (gas: 1191762)
RewardsControllerTest:testAllClaimableWithMaturedFixedPool() (gas: 1060351)
RewardsControllerTest:testAllClaimableWithTimeElapsedZero() (gas: 1192509)
RewardsControllerTest:testClaim() (gas: 996018)
RewardsControllerTest:testClaimAll() (gas: 1744265)
RewardsControllerTest:testClaimMarketWithoutRewards() (gas: 939336)
RewardsControllerTest:testClaimWithNotEnabledRewardAsset() (gas: 1032881)
RewardsControllerTest:testConfigSettingNewStartWithOnGoingDistributionShouldNotUpdate() (gas: 366998)
RewardsControllerTest:testConfigWithDistributionNotYetStartedShouldNotFail() (gas: 496227)
RewardsControllerTest:testConfigWithTransitionFactorHigherOrEqThanCap() (gas: 145279)
RewardsControllerTest:testConfigWithZeroDepositAllocationWeightFactorShouldRevert() (gas: 91039)
RewardsControllerTest:testDifferentDistributionTimeForDifferentRewards() (gas: 1565677)
RewardsControllerTest:testEmitAccrue() (gas: 1021214)
RewardsControllerTest:testEmitClaimRewards() (gas: 914790)
RewardsControllerTest:testEmitConfigUpdate() (gas: 383168)
RewardsControllerTest:testEmitIndexUpdate() (gas: 1086204)
RewardsControllerTest:testLastUndistributed() (gas: 1538070)
RewardsControllerTest:testOperationAfterDistributionEnded() (gas: 625896)
RewardsControllerTest:testOperationsBeforeDistributionStart() (gas: 1261302)
RewardsControllerTest:testSetDistributionConfigWithDifferentDecimals() (gas: 9760792)
RewardsControllerTest:testSetDistributionOperationShouldUpdateIndex() (gas: 111881)
RewardsControllerTest:testSetDistributionWithOnGoingMarketOperations() (gas: 967696)
RewardsControllerTest:testSetHigherTotalDistribution() (gas: 1329836)
RewardsControllerTest:testSetLowerAndEqualDistributionPeriodThanCurrentTimestampShouldRevert() (gas: 912593)
RewardsControllerTest:testSetLowerAndEqualTotalDistributionThanReleasedShouldRevert() (gas: 910384)
RewardsControllerTest:testSetLowerDistributionPeriod() (gas: 1554315)
RewardsControllerTest:testSetLowerDistributionPeriodAndLowerTotalDistribution() (gas: 1557084)
RewardsControllerTest:testSetLowerTotalDistribution() (gas: 1329749)
RewardsControllerTest:testSetNewDistributionPeriod() (gas: 2061639)
RewardsControllerTest:testSetNewDistributionPeriodAfterDistributionEnds() (gas: 1158574)
RewardsControllerTest:testSetNewTargetDebt() (gas: 1243441)
RewardsControllerTest:testSetNewTargetDebtAfterDistributionEnds() (gas: 1275063)
RewardsControllerTest:testSetNewTargetDebtWithClaimOnlyAtEnd() (gas: 1128866)
RewardsControllerTest:testSetNewTreasuryFeeShouldImpactAllocation() (gas: 513942)
RewardsControllerTest:testSetTargetDebtMultipleTimes() (gas: 1802451)
RewardsControllerTest:testSetTargetDebtMultipleTimesAfterEnd() (gas: 1807032)
RewardsControllerTest:testSetTotalDistributionMultipleTimes() (gas: 1301699)
RewardsControllerTest:testTriggerHandleBorrowHookBeforeUpdatingFloatingDebt() (gas: 1301985)
RewardsControllerTest:testUpdateConfig() (gas: 1069967)
RewardsControllerTest:testUpdateIndexesWithUtilizationEqualToOne() (gas: 1005374)
RewardsControllerTest:testUpdateIndexesWithUtilizationHigherThanOne() (gas: 1056921)
RewardsControllerTest:testUpdateWithTotalDebtZeroShouldUpdateLastUndistributed() (gas: 426271)
RewardsControllerTest:testUtilizationEqualZero() (gas: 623240)
RewardsControllerTest:testWithTwelveFixedPools() (gas: 4001703)
RewardsControllerTest:testWithdrawAllRewardBalance() (gas: 47213)
RewardsControllerTest:testWithdrawOnlyAdminRole() (gas: 84719)
Loading

0 comments on commit 7d787e7

Please sign in to comment.