pcaversaccio / createx

Factory smart contract to make easier and safer usage of the `CREATE` and `CREATE2` EVM opcodes as well as of `CREATE3`-based (i.e. without an initcode factor) contract creations.
https://createx.rocks
GNU Affero General Public License v3.0
304 stars 18 forks source link

♻️ Fix Fuzz Edge Case in `setNonce` #36

Closed pcaversaccio closed 10 months ago

pcaversaccio commented 10 months ago

🕓 Changelog

This PR fixes an edge case in the fuzz tests using the cheat code vm.setNonceUnsafe to prevent the following error (example):

[FAIL. Reason: new nonce (0) must be strictly equal to or higher than the account's current nonce (4); counterexample: calldata=0x03b1537b0000000000000000000000001804c8ab1f12e6bbf3894d4083f33e07309d1f380000000000000000000000000000000000000000000000000000000000000000 args=[0x1804c8AB1F12E6bbf3894d4083f33e07309d1f38, 0]] testFuzz_WhenTheNonceValueDoesNotExceed18446744073709551614(address,uint64) (runs: 5443, μ: 2369694, ~: 2369752)

I also bump some submodules and outdated dependencies (i.e. ethers, @typescript-eslint/eslint-plugin, and @typescript-eslint/parser) in the package.json and pnpm-lock.yaml file.

🐶 Cute Animal Picture

image

github-actions[bot] commented 10 months ago

Coverage after merging fix-fuzz-edge-case into main will be

100.00%

Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
src
   CreateX.sol100%100%100%100%
pcaversaccio commented 10 months ago

Note: The code changes committed to this PR have been merged as part of https://github.com/pcaversaccio/createx/pull/40.