Skip to content

Commit

Permalink
chore: update interface and update Solidity version to 0.8.27 across …
Browse files Browse the repository at this point in the history
…all files
  • Loading branch information
3esmit committed Nov 11, 2024
1 parent 9be84c7 commit 0aa3f2e
Show file tree
Hide file tree
Showing 30 changed files with 319 additions and 188 deletions.
127 changes: 127 additions & 0 deletions .gas-report
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
| contracts/StakeManager.sol:StakeManager contract | | | | | |
|--------------------------------------------------|-----------------|--------|--------|--------|---------|
| Deployment Cost | Deployment Size | | | | |
| 2600451 | 13644 | | | | |
| Function Name | min | avg | median | max | # calls |
| ACCURE_RATE | 328 | 328 | 328 | 328 | 1546 |
| MAX_LOCKUP_PERIOD | 405 | 405 | 405 | 405 | 4 |
| MAX_MULTIPLIER | 307 | 307 | 307 | 307 | 685 |
| MIN_LOCKUP_PERIOD | 264 | 264 | 264 | 264 | 12 |
| REWARD_TOKEN | 317 | 317 | 317 | 317 | 744 |
| YEAR | 308 | 308 | 308 | 308 | 685 |
| acceptUpdate | 23633 | 23633 | 23633 | 23633 | 1 |
| accounts | 1572 | 1572 | 1572 | 1572 | 154869 |
| calculateMP | 798 | 798 | 798 | 798 | 1372 |
| currentEpoch | 384 | 1050 | 384 | 2384 | 54 |
| epochEnd | 627 | 627 | 627 | 2627 | 25441 |
| epochReward | 1381 | 2881 | 1381 | 5881 | 3 |
| executeAccount(address) | 33469 | 110665 | 149264 | 149264 | 3 |
| executeAccount(address,uint256) | 26562 | 72195 | 74101 | 199919 | 152455 |
| executeEpoch() | 23435 | 120639 | 121820 | 900335 | 25330 |
| executeEpoch(uint256) | 23861 | 24497 | 23861 | 26090 | 7 |
| expiredStakeStorage | 416 | 2325 | 2416 | 2416 | 22 |
| isTrustedCodehash | 541 | 944 | 541 | 2541 | 728 |
| leave | 23675 | 23675 | 23675 | 23675 | 1 |
| lock | 23840 | 23840 | 23840 | 23840 | 1 |
| migration | 417 | 1417 | 1417 | 2417 | 4 |
| migrationInitialize | 24646 | 24646 | 24646 | 24646 | 1 |
| newEpoch | 463 | 463 | 463 | 463 | 5 |
| owner | 2432 | 2432 | 2432 | 2432 | 13 |
| pendingReward | 408 | 1442 | 2408 | 2408 | 29 |
| potentialMP | 408 | 408 | 408 | 408 | 49964 |
| previousManager | 297 | 297 | 297 | 297 | 13 |
| setTrustedCodehash | 47982 | 47982 | 47982 | 47982 | 147 |
| stake | 24047 | 24047 | 24047 | 24047 | 1 |
| startMigration | 103624 | 103632 | 103636 | 103636 | 3 |
| startTime | 306 | 306 | 306 | 306 | 21 |
| totalMP | 385 | 385 | 385 | 2385 | 49985 |
| totalStaked | 386 | 1786 | 2386 | 2386 | 20 |
| totalSupply | 784 | 1965 | 2784 | 2784 | 22 |
| unstake | 23841 | 23841 | 23841 | 23841 | 1 |


| contracts/StakeVault.sol:StakeVault contract | | | | | |
|----------------------------------------------|-----------------|--------|--------|--------|---------|
| Deployment Cost | Deployment Size | | | | |
| 0 | 0 | | | | |
| Function Name | min | avg | median | max | # calls |
| STAKING_TOKEN | 193 | 193 | 193 | 193 | 2 |
| acceptMigration | 35141 | 35141 | 35141 | 35141 | 2 |
| leave | 35196 | 35196 | 35196 | 35196 | 1 |
| lock | 43196 | 71076 | 62042 | 162843 | 7 |
| owner | 318 | 318 | 318 | 318 | 727 |
| stake | 27291 | 282802 | 266296 | 351880 | 732 |
| unstake | 40179 | 88236 | 78765 | 184769 | 11 |


