Skip to content

Commit

Permalink
chore(foundry.toml): update fuzzing settings
Browse files Browse the repository at this point in the history
  • Loading branch information
3esmit committed Sep 22, 2024
1 parent 2a90b3e commit 832789e
Show file tree
Hide file tree
Showing 3 changed files with 99 additions and 100 deletions.
30 changes: 15 additions & 15 deletions .gas-report
Original file line number Diff line number Diff line change
Expand Up @@ -8,30 +8,30 @@
| MAX_LOCKUP_PERIOD | 361 | 361 | 361 | 361 | 4 |
| MIN_LOCKUP_PERIOD | 287 | 287 | 287 | 287 | 12 |
| YEAR | 263 | 263 | 263 | 263 | 1 |
| accounts | 1597 | 1597 | 1597 | 1597 | 23368 |
| accounts | 1597 | 1597 | 1597 | 1597 | 12050 |
| calculateMPToMint | 740 | 740 | 740 | 740 | 4 |
| currentEpoch | 406 | 1691 | 2406 | 2406 | 28 |
| epochEnd | 627 | 639 | 627 | 4627 | 635 |
| epochEnd | 627 | 643 | 627 | 4627 | 480 |
| epochReward | 1403 | 2903 | 1403 | 5903 | 3 |
| executeAccount | 28897 | 95321 | 95004 | 171987 | 20929 |
| executeEpoch | 23436 | 169158 | 164483 | 204283 | 574 |
| isVault | 540 | 570 | 540 | 2540 | 18426 |
| executeAccount | 28897 | 95914 | 95004 | 171987 | 9611 |
| executeEpoch | 23436 | 170888 | 187183 | 204283 | 419 |
| isVault | 540 | 575 | 540 | 2540 | 7108 |
| lock | 23840 | 23840 | 23840 | 23840 | 1 |
| migrateTo | 23869 | 23875 | 23875 | 23881 | 2 |
| migration | 439 | 1439 | 1439 | 2439 | 4 |
| migrationInitialize | 24602 | 24602 | 24602 | 24602 | 1 |
| owner | 2432 | 2432 | 2432 | 2432 | 13 |
| pendingMPToBeMinted | 364 | 364 | 364 | 364 | 512 |
| pendingMPToBeMinted | 364 | 364 | 364 | 364 | 202 |
| pendingReward | 364 | 1398 | 2364 | 2364 | 29 |
| previousManager | 275 | 275 | 275 | 275 | 13 |
| setVault | 46239 | 46239 | 46239 | 46239 | 280 |
| setVault | 46239 | 46239 | 46239 | 46239 | 125 |
| stake | 23983 | 23983 | 23983 | 23983 | 1 |
| stakeRewardEstimate | 436 | 2269 | 2436 | 2436 | 12 |
| stakedToken | 273 | 273 | 273 | 273 | 18442 |
| stakedToken | 273 | 273 | 273 | 273 | 7124 |
| startMigration | 108037 | 108045 | 108049 | 108049 | 3 |
| totalSupply | 740 | 1921 | 2740 | 2740 | 22 |
| totalSupplyBalance | 385 | 1785 | 2385 | 2385 | 20 |
| totalSupplyMP | 385 | 437 | 385 | 2385 | 533 |
| totalSupplyMP | 385 | 510 | 385 | 2385 | 223 |
| unstake | 23819 | 23819 | 23819 | 23819 | 1 |


Expand All @@ -40,7 +40,7 @@
| Deployment Cost | Deployment Size | | | | |
| 0 | 0 | | | | |
| Function Name | min | avg | median | max | # calls |
| getExpiredMP | 2427 | 2427 | 2427 | 2427 | 630 |
| getExpiredMP | 2427 | 2427 | 2427 | 2427 | 475 |
| transferOwnership | 28533 | 28533 | 28533 | 28533 | 1 |


Expand All @@ -52,8 +52,8 @@
| acceptMigration | 35258 | 35258 | 35258 | 35258 | 2 |
| leave | 35244 | 35244 | 35244 | 35244 | 1 |
| lock | 45192 | 73900 | 66395 | 158442 | 7 |
| owner | 362 | 362 | 362 | 362 | 18425 |
| stake | 27265 | 268849 | 267631 | 353862 | 18430 |
| owner | 362 | 362 | 362 | 362 | 7107 |
| stake | 27265 | 268924 | 267631 | 353862 | 7112 |
| stakedToken | 212 | 212 | 212 | 212 | 2 |
| unstake | 42163 | 92598 | 80285 | 207456 | 11 |

Expand All @@ -63,7 +63,7 @@
| Deployment Cost | Deployment Size | | | | |
| 0 | 0 | | | | |
| Function Name | min | avg | median | max | # calls |
| createVault | 696531 | 696531 | 696531 | 696531 | 18429 |
| createVault | 696531 | 696531 | 696531 | 696531 | 7111 |
| setStakeManager | 23710 | 26669 | 26076 | 30222 | 3 |
| stakeManager | 368 | 1868 | 2368 | 2368 | 4 |

