-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(RewardsStreamerMP): make
RewardsStreamerMP
upgradeable
This commit introduces upgradeability of the `RewardsStreamerMP` contract by leveraging the UUPS pattern. This means, for deployment, we have to first deploy an instance of `RewardsStreamerMP` contract as a "template" logic contract and then create a ERC1967Proxy that points to it. The proxy ensures the implementation address is stored in a deterministic storage slot. This will later be leveraged by the `StakeVault` contract to implement the functionality to leave the system in case there was a malicious upgrade. Closes #22
- Loading branch information
Showing
16 changed files
with
341 additions
and
193 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,84 +1,86 @@ | ||
EmergencyExitTest:test_CannotEnableEmergencyModeTwice() (gas: 79829) | ||
EmergencyExitTest:test_CannotLeaveBeforeEmergencyMode() (gas: 283234) | ||
EmergencyExitTest:test_EmergencyExitBasic() (gas: 379874) | ||
EmergencyExitTest:test_EmergencyExitMultipleUsers() (gas: 788714) | ||
EmergencyExitTest:test_EmergencyExitToAlternateAddress() (gas: 517455) | ||
EmergencyExitTest:test_EmergencyExitWithLock() (gas: 370304) | ||
EmergencyExitTest:test_EmergencyExitWithRewards() (gas: 507361) | ||
EmergencyExitTest:test_OnlyOwnerCanEnableEmergencyMode() (gas: 34607) | ||
IntegrationTest:testStakeFoo() (gas: 1490300) | ||
LockTest:test_LockFailsWithInvalidPeriod() (gas: 290178) | ||
LockTest:test_LockFailsWithNoStake() (gas: 53357) | ||
LockTest:test_LockWithoutPriorLock() (gas: 383272) | ||
NFTMetadataGeneratorSVGTest:testGenerateMetadata() (gas: 92874) | ||
NFTMetadataGeneratorSVGTest:testSetImageStrings() (gas: 60081) | ||
NFTMetadataGeneratorSVGTest:testSetImageStringsRevert() (gas: 35818) | ||
NFTMetadataGeneratorURLTest:testGenerateMetadata() (gas: 109345) | ||
NFTMetadataGeneratorURLTest:testSetBaseURL() (gas: 50653) | ||
NFTMetadataGeneratorURLTest:testSetBaseURLRevert() (gas: 35993) | ||
RewardsStreamerTest:testStake() (gas: 869874) | ||
StakeTest:test_StakeMultipleAccounts() (gas: 493279) | ||
StakeTest:test_StakeMultipleAccountsAndRewards() (gas: 640763) | ||
StakeTest:test_StakeMultipleAccountsMPIncreasesMaxMPDoesNotChange() (gas: 818252) | ||
StakeTest:test_StakeMultipleAccountsWithMinLockUp() (gas: 499381) | ||
StakeTest:test_StakeMultipleAccountsWithRandomLockUp() (gas: 520783) | ||
StakeTest:test_StakeOneAccount() (gas: 284277) | ||
StakeTest:test_StakeOneAccountAndRewards() (gas: 431756) | ||
StakeTest:test_StakeOneAccountMPIncreasesMaxMPDoesNotChange() (gas: 498901) | ||
StakeTest:test_StakeOneAccountReachingMPLimit() (gas: 494078) | ||
StakeTest:test_StakeOneAccountWithMaxLockUp() (gas: 298175) | ||
StakeTest:test_StakeOneAccountWithMinLockUp() (gas: 298187) | ||
StakeTest:test_StakeOneAccountWithRandomLockUp() (gas: 298298) | ||
StakingTokenTest:testStakeToken() (gas: 10426) | ||
UnstakeTest:test_StakeMultipleAccounts() (gas: 493323) | ||
UnstakeTest:test_StakeMultipleAccountsAndRewards() (gas: 640807) | ||
UnstakeTest:test_StakeMultipleAccountsMPIncreasesMaxMPDoesNotChange() (gas: 818251) | ||
UnstakeTest:test_StakeMultipleAccountsWithMinLockUp() (gas: 499380) | ||
UnstakeTest:test_StakeMultipleAccountsWithRandomLockUp() (gas: 520827) | ||
UnstakeTest:test_StakeOneAccount() (gas: 284300) | ||
UnstakeTest:test_StakeOneAccountAndRewards() (gas: 431800) | ||
UnstakeTest:test_StakeOneAccountMPIncreasesMaxMPDoesNotChange() (gas: 498945) | ||
UnstakeTest:test_StakeOneAccountReachingMPLimit() (gas: 494080) | ||
UnstakeTest:test_StakeOneAccountWithMaxLockUp() (gas: 298132) | ||
UnstakeTest:test_StakeOneAccountWithMinLockUp() (gas: 298187) | ||
UnstakeTest:test_StakeOneAccountWithRandomLockUp() (gas: 298298) | ||
UnstakeTest:test_UnstakeBonusMPAndAccuredMP() (gas: 508511) | ||
UnstakeTest:test_UnstakeMultipleAccounts() (gas: 688755) | ||
UnstakeTest:test_UnstakeMultipleAccountsAndRewards() (gas: 1014239) | ||
UnstakeTest:test_UnstakeOneAccount() (gas: 480152) | ||
UnstakeTest:test_UnstakeOneAccountAndAccruedMP() (gas: 496638) | ||
UnstakeTest:test_UnstakeOneAccountAndRewards() (gas: 585964) | ||
UnstakeTest:test_UnstakeOneAccountWithLockUpAndAccruedMP() (gas: 518574) | ||
WithdrawTest:test_CannotWithdrawStakedFunds() (gas: 295608) | ||
XPNFTTokenTest:testApproveNotAllowed() (gas: 10507) | ||
XPNFTTokenTest:testGetApproved() (gas: 10531) | ||
XPNFTTokenTest:testIsApprovedForAll() (gas: 10705) | ||
XPNFTTokenTest:testSafeTransferNotAllowed() (gas: 10688) | ||
XPNFTTokenTest:testSafeTransferWithDataNotAllowed() (gas: 10906) | ||
XPNFTTokenTest:testSetApprovalForAllNotAllowed() (gas: 8474) | ||
XPNFTTokenTest:testSetMetadataGenerator() (gas: 1014075) | ||
XPNFTTokenTest:testSetMetadataGeneratorRevert() (gas: 1010606) | ||
XPNFTTokenTest:testTokenURI() (gas: 111913) | ||
XPNFTTokenTest:testTransferNotAllowed() (gas: 10723) | ||
XPTokenMintAllowanceTest:testAddXPProviderOnlyOwner() (gas: 285721) | ||
XPTokenMintAllowanceTest:testBalanceOf() (gas: 294561) | ||
XPTokenMintAllowanceTest:testBalanceOfWithNoSystemTotalXP() (gas: 43428) | ||
XPTokenMintAllowanceTest:testMintAllowance_Available() (gas: 205169) | ||
XPTokenMintAllowanceTest:testMintAllowance_NotAvailable() (gas: 205107) | ||
XPTokenMintAllowanceTest:testMintOnlyOwner() (gas: 241956) | ||
XPTokenMintAllowanceTest:testMint_Ok() (gas: 264233) | ||
XPTokenMintAllowanceTest:testMint_RevertWithAllowanceExceeded() (gas: 246656) | ||
XPTokenMintAllowanceTest:testRemoveXPProviderIndexOutOfBounds() (gas: 36295) | ||
XPTokenMintAllowanceTest:testRemoveXPProviderOnlyOwner() (gas: 72176) | ||
XPTokenMintAllowanceTest:testTotalSupply() (gas: 202454) | ||
XPTokenMintAllowanceTest:testTransfersNotAllowed() (gas: 20658) | ||
XPTokenOwnershipTest:testInitialOwner() (gas: 12649) | ||
XPTokenOwnershipTest:testOwnershipTransfer() (gas: 87271) | ||
XPTokenTest:testAddXPProviderOnlyOwner() (gas: 285753) | ||
XPTokenTest:testBalanceOf() (gas: 294565) | ||
XPTokenTest:testBalanceOfWithNoSystemTotalXP() (gas: 43405) | ||
XPTokenTest:testMintOnlyOwner() (gas: 241932) | ||
XPTokenTest:testRemoveXPProviderIndexOutOfBounds() (gas: 36277) | ||
XPTokenTest:testRemoveXPProviderOnlyOwner() (gas: 72141) | ||
XPTokenTest:testTotalSupply() (gas: 202403) | ||
XPTokenTest:testTransfersNotAllowed() (gas: 20702) | ||
EmergencyExitTest:test_CannotEnableEmergencyModeTwice() (gas: 89646) | ||
EmergencyExitTest:test_CannotLeaveBeforeEmergencyMode() (gas: 292881) | ||
EmergencyExitTest:test_EmergencyExitBasic() (gas: 395173) | ||
EmergencyExitTest:test_EmergencyExitMultipleUsers() (gas: 823179) | ||
EmergencyExitTest:test_EmergencyExitToAlternateAddress() (gas: 538257) | ||
EmergencyExitTest:test_EmergencyExitWithLock() (gas: 384549) | ||
EmergencyExitTest:test_EmergencyExitWithRewards() (gas: 529680) | ||
EmergencyExitTest:test_OnlyOwnerCanEnableEmergencyMode() (gas: 39344) | ||
IntegrationTest:testStakeFoo() (gas: 1559037) | ||
LockTest:test_LockFailsWithInvalidPeriod() (gas: 299830) | ||
LockTest:test_LockFailsWithNoStake() (gas: 58241) | ||
LockTest:test_LockWithoutPriorLock() (gas: 396542) | ||
NFTMetadataGeneratorSVGTest:testGenerateMetadata() (gas: 85934) | ||
NFTMetadataGeneratorSVGTest:testSetImageStrings() (gas: 58332) | ||
NFTMetadataGeneratorSVGTest:testSetImageStringsRevert() (gas: 35804) | ||
NFTMetadataGeneratorURLTest:testGenerateMetadata() (gas: 102512) | ||
NFTMetadataGeneratorURLTest:testSetBaseURL() (gas: 49555) | ||
NFTMetadataGeneratorURLTest:testSetBaseURLRevert() (gas: 35979) | ||
RewardsStreamerTest:testStake() (gas: 869181) | ||
StakeTest:test_StakeMultipleAccounts() (gas: 506030) | ||
StakeTest:test_StakeMultipleAccountsAndRewards() (gas: 661839) | ||
StakeTest:test_StakeMultipleAccountsMPIncreasesMaxMPDoesNotChange() (gas: 872090) | ||
StakeTest:test_StakeMultipleAccountsWithMinLockUp() (gas: 520069) | ||
StakeTest:test_StakeMultipleAccountsWithRandomLockUp() (gas: 541881) | ||
StakeTest:test_StakeOneAccount() (gas: 290297) | ||
StakeTest:test_StakeOneAccountAndRewards() (gas: 446101) | ||
StakeTest:test_StakeOneAccountMPIncreasesMaxMPDoesNotChange() (gas: 536165) | ||
StakeTest:test_StakeOneAccountReachingMPLimit() (gas: 532401) | ||
StakeTest:test_StakeOneAccountWithMaxLockUp() (gas: 310643) | ||
StakeTest:test_StakeOneAccountWithMinLockUp() (gas: 310610) | ||
StakeTest:test_StakeOneAccountWithRandomLockUp() (gas: 310721) | ||
StakingTokenTest:testStakeToken() (gas: 10422) | ||
UnstakeTest:test_StakeMultipleAccounts() (gas: 506074) | ||
UnstakeTest:test_StakeMultipleAccountsAndRewards() (gas: 661883) | ||
UnstakeTest:test_StakeMultipleAccountsMPIncreasesMaxMPDoesNotChange() (gas: 872089) | ||
UnstakeTest:test_StakeMultipleAccountsWithMinLockUp() (gas: 520068) | ||
UnstakeTest:test_StakeMultipleAccountsWithRandomLockUp() (gas: 541925) | ||
UnstakeTest:test_StakeOneAccount() (gas: 290320) | ||
UnstakeTest:test_StakeOneAccountAndRewards() (gas: 446145) | ||
UnstakeTest:test_StakeOneAccountMPIncreasesMaxMPDoesNotChange() (gas: 536209) | ||
UnstakeTest:test_StakeOneAccountReachingMPLimit() (gas: 532403) | ||
UnstakeTest:test_StakeOneAccountWithMaxLockUp() (gas: 310600) | ||
UnstakeTest:test_StakeOneAccountWithMinLockUp() (gas: 310610) | ||
UnstakeTest:test_StakeOneAccountWithRandomLockUp() (gas: 310721) | ||
UnstakeTest:test_UnstakeBonusMPAndAccuredMP() (gas: 541859) | ||
UnstakeTest:test_UnstakeMultipleAccounts() (gas: 714931) | ||
UnstakeTest:test_UnstakeMultipleAccountsAndRewards() (gas: 1057383) | ||
UnstakeTest:test_UnstakeOneAccount() (gas: 499845) | ||
UnstakeTest:test_UnstakeOneAccountAndAccruedMP() (gas: 524183) | ||
UnstakeTest:test_UnstakeOneAccountAndRewards() (gas: 608646) | ||
UnstakeTest:test_UnstakeOneAccountWithLockUpAndAccruedMP() (gas: 555708) | ||
UpgradeTest:test_RevertWhenNotOwner() (gas: 2159991) | ||
UpgradeTest:test_UpgradeStakeManager() (gas: 2445373) | ||
WithdrawTest:test_CannotWithdrawStakedFunds() (gas: 305631) | ||
XPNFTTokenTest:testApproveNotAllowed() (gas: 10500) | ||
XPNFTTokenTest:testGetApproved() (gas: 10523) | ||
XPNFTTokenTest:testIsApprovedForAll() (gas: 10698) | ||
XPNFTTokenTest:testSafeTransferNotAllowed() (gas: 10680) | ||
XPNFTTokenTest:testSafeTransferWithDataNotAllowed() (gas: 10897) | ||
XPNFTTokenTest:testSetApprovalForAllNotAllowed() (gas: 8467) | ||
XPNFTTokenTest:testSetMetadataGenerator() (gas: 969770) | ||
XPNFTTokenTest:testSetMetadataGeneratorRevert() (gas: 966301) | ||
XPNFTTokenTest:testTokenURI() (gas: 103894) | ||
XPNFTTokenTest:testTransferNotAllowed() (gas: 10715) | ||
XPTokenMintAllowanceTest:testAddXPProviderOnlyOwner() (gas: 282868) | ||
XPTokenMintAllowanceTest:testBalanceOf() (gas: 294494) | ||
XPTokenMintAllowanceTest:testBalanceOfWithNoSystemTotalXP() (gas: 43385) | ||
XPTokenMintAllowanceTest:testMintAllowance_Available() (gas: 205108) | ||
XPTokenMintAllowanceTest:testMintAllowance_NotAvailable() (gas: 205044) | ||
XPTokenMintAllowanceTest:testMintOnlyOwner() (gas: 241885) | ||
XPTokenMintAllowanceTest:testMint_Ok() (gas: 264142) | ||
XPTokenMintAllowanceTest:testMint_RevertWithAllowanceExceeded() (gas: 246592) | ||
XPTokenMintAllowanceTest:testRemoveXPProviderIndexOutOfBounds() (gas: 36286) | ||
XPTokenMintAllowanceTest:testRemoveXPProviderOnlyOwner() (gas: 72143) | ||
XPTokenMintAllowanceTest:testTotalSupply() (gas: 202403) | ||
XPTokenMintAllowanceTest:testTransfersNotAllowed() (gas: 20631) | ||
XPTokenOwnershipTest:testInitialOwner() (gas: 12645) | ||
XPTokenOwnershipTest:testOwnershipTransfer() (gas: 87252) | ||
XPTokenTest:testAddXPProviderOnlyOwner() (gas: 282900) | ||
XPTokenTest:testBalanceOf() (gas: 294498) | ||
XPTokenTest:testBalanceOfWithNoSystemTotalXP() (gas: 43362) | ||
XPTokenTest:testMintOnlyOwner() (gas: 241861) | ||
XPTokenTest:testRemoveXPProviderIndexOutOfBounds() (gas: 36268) | ||
XPTokenTest:testRemoveXPProviderOnlyOwner() (gas: 72108) | ||
XPTokenTest:testTotalSupply() (gas: 202352) | ||
XPTokenTest:testTransfersNotAllowed() (gas: 20675) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule openzeppelin-contracts-upgradeable
added at
fa5253
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
forge-std/=lib/forge-std/src/ | ||
@openzeppelin/contracts=./lib/openzeppelin-contracts/contracts | ||
@openzeppelin/contracts=lib/openzeppelin-contracts/contracts | ||
@openzeppelin/contracts-upgradeable=lib/openzeppelin-contracts-upgradeable/contracts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.