| contracts/VaultFactory.sol:VaultFactory contract | | | | | |
|--------------------------------------------------|-----------------|--------|--------|--------|---------|
| Deployment Cost | Deployment Size | | | | |
| 0 | 0 | | | | |
| Function Name | min | avg | median | max | # calls |
| createVault | 682927 | 682927 | 682927 | 682927 | 731 |
| setStakeManager | 23710 | 26669 | 26076 | 30222 | 3 |
| stakeManager | 368 | 1868 | 2368 | 2368 | 4 |


| contracts/storage/ExpiredStakeStorage.sol:ExpiredStakeStorage contract | | | | | |
|------------------------------------------------------------------------|-----------------|-------|--------|-------|---------|
| Deployment Cost | Deployment Size | | | | |
| 0 | 0 | | | | |
| Function Name | min | avg | median | max | # calls |
| getExpiredMP | 2427 | 2427 | 2427 | 2427 | 25486 |
| transferOwnership | 28533 | 28533 | 28533 | 28533 | 1 |


| script/Deploy.s.sol:Deploy contract | | | | | |
|-------------------------------------|-----------------|---------|---------|---------|---------|
| Deployment Cost | Deployment Size | | | | |
| 6220738 | 29931 | | | | |
| Function Name | min | avg | median | max | # calls |
| run | 5420174 | 5420174 | 5420174 | 5420174 | 66 |


| script/DeployMigrationStakeManager.s.sol:DeployMigrationStakeManager contract | | | | | |
|-------------------------------------------------------------------------------|-----------------|---------|---------|---------|---------|
| Deployment Cost | Deployment Size | | | | |
| 3412741 | 16827 | | | | |
| Function Name | min | avg | median | max | # calls |
| run | 2427736 | 2427736 | 2427736 | 2427736 | 19 |


| script/DeploymentConfig.s.sol:DeploymentConfig contract | | | | | |
|---------------------------------------------------------|-----------------|-----|--------|-----|---------|
| Deployment Cost | Deployment Size | | | | |
| 0 | 0 | | | | |
| Function Name | min | avg | median | max | # calls |
| activeNetworkConfig | 455 | 455 | 455 | 455 | 132 |


| test/mocks/BrokenERC20.s.sol:BrokenERC20 contract | | | | | |
|---------------------------------------------------|-----------------|-------|--------|-------|---------|
| Deployment Cost | Deployment Size | | | | |
| 0 | 0 | | | | |
| Function Name | min | avg | median | max | # calls |
| approve | 46175 | 46175 | 46175 | 46175 | 1 |
| balanceOf | 561 | 1227 | 561 | 2561 | 3 |


| test/mocks/MockERC20.sol:MockERC20 contract | | | | | |
|---------------------------------------------|-----------------|-------|--------|-------|---------|
| Deployment Cost | Deployment Size | | | | |
| 0 | 0 | | | | |
| Function Name | min | avg | median | max | # calls |
| approve | 46175 | 46235 | 46199 | 46367 | 727 |
| balanceOf | 561 | 2127 | 2561 | 2561 | 32612 |


| test/script/DeployBroken.s.sol:DeployBroken contract | | | | | |
|------------------------------------------------------|-----------------|---------|---------|---------|---------|
| Deployment Cost | Deployment Size | | | | |
| 4918894 | 23867 | | | | |
| Function Name | min | avg | median | max | # calls |
| run | 4266410 | 4266410 | 4266410 | 4266410 | 1 |