Expand All @@ -73,8 +73,8 @@
| Deployment Cost | Deployment Size | | | | |
| 0 | 0 | | | | |
| Function Name | min | avg | median | max | # calls |
| approve | 46175 | 46198 | 46199 | 46211 | 18425 |
| balanceOf | 561 | 603 | 561 | 2561 | 43385 |
| approve | 46175 | 46198 | 46199 | 46211 | 7107 |
| balanceOf | 561 | 621 | 561 | 2561 | 20439 |


| script/Deploy.s.sol:Deploy contract | | | | | |
Expand Down
80 changes: 40 additions & 40 deletions .gas-snapshot
Original file line number Diff line number Diff line change
@@ -1,57 +1,57 @@
CreateVaultTest:testDeployment() (gas: 9774)
CreateVaultTest:test_createVault() (gas: 692936)
CreateVaultTest:test_createVault() (gas: 714000)
ExecuteAccountTest:testDeployment() (gas: 28742)
ExecuteAccountTest:test_ExecuteAccountLimit() (gas: 1318328)
ExecuteAccountTest:test_ExecuteAccountMintMP() (gas: 3861122)
ExecuteAccountTest:test_RevertWhen_InvalidLimitEpoch() (gas: 1154383)
ExecuteAccountTest:test_ShouldNotMintMoreThanCap() (gas: 110701476)
ExecuteAccountTest:test_ExecuteAccountLimit() (gas: 1624826)
ExecuteAccountTest:test_ExecuteAccountMintMP() (gas: 5410346)
ExecuteAccountTest:test_RevertWhen_InvalidLimitEpoch() (gas: 1292635)
ExecuteAccountTest:test_ShouldNotMintMoreThanCap() (gas: 338282264)
ExecuteEpochTest:testDeployment() (gas: 28720)
ExecuteEpochTest:testNewDeployment() (gas: 30815)
ExecuteEpochTest:test_ExecuteEpochShouldIncreaseEpoch() (gas: 94810)
ExecuteEpochTest:test_ExecuteEpochShouldIncreasePendingReward() (gas: 253041)
ExecuteEpochTest:test_ExecuteEpochShouldNotIncreaseEpochBeforeEnd() (gas: 17972)
ExecuteEpochTest:test_ExecuteEpochShouldNotIncreaseEpochInMigration() (gas: 105698)
ExecuteEpochTest:test_ExecuteEpochShouldIncreaseEpoch() (gas: 119862)
ExecuteEpochTest:test_ExecuteEpochShouldIncreasePendingReward() (gas: 278283)
ExecuteEpochTest:test_ExecuteEpochShouldNotIncreaseEpochBeforeEnd() (gas: 43024)
ExecuteEpochTest:test_ExecuteEpochShouldNotIncreaseEpochInMigration() (gas: 154182)
LeaveTest:testDeployment() (gas: 28720)
LeaveTest:test_RevertWhen_NoPendingMigration() (gas: 1154639)
LeaveTest:test_RevertWhen_SenderIsNotVault() (gas: 10750)
LeaveTest:test_RevertWhen_NoPendingMigration() (gas: 1329923)
LeaveTest:test_RevertWhen_SenderIsNotVault() (gas: 31942)
LockTest:testDeployment() (gas: 28720)
LockTest:test_NewLockupPeriod() (gas: 1143197)
LockTest:test_RevertWhen_InvalidNewLockupPeriod() (gas: 1134814)
LockTest:test_RevertWhen_InvalidUpdateLockupPeriod() (gas: 1229677)
LockTest:test_RevertWhen_SenderIsNotVault() (gas: 10630)
LockTest:test_ShouldIncreaseBonusMP() (gas: 1123297)
LockTest:test_UpdateLockupPeriod() (gas: 1260010)
LockTest:test_NewLockupPeriod() (gas: 1332993)
LockTest:test_RevertWhen_InvalidNewLockupPeriod() (gas: 1305322)
LockTest:test_RevertWhen_InvalidUpdateLockupPeriod() (gas: 1444177)
LockTest:test_RevertWhen_SenderIsNotVault() (gas: 31834)
LockTest:test_ShouldIncreaseBonusMP() (gas: 1315569)
LockTest:test_UpdateLockupPeriod() (gas: 1588106)
MigrateTest:testDeployment() (gas: 28720)
MigrateTest:test_RevertWhen_NoPendingMigration() (gas: 1152278)
MigrateTest:test_RevertWhen_SenderIsNotVault() (gas: 10750)
MigrateTest:test_RevertWhen_NoPendingMigration() (gas: 1293998)
MigrateTest:test_RevertWhen_SenderIsNotVault() (gas: 31954)
MigrationInitializeTest:testDeployment() (gas: 28720)
MigrationInitializeTest:test_RevertWhen_MigrationPending() (gas: 5506950)
MigrationInitializeTest:test_RevertWhen_MigrationPending() (gas: 6117874)
MigrationStakeManagerTest:testDeployment() (gas: 28720)
MigrationStakeManagerTest:testNewDeployment() (gas: 30859)
MigrationStakeManagerTest:test_ExecuteEpochShouldNotIncreaseEpochInMigration() (gas: 105686)
MigrationStakeManagerTest:test_ExecuteEpochShouldNotIncreaseEpochInMigration() (gas: 154170)
SetStakeManagerTest:testDeployment() (gas: 9774)
SetStakeManagerTest:test_RevertWhen_InvalidStakeManagerAddress() (gas: 20481)
SetStakeManagerTest:test_SetStakeManager() (gas: 19869)
SetStakeManagerTest:test_RevertWhen_InvalidStakeManagerAddress() (gas: 63105)
SetStakeManagerTest:test_SetStakeManager() (gas: 41301)
StakeManagerTest:testDeployment() (gas: 28492)
StakeTest:testDeployment() (gas: 28698)
StakeTest:test_RevertWhen_InvalidLockupPeriod() (gas: 892168)
StakeTest:test_RevertWhen_Restake() (gas: 1157929)
StakeTest:test_RevertWhen_RestakeWithLock() (gas: 1159442)
StakeTest:test_RevertWhen_SenderIsNotVault() (gas: 10674)
StakeTest:test_RevertWhen_StakeIsTooLow() (gas: 745276)
StakeTest:test_RevertWhen_StakeTokenTransferFails() (gas: 175040)
StakeTest:test_StakeWithLockBonusMP() (gas: 2023009)
StakeTest:test_StakeWithoutLockUpTimeMintsMultiplierPoints() (gas: 1028803)
StakeTest:test_RevertWhen_InvalidLockupPeriod() (gas: 1084628)
StakeTest:test_RevertWhen_Restake() (gas: 1320817)
StakeTest:test_RevertWhen_RestakeWithLock() (gas: 1324854)
StakeTest:test_RevertWhen_SenderIsNotVault() (gas: 32018)
StakeTest:test_RevertWhen_StakeIsTooLow() (gas: 819736)
StakeTest:test_RevertWhen_StakeTokenTransferFails() (gas: 211363)
StakeTest:test_StakeWithLockBonusMP() (gas: 2363509)
StakeTest:test_StakeWithoutLockUpTimeMintsMultiplierPoints() (gas: 1325221)
StakedTokenTest:testStakeToken() (gas: 7616)
UnstakeTest:testDeployment() (gas: 28742)
UnstakeTest:test_RevertWhen_AmountMoreThanBalance() (gas: 1132893)
UnstakeTest:test_RevertWhen_FundsLocked() (gas: 1158045)
UnstakeTest:test_RevertWhen_SenderIsNotVault() (gas: 10653)
UnstakeTest:test_UnstakeShouldBurnMultiplierPoints() (gas: 5535329)
UnstakeTest:test_UnstakeShouldReturnFund_NoLockUp() (gas: 1026305)
UnstakeTest:test_UnstakeShouldReturnFund_WithLockUp() (gas: 1113953)
UnstakeTest:test_RevertWhen_AmountMoreThanBalance() (gas: 1301377)
UnstakeTest:test_RevertWhen_FundsLocked() (gas: 1348133)
UnstakeTest:test_RevertWhen_SenderIsNotVault() (gas: 31857)
UnstakeTest:test_UnstakeShouldBurnMultiplierPoints() (gas: 7409934)
UnstakeTest:test_UnstakeShouldReturnFund_NoLockUp() (gas: 1322723)
UnstakeTest:test_UnstakeShouldReturnFund_WithLockUp() (gas: 1422611)
UserFlowsTest:testDeployment() (gas: 28720)
UserFlowsTest:test_PendingMPToBeMintedCannotBeGreaterThanTotalSupplyMP(uint8) (runs: 1000, μ: 70728281, ~: 30142776)
UserFlowsTest:test_StakeWithLockUpTimeLocksStake() (gas: 1114841)
UserFlowsTest:test_StakedSupplyShouldIncreaseAndDecreaseAgain() (gas: 1950367)
UserFlowsTest:test_PendingMPToBeMintedCannotBeGreaterThanTotalSupplyMP(uint8) (runs: 101, μ: 80806306, ~: 32532337)
UserFlowsTest:test_StakeWithLockUpTimeLocksStake() (gas: 1465703)
UserFlowsTest:test_StakedSupplyShouldIncreaseAndDecreaseAgain() (gas: 2501869)
VaultFactoryTest:testDeployment() (gas: 9774)
89 changes: 44 additions & 45 deletions foundry.toml
Original file line number Diff line number Diff line change
@@ -1,56 +1,55 @@
# Full reference https://github.com/foundry-rs/foundry/tree/master/config

[profile.default]
auto_detect_solc = false
block_timestamp = 1_680_220_800 # March 31, 2023 at 00:00 GMT
bytecode_hash = "none"
cbor_metadata = false
evm_version = "paris"
fuzz = { runs = 1_000 }
gas_reports = ["*"]
libs = ["lib"]
optimizer = true
optimizer_runs = 10_000
out = "out"
script = "script"
solc = "0.8.20"
src = "contracts"
test = "test"
auto_detect_solc = false
block_timestamp = 1_680_220_800 # March 31, 2023 at 00:00 GMT
bytecode_hash = "none"
cbor_metadata = false
evm_version = "paris"
fuzz = { runs = 10 }
gas_reports = ["*"]
libs = ["lib"]
optimizer = true
optimizer_runs = 10_000
out = "out"
script = "script"
solc = "0.8.20"
src = "contracts"
test = "test"

[profile.ci]
fuzz = { runs = 10_000 }
verbosity = 4
fuzz = { runs = 100 }
verbosity = 4

[etherscan]
arbitrum_one = { key = "${API_KEY_ARBISCAN}" }
avalanche = { key = "${API_KEY_SNOWTRACE}" }
bnb_smart_chain = { key = "${API_KEY_BSCSCAN}" }
gnosis_chain = { key = "${API_KEY_GNOSISSCAN}" }
goerli = { key = "${API_KEY_ETHERSCAN}" }
mainnet = { key = "${API_KEY_ETHERSCAN}" }
optimism = { key = "${API_KEY_OPTIMISTIC_ETHERSCAN}" }
polygon = { key = "${API_KEY_POLYGONSCAN}" }
sepolia = { key = "${API_KEY_ETHERSCAN}" }
arbitrum_one = { key = "${API_KEY_ARBISCAN}" }
avalanche = { key = "${API_KEY_SNOWTRACE}" }
bnb_smart_chain = { key = "${API_KEY_BSCSCAN}" }
gnosis_chain = { key = "${API_KEY_GNOSISSCAN}" }
goerli = { key = "${API_KEY_ETHERSCAN}" }
mainnet = { key = "${API_KEY_ETHERSCAN}" }
optimism = { key = "${API_KEY_OPTIMISTIC_ETHERSCAN}" }
polygon = { key = "${API_KEY_POLYGONSCAN}" }
sepolia = { key = "${API_KEY_ETHERSCAN}" }