122 changes: 61 additions & 61 deletions .gas-snapshot
Original file line number Diff line number Diff line change
@@ -1,67 +1,67 @@
CreateVaultTest:testDeployment() (gas: 9774)
CreateVaultTest:test_createVault() (gas: 699564)
ExecuteAccountTest:testDeployment() (gas: 28828)
ExecuteAccountTest:test_ExecuteAccountLimit() (gas: 1564735)
ExecuteAccountTest:test_ExecuteAccountMintMP() (gas: 5252076)
ExecuteAccountTest:test_RevertWhen_InvalidLimitEpoch() (gas: 1772992)
ExecuteAccountTest:test_ShouldNotMintMoreThanCap() (gas: 320738328)
ExecuteEpochTest:testDeployment() (gas: 28829)
ExecuteEpochTest:testNewDeployment() (gas: 30901)
ExecuteEpochTest:test_ExecuteEpochExecuteAccountAfterEpochEnd() (gas: 1353515)
ExecuteEpochTest:test_ExecuteEpochExecuteAccountAfterManyEpochsJumoMany() (gas: 1371040)
ExecuteEpochTest:test_ExecuteEpochExecuteAccountAfterManyEpochsWithBrokenTime() (gas: 1616635)
ExecuteEpochTest:test_ExecuteEpochExecuteAccountAfterManyEpochsWithBrokenTimeJumpMany() (gas: 1380975)
ExecuteEpochTest:test_ExecuteEpochExecuteEpochAfterEnd() (gas: 1914097)
ExecuteEpochTest:test_ExecuteEpochExecuteEpochExecuteAccountAfterManyEpochs() (gas: 2496675)
ExecuteEpochTest:test_ExecuteEpochExecuteEpochExecuteAccountAfterManyEpochsJumoMany() (gas: 1464542)
ExecuteEpochTest:test_ExecuteEpochExecuteEpochExecuteAccountAfterManyEpochsWithBrokenTime() (gas: 2506631)
ExecuteEpochTest:test_ExecuteEpochExecuteEpochExecuteAccountAfterManyEpochsWithBrokenTimeJumpMany() (gas: 1474454)
ExecuteEpochTest:test_ExecuteEpochNewEpoch() (gas: 1083709)
ExecuteEpochTest:test_ExecuteEpochShouldIncreaseEpoch() (gas: 92344)
ExecuteEpochTest:test_ExecuteEpochShouldIncreasePendingReward() (gas: 256303)
ExecuteEpochTest:test_ExecuteEpochShouldNotIncreaseEpochBeforeEnd() (gas: 39028)
ExecuteEpochTest:test_ExecuteEpochShouldNotIncreaseEpochInMigration() (gas: 149770)
LeaveTest:testDeployment() (gas: 28806)
LeaveTest:test_RevertWhen_NoPendingMigration() (gas: 1315087)
LeaveTest:test_RevertWhen_SenderIsNotVault() (gas: 31696)
LockTest:testDeployment() (gas: 28806)
LockTest:test_NewLockupPeriod() (gas: 1313929)
LockTest:test_RevertWhen_InvalidNewLockupPeriod() (gas: 1288722)
LockTest:test_RevertWhen_InvalidUpdateLockupPeriod() (gas: 1529335)
LockTest:test_RevertWhen_SenderIsNotVault() (gas: 31856)
LockTest:test_ShouldIncreaseBonusMP() (gas: 1296480)
LockTest:test_UpdateLockupPeriod() (gas: 1565467)
MigrateTest:testDeployment() (gas: 28806)
MigrateTest:test_RevertWhen_NoPendingMigration() (gas: 1279254)
MigrateTest:test_RevertWhen_SenderIsNotVault() (gas: 31738)
MigrationInitializeTest:testDeployment() (gas: 28806)
MigrationInitializeTest:test_RevertWhen_MigrationPending() (gas: 5275163)
MigrationStakeManagerTest:testDeployment() (gas: 28806)
MigrationStakeManagerTest:testNewDeployment() (gas: 30945)
MigrationStakeManagerTest:test_ExecuteEpochShouldNotIncreaseEpochInMigration() (gas: 149735)
CreateVaultTest:test_createVault() (gas: 700333)
ExecuteAccountTest:testDeployment() (gas: 28875)
ExecuteAccountTest:test_ExecuteAccountLimit() (gas: 1559514)
ExecuteAccountTest:test_ExecuteAccountMintMP() (gas: 5232040)
ExecuteAccountTest:test_RevertWhen_InvalidLimitEpoch() (gas: 1769214)
ExecuteAccountTest:test_ShouldNotMintMoreThanCap() (gas: 320225995)
ExecuteEpochTest:testDeployment() (gas: 28876)
ExecuteEpochTest:testNewDeployment() (gas: 30948)
ExecuteEpochTest:test_ExecuteEpochExecuteAccountAfterEpochEnd() (gas: 1350443)
ExecuteEpochTest:test_ExecuteEpochExecuteAccountAfterManyEpochsJumoMany() (gas: 1367228)
ExecuteEpochTest:test_ExecuteEpochExecuteAccountAfterManyEpochsWithBrokenTime() (gas: 1613317)
ExecuteEpochTest:test_ExecuteEpochExecuteAccountAfterManyEpochsWithBrokenTimeJumpMany() (gas: 1377593)
ExecuteEpochTest:test_ExecuteEpochExecuteEpochAfterEnd() (gas: 1910717)
ExecuteEpochTest:test_ExecuteEpochExecuteEpochExecuteAccountAfterManyEpochs() (gas: 2492323)
ExecuteEpochTest:test_ExecuteEpochExecuteEpochExecuteAccountAfterManyEpochsJumoMany() (gas: 1460710)
ExecuteEpochTest:test_ExecuteEpochExecuteEpochExecuteAccountAfterManyEpochsWithBrokenTime() (gas: 2502709)
ExecuteEpochTest:test_ExecuteEpochExecuteEpochExecuteAccountAfterManyEpochsWithBrokenTimeJumpMany() (gas: 1471052)
ExecuteEpochTest:test_ExecuteEpochNewEpoch() (gas: 1083615)
ExecuteEpochTest:test_ExecuteEpochShouldIncreaseEpoch() (gas: 92277)
ExecuteEpochTest:test_ExecuteEpochShouldIncreasePendingReward() (gas: 252659)
ExecuteEpochTest:test_ExecuteEpochShouldNotIncreaseEpochBeforeEnd() (gas: 38961)
ExecuteEpochTest:test_ExecuteEpochShouldNotIncreaseEpochInMigration() (gas: 149703)
LeaveTest:testDeployment() (gas: 28853)
LeaveTest:test_RevertWhen_NoPendingMigration() (gas: 1311974)
LeaveTest:test_RevertWhen_SenderIsNotVault() (gas: 31740)
LockTest:testDeployment() (gas: 28853)
LockTest:test_NewLockupPeriod() (gas: 1310978)
LockTest:test_RevertWhen_InvalidNewLockupPeriod() (gas: 1285586)
LockTest:test_RevertWhen_InvalidUpdateLockupPeriod() (gas: 1406860)
LockTest:test_RevertWhen_SenderIsNotVault() (gas: 31834)
LockTest:test_ShouldIncreaseBonusMP() (gas: 1293620)
LockTest:test_UpdateLockupPeriod() (gas: 1470415)
MigrateTest:testDeployment() (gas: 28853)
MigrateTest:test_RevertWhen_NoPendingMigration() (gas: 1276097)
MigrateTest:test_RevertWhen_SenderIsNotVault() (gas: 31739)
MigrationInitializeTest:testDeployment() (gas: 28853)
MigrationInitializeTest:test_RevertWhen_MigrationPending() (gas: 5451158)
MigrationStakeManagerTest:testDeployment() (gas: 28853)
MigrationStakeManagerTest:testNewDeployment() (gas: 30992)
MigrationStakeManagerTest:test_ExecuteEpochShouldNotIncreaseEpochInMigration() (gas: 149668)
SetStakeManagerTest:testDeployment() (gas: 9774)
SetStakeManagerTest:test_RevertWhen_InvalidStakeManagerAddress() (gas: 63105)
SetStakeManagerTest:test_SetStakeManager() (gas: 41301)
StakeManagerTest:testDeployment() (gas: 28578)
StakeTest:testDeployment() (gas: 28784)
StakeTest:test_RevertWhen_InvalidLockupPeriod() (gas: 1061162)
StakeTest:test_RevertWhen_Restake() (gas: 1304182)
StakeTest:test_RevertWhen_RestakeWithLock() (gas: 1308012)
StakeTest:test_RevertWhen_SenderIsNotVault() (gas: 32040)
StakeTest:test_RevertWhen_StakeIsTooLow() (gas: 802919)
StakeTest:test_RevertWhen_StakeTokenTransferFails() (gas: 211363)
StakeTest:test_StakeWithLockBonusMP() (gas: 2327824)
StakeTest:test_StakeWithoutLockUpTimeMintsMultiplierPoints() (gas: 1300293)
StakedTokenTest:testStakeToken() (gas: 7619)
UnstakeTest:testDeployment() (gas: 28828)
UnstakeTest:test_RevertWhen_AmountMoreThanBalance() (gas: 1284745)
UnstakeTest:test_RevertWhen_FundsLocked() (gas: 1329288)
StakeManagerTest:testDeployment() (gas: 28625)
StakeTest:testDeployment() (gas: 28831)
StakeTest:test_RevertWhen_InvalidLockupPeriod() (gas: 1057656)
StakeTest:test_RevertWhen_Restake() (gas: 1301092)
StakeTest:test_RevertWhen_RestakeWithLock() (gas: 1304525)
StakeTest:test_RevertWhen_SenderIsNotVault() (gas: 32082)
StakeTest:test_RevertWhen_StakeIsTooLow() (gas: 803915)
StakeTest:test_RevertWhen_StakeTokenTransferFails() (gas: 207758)
StakeTest:test_StakeWithLockBonusMP() (gas: 2323783)
StakeTest:test_StakeWithoutLockUpTimeMintsMultiplierPoints() (gas: 1297379)
StakedTokenTest:testStakeToken() (gas: 7597)
UnstakeTest:testDeployment() (gas: 28875)
UnstakeTest:test_RevertWhen_AmountMoreThanBalance() (gas: 1281609)
UnstakeTest:test_RevertWhen_FundsLocked() (gas: 1325777)
UnstakeTest:test_RevertWhen_SenderIsNotVault() (gas: 31879)
UnstakeTest:test_UnstakeShouldBurnMultiplierPoints() (gas: 6438180)
UnstakeTest:test_UnstakeShouldReturnFund_NoLockUp() (gas: 1306895)
UnstakeTest:test_UnstakeShouldReturnFund_WithLockUp() (gas: 1424419)
UserFlowsTest:testDeployment() (gas: 28806)
UserFlowsTest:test_PendingMPToBeMintedCannotBeGreaterThanTotalSupplyMP(uint8,uint128) (runs: 106, μ: 130825949, ~: 130282915)
UserFlowsTest:test_StakeWithLockUpTimeLocksStake() (gas: 1463005)
UserFlowsTest:test_StakedSupplyShouldIncreaseAndDecreaseAgain() (gas: 2467653)
UnstakeTest:test_UnstakeShouldBurnMultiplierPoints() (gas: 6432067)
UnstakeTest:test_UnstakeShouldReturnFund_NoLockUp() (gas: 1303800)
UnstakeTest:test_UnstakeShouldReturnFund_WithLockUp() (gas: 1387208)
UserFlowsTest:testDeployment() (gas: 28853)
UserFlowsTest:test_PendingMPToBeMintedCannotBeGreaterThanTotalSupplyMP(uint8,uint128) (runs: 114, μ: 130857603, ~: 130246926)
UserFlowsTest:test_StakeWithLockUpTimeLocksStake() (gas: 1425816)
UserFlowsTest:test_StakedSupplyShouldIncreaseAndDecreaseAgain() (gas: 2461484)
VaultFactoryTest:testDeployment() (gas: 9774)
Loading

0 comments on commit 0aa3f2e

Please sign in to comment.