[fmt]
bracket_spacing = true
int_types = "long"
line_length = 120
multiline_func_header = "all"
number_underscore = "thousands"
quote_style = "double"
tab_width = 4
wrap_comments = true
bracket_spacing = true
int_types = "long"
line_length = 120
multiline_func_header = "all"
number_underscore = "thousands"
quote_style = "double"
tab_width = 4
wrap_comments = true

[rpc_endpoints]
arbitrum_one = "https://arbitrum-mainnet.infura.io/v3/${API_KEY_INFURA}"
avalanche = "https://avalanche-mainnet.infura.io/v3/${API_KEY_INFURA}"
bnb_smart_chain = "https://bsc-dataseed.binance.org"
gnosis_chain = "https://rpc.gnosischain.com"
goerli = "https://goerli.infura.io/v3/${API_KEY_INFURA}"
localhost = "http://localhost:8545"
mainnet = "https://eth-mainnet.g.alchemy.com/v2/${API_KEY_ALCHEMY}"
optimism = "https://optimism-mainnet.infura.io/v3/${API_KEY_INFURA}"
polygon = "https://polygon-mainnet.infura.io/v3/${API_KEY_INFURA}"
sepolia = "https://sepolia.infura.io/v3/${API_KEY_INFURA}"

arbitrum_one = "https://arbitrum-mainnet.infura.io/v3/${API_KEY_INFURA}"
avalanche = "https://avalanche-mainnet.infura.io/v3/${API_KEY_INFURA}"
bnb_smart_chain = "https://bsc-dataseed.binance.org"
gnosis_chain = "https://rpc.gnosischain.com"
goerli = "https://goerli.infura.io/v3/${API_KEY_INFURA}"
localhost = "http://localhost:8545"
mainnet = "https://eth-mainnet.g.alchemy.com/v2/${API_KEY_ALCHEMY}"
optimism = "https://optimism-mainnet.infura.io/v3/${API_KEY_INFURA}"
polygon = "https://polygon-mainnet.infura.io/v3/${API_KEY_INFURA}"
sepolia = "https://sepolia.infura.io/v3/${API_KEY_INFURA}"

0 comments on commit 832789e

Please sign in to comment.