diff --git a/src/output/cast/cast-call b/src/output/cast/cast-call index 9d62261f4..d70b4efb8 100644 --- a/src/output/cast/cast-call +++ b/src/output/cast/cast-call @@ -3,6 +3,6 @@ $ cast call 0x6b175474e89094c44da98b954eedeac495271d0f "totalSupply()(uint256)" --rpc-url https://eth-mainnet.alchemyapi.io/v2/Lc7oIGYeL_QvInzI0Wiu_pOZZDEKBrdf // ANCHOR_END: command // ANCHOR: output -3068594554705130827666987021 [3.068e27] +3034745150676479763720898483 [3.034e27] // ANCHOR_END: output // ANCHOR_END: all diff --git a/src/output/cheatcodes/forge-test-cheatcodes b/src/output/cheatcodes/forge-test-cheatcodes index 5ea4667e8..36a403612 100644 --- a/src/output/cheatcodes/forge-test-cheatcodes +++ b/src/output/cheatcodes/forge-test-cheatcodes @@ -8,8 +8,8 @@ No files changed, compilation skipped Ran 2 tests for test/OwnerUpOnly.t.sol:OwnerUpOnlyTest [PASS] testFail_IncrementAsNotOwner() (gas: 8314) [PASS] test_IncrementAsOwner() (gas: 29161) -Suite result: ok. 2 passed; 0 failed; 0 skipped; finished in 556.16µs (261.83µs CPU time) +Suite result: ok. 2 passed; 0 failed; 0 skipped; finished in 449.40µs (147.65µs CPU time) -Ran 1 test suite in 5.05ms (556.16µs CPU time): 2 tests passed, 0 failed, 0 skipped (2 total tests) +Ran 1 test suite in 4.93ms (449.40µs CPU time): 2 tests passed, 0 failed, 0 skipped (2 total tests) // ANCHOR_END: output // ANCHOR_END: all diff --git a/src/output/cheatcodes/forge-test-cheatcodes-expectrevert b/src/output/cheatcodes/forge-test-cheatcodes-expectrevert index 0abbc8202..ead65844d 100644 --- a/src/output/cheatcodes/forge-test-cheatcodes-expectrevert +++ b/src/output/cheatcodes/forge-test-cheatcodes-expectrevert @@ -7,8 +7,8 @@ No files changed, compilation skipped Ran 1 test for test/OwnerUpOnly.t.sol:OwnerUpOnlyTest [PASS] test_IncrementAsOwner() (gas: 29161) -Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 464.86µs (72.10µs CPU time) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 419.68µs (76.67µs CPU time) -Ran 1 test suite in 4.88ms (464.86µs CPU time): 1 tests passed, 0 failed, 0 skipped (1 total tests) +Ran 1 test suite in 4.91ms (419.68µs CPU time): 1 tests passed, 0 failed, 0 skipped (1 total tests) // ANCHOR_END: output // ANCHOR_END: all diff --git a/src/output/cheatcodes/forge-test-cheatcodes-tracing b/src/output/cheatcodes/forge-test-cheatcodes-tracing index 41e48a769..a16b8bc7e 100644 --- a/src/output/cheatcodes/forge-test-cheatcodes-tracing +++ b/src/output/cheatcodes/forge-test-cheatcodes-tracing @@ -15,8 +15,8 @@ Traces: │ └─ ← [Revert] Unauthorized() └─ ← [Revert] Unauthorized() -Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 430.81µs (69.93µs CPU time) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 485.11µs (72.49µs CPU time) -Ran 1 test suite in 7.11ms (430.81µs CPU time): 1 tests passed, 0 failed, 0 skipped (1 total tests) +Ran 1 test suite in 4.95ms (485.11µs CPU time): 1 tests passed, 0 failed, 0 skipped (1 total tests) // ANCHOR_END: output // ANCHOR_END: all diff --git a/src/output/cheatcodes/forge-test-simple b/src/output/cheatcodes/forge-test-simple index f767d0d99..05d2d7259 100644 --- a/src/output/cheatcodes/forge-test-simple +++ b/src/output/cheatcodes/forge-test-simple @@ -4,13 +4,13 @@ $ forge test --match-test test_IncrementAsOwner // ANCHOR_END: command // ANCHOR: output Compiling 24 files with Solc 0.8.10 -Solc 0.8.10 finished in 1.15s +Solc 0.8.10 finished in 1.14s Compiler run successful! Ran 1 test for test/OwnerUpOnly.t.sol:OwnerUpOnlyTest [PASS] test_IncrementAsOwner() (gas: 29161) -Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 446.95µs (63.24µs CPU time) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 419.24µs (51.86µs CPU time) -Ran 1 test suite in 4.94ms (446.95µs CPU time): 1 tests passed, 0 failed, 0 skipped (1 total tests) +Ran 1 test suite in 4.84ms (419.24µs CPU time): 1 tests passed, 0 failed, 0 skipped (1 total tests) // ANCHOR_END: output // ANCHOR_END: all diff --git a/src/output/deps/forge-install b/src/output/deps/forge-install index 9716c5963..875b02c2e 100644 --- a/src/output/deps/forge-install +++ b/src/output/deps/forge-install @@ -3,7 +3,7 @@ $ forge install transmissions11/solmate // ANCHOR_END: command // ANCHOR: output -Installing solmate in /tmp/tmp.dH3QKReB7L/deps/lib/solmate (url: Some("https://github.com/transmissions11/solmate"), tag: None) +Installing solmate in /tmp/tmp.688D1rxuMB/deps/lib/solmate (url: Some("https://github.com/transmissions11/solmate"), tag: None) Installed solmate // ANCHOR_END: output // ANCHOR_END: all diff --git a/src/output/foundry-template/forge-build b/src/output/foundry-template/forge-build index 4467c60a9..2c04f92c7 100644 --- a/src/output/foundry-template/forge-build +++ b/src/output/foundry-template/forge-build @@ -4,7 +4,7 @@ $ forge build // ANCHOR_END: command // ANCHOR: output Compiling 28 files with Solc 0.8.25 -Solc 0.8.25 finished in 1.36s +Solc 0.8.25 finished in 1.34s Compiler run successful! // ANCHOR_END: output // ANCHOR_END: all diff --git a/src/output/foundry-template/forge-test b/src/output/foundry-template/forge-test index dc1a2a696..5650b8268 100644 --- a/src/output/foundry-template/forge-test +++ b/src/output/foundry-template/forge-test @@ -9,8 +9,8 @@ Ran 3 tests for test/Foo.t.sol:FooTest [PASS] testFork_Example() (gas: 3779) [PASS] testFuzz_Example(uint256) (runs: 1000, μ: 9111, ~: 9111) [PASS] test_Example() (gas: 11861) -Suite result: ok. 3 passed; 0 failed; 0 skipped; finished in 19.30ms (19.24ms CPU time) +Suite result: ok. 3 passed; 0 failed; 0 skipped; finished in 21.62ms (21.42ms CPU time) -Ran 1 test suite in 20.23ms (19.30ms CPU time): 3 tests passed, 0 failed, 0 skipped (3 total tests) +Ran 1 test suite in 22.57ms (21.62ms CPU time): 3 tests passed, 0 failed, 0 skipped (3 total tests) // ANCHOR_END: output // ANCHOR_END: all diff --git a/src/output/fuzz_testing/forge-test-fail-fuzz b/src/output/fuzz_testing/forge-test-fail-fuzz index 0e7392145..c5450fb4e 100644 --- a/src/output/fuzz_testing/forge-test-fail-fuzz +++ b/src/output/fuzz_testing/forge-test-fail-fuzz @@ -4,13 +4,13 @@ $ forge test --allow-failure // ANCHOR_END: command // ANCHOR: output Compiling 1 files with Solc 0.8.10 -Solc 0.8.10 finished in 1.08s +Solc 0.8.10 finished in 1.11s Compiler run successful! Ran 1 test for test/Safe.t.sol:SafeTest -[FAIL: EvmError: Revert; counterexample: calldata=0x29facca70000000000000000000000000000000000000d96d383eccf6b3dbd02772997e8 args=[275621010049270732997116746635240 [2.756e32]]] testFuzz_Withdraw(uint256) (runs: 0, μ: 0, ~: 0) -Suite result: FAILED. 0 passed; 1 failed; 0 skipped; finished in 745.89µs (374.22µs CPU time) +[FAIL: EvmError: Revert; counterexample: calldata=0x29facca70000000000000000000000000000002f8f4586edd6d7cea729964c5bb9a01453 args=[16183711853851041747958787769756475724883 [1.618e40]]] testFuzz_Withdraw(uint256) (runs: 0, μ: 0, ~: 0) +Suite result: FAILED. 0 passed; 1 failed; 0 skipped; finished in 762.95µs (408.45µs CPU time) -Ran 1 test suite in 5.33ms (745.89µs CPU time): 0 tests passed, 1 failed, 0 skipped (1 total tests) +Ran 1 test suite in 5.39ms (762.95µs CPU time): 0 tests passed, 1 failed, 0 skipped (1 total tests) // ANCHOR_END: output // ANCHOR_END: all diff --git a/src/output/fuzz_testing/forge-test-no-fuzz b/src/output/fuzz_testing/forge-test-no-fuzz index 1af9ea207..5d70c25cc 100644 --- a/src/output/fuzz_testing/forge-test-no-fuzz +++ b/src/output/fuzz_testing/forge-test-no-fuzz @@ -4,13 +4,13 @@ $ forge test // ANCHOR_END: command // ANCHOR: output Compiling 24 files with Solc 0.8.10 -Solc 0.8.10 finished in 1.13s +Solc 0.8.10 finished in 1.15s Compiler run successful! Ran 1 test for test/Safe.t.sol:SafeTest [PASS] test_Withdraw() (gas: 19463) -Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 478.24µs (74.53µs CPU time) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 393.78µs (38.23µs CPU time) -Ran 1 test suite in 4.83ms (478.24µs CPU time): 1 tests passed, 0 failed, 0 skipped (1 total tests) +Ran 1 test suite in 5.07ms (393.78µs CPU time): 1 tests passed, 0 failed, 0 skipped (1 total tests) // ANCHOR_END: output // ANCHOR_END: all diff --git a/src/output/fuzz_testing/forge-test-success-fuzz b/src/output/fuzz_testing/forge-test-success-fuzz index 75a451e31..b52082f23 100644 --- a/src/output/fuzz_testing/forge-test-success-fuzz +++ b/src/output/fuzz_testing/forge-test-success-fuzz @@ -4,13 +4,13 @@ $ forge test // ANCHOR_END: command // ANCHOR: output Compiling 1 files with Solc 0.8.10 -Solc 0.8.10 finished in 1.12s +Solc 0.8.10 finished in 1.07s Compiler run successful! Ran 1 test for test/Safe.t.sol:SafeTest -[PASS] testFuzz_Withdraw(uint96) (runs: 257, μ: 19422, ~: 19631) -Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 4.92ms (4.53ms CPU time) +[PASS] testFuzz_Withdraw(uint96) (runs: 257, μ: 19266, ~: 19631) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 5.29ms (4.92ms CPU time) -Ran 1 test suite in 5.95ms (4.92ms CPU time): 1 tests passed, 0 failed, 0 skipped (1 total tests) +Ran 1 test suite in 6.17ms (5.29ms CPU time): 1 tests passed, 0 failed, 0 skipped (1 total tests) // ANCHOR_END: output // ANCHOR_END: all diff --git a/src/output/hello_foundry/forge-build b/src/output/hello_foundry/forge-build index a1849c7e5..d31f2ca2f 100644 --- a/src/output/hello_foundry/forge-build +++ b/src/output/hello_foundry/forge-build @@ -4,7 +4,7 @@ $ forge build // ANCHOR_END: command // ANCHOR: output Compiling 27 files with Solc 0.8.19 -Solc 0.8.19 finished in 1.12s +Solc 0.8.19 finished in 1.09s Compiler run successful! // ANCHOR_END: output // ANCHOR_END: all diff --git a/src/output/hello_foundry/forge-init b/src/output/hello_foundry/forge-init index 9d20ada2e..553021d1b 100644 --- a/src/output/hello_foundry/forge-init +++ b/src/output/hello_foundry/forge-init @@ -3,9 +3,9 @@ $ forge init hello_foundry // ANCHOR_END: command // ANCHOR: output -Initializing /tmp/tmp.MBMAU8aK71/hello_foundry... -Installing forge-std in /tmp/tmp.MBMAU8aK71/hello_foundry/lib/forge-std (url: Some("https://github.com/foundry-rs/forge-std"), tag: None) - Installed forge-std v1.9.2 +Initializing /tmp/tmp.NnQcg2Vq8E/hello_foundry... +Installing forge-std in /tmp/tmp.NnQcg2Vq8E/hello_foundry/lib/forge-std (url: Some("https://github.com/foundry-rs/forge-std"), tag: None) + Installed forge-std v1.9.3 Initialized forge project // ANCHOR_END: output // ANCHOR_END: all diff --git a/src/output/hello_foundry/forge-test b/src/output/hello_foundry/forge-test index 4dfad0c30..6736701a1 100644 --- a/src/output/hello_foundry/forge-test +++ b/src/output/hello_foundry/forge-test @@ -6,10 +6,10 @@ $ forge test No files changed, compilation skipped Ran 2 tests for test/Counter.t.sol:CounterTest -[PASS] testFuzz_SetNumber(uint256) (runs: 256, μ: 31210, ~: 31288) +[PASS] testFuzz_SetNumber(uint256) (runs: 256, μ: 30899, ~: 31288) [PASS] test_Increment() (gas: 31303) -Suite result: ok. 2 passed; 0 failed; 0 skipped; finished in 7.90ms (7.55ms CPU time) +Suite result: ok. 2 passed; 0 failed; 0 skipped; finished in 8.15ms (7.83ms CPU time) -Ran 1 test suite in 8.87ms (7.90ms CPU time): 2 tests passed, 0 failed, 0 skipped (2 total tests) +Ran 1 test suite in 9.00ms (8.15ms CPU time): 2 tests passed, 0 failed, 0 skipped (2 total tests) // ANCHOR_END: output // ANCHOR_END: all diff --git a/src/output/nft_tutorial/forge-test b/src/output/nft_tutorial/forge-test index 852866f39..23ee5c643 100644 --- a/src/output/nft_tutorial/forge-test +++ b/src/output/nft_tutorial/forge-test @@ -14,7 +14,7 @@ Ran 8 tests for test/OpenZeppelinNft.t.sol:OpenZeppelinNftTests [PASS] testMintPricePaid() (gas: 81554) [PASS] testNewMintOwnerRegistered() (gas: 190956) [PASS] testSafeContractReceiver() (gas: 273132) -Suite result: ok. 8 passed; 0 failed; 0 skipped; finished in 1.51ms (1.16ms CPU time) +Suite result: ok. 8 passed; 0 failed; 0 skipped; finished in 1.58ms (1.29ms CPU time) Ran 8 tests for test/SolmateNft.sol:SolmateNftTests [PASS] testBalanceIncremented() (gas: 217400) @@ -25,8 +25,8 @@ Ran 8 tests for test/SolmateNft.sol:SolmateNftTests [PASS] testMintPricePaid() (gas: 81321) [PASS] testNewMintOwnerRegistered() (gas: 190741) [PASS] testSafeContractReceiver() (gas: 272636) -Suite result: ok. 8 passed; 0 failed; 0 skipped; finished in 1.51ms (1.31ms CPU time) +Suite result: ok. 8 passed; 0 failed; 0 skipped; finished in 1.58ms (1.43ms CPU time) -Ran 2 test suites in 5.17ms (3.03ms CPU time): 16 tests passed, 0 failed, 0 skipped (16 total tests) +Ran 2 test suites in 5.10ms (3.16ms CPU time): 16 tests passed, 0 failed, 0 skipped (16 total tests) // ANCHOR_END: output // ANCHOR_END: all diff --git a/src/output/test_filters/forge-test-match-contract-and-test b/src/output/test_filters/forge-test-match-contract-and-test index b197fb844..f7e84d117 100644 --- a/src/output/test_filters/forge-test-match-contract-and-test +++ b/src/output/test_filters/forge-test-match-contract-and-test @@ -4,14 +4,14 @@ $ forge test --match-contract ComplicatedContractTest --match-test test_Deposit // ANCHOR_END: command // ANCHOR: output Compiling 24 files with Solc 0.8.10 -Solc 0.8.10 finished in 1.13s +Solc 0.8.10 finished in 1.11s Compiler run successful! Ran 2 tests for test/ComplicatedContract.t.sol:ComplicatedContractTest [PASS] test_DepositERC20() (gas: 102193) [PASS] test_DepositETH() (gas: 61414) -Suite result: ok. 2 passed; 0 failed; 0 skipped; finished in 1.07ms (1.24ms CPU time) +Suite result: ok. 2 passed; 0 failed; 0 skipped; finished in 1.14ms (1.49ms CPU time) -Ran 1 test suite in 5.34ms (1.07ms CPU time): 2 tests passed, 0 failed, 0 skipped (2 total tests) +Ran 1 test suite in 5.32ms (1.14ms CPU time): 2 tests passed, 0 failed, 0 skipped (2 total tests) // ANCHOR_END: output // ANCHOR_END: all diff --git a/src/output/test_filters/forge-test-match-path b/src/output/test_filters/forge-test-match-path index 21fa750d9..4e261a607 100644 --- a/src/output/test_filters/forge-test-match-path +++ b/src/output/test_filters/forge-test-match-path @@ -4,13 +4,13 @@ $ forge test --match-path test/ContractB.t.sol // ANCHOR_END: command // ANCHOR: output Compiling 1 files with Solc 0.8.10 -Solc 0.8.10 finished in 1.06s +Solc 0.8.10 finished in 1.05s Compiler run successful! Ran 1 test for test/ContractB.t.sol:ContractBTest [PASS] testExample() (gas: 257) -Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 380.23µs (68.07µs CPU time) +Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 316.30µs (54.90µs CPU time) -Ran 1 test suite in 4.91ms (380.23µs CPU time): 1 tests passed, 0 failed, 0 skipped (1 total tests) +Ran 1 test suite in 4.85ms (316.30µs CPU time): 1 tests passed, 0 failed, 0 skipped (1 total tests) // ANCHOR_END: output // ANCHOR_END: all diff --git a/src/reference/cli/forge.md b/src/reference/cli/forge.md index 6dfd58f06..6a6cb8534 100644 --- a/src/reference/cli/forge.md +++ b/src/reference/cli/forge.md @@ -44,7 +44,7 @@ Commands: script Run a smart contract as a script, building transactions that can be sent onchain selectors Function selector utilities [aliases: se] - snapshot Create a snapshot of each test's gas usage [aliases: s] + snapshot Create a gas snapshot of each test's gas usage [aliases: s] soldeer Soldeer dependency manager test Run the project's tests [aliases: t] tree Display a tree visualization of the project's dependency diff --git a/src/reference/cli/forge/coverage.md b/src/reference/cli/forge/coverage.md index c97bdbdc0..7da203273 100644 --- a/src/reference/cli/forge/coverage.md +++ b/src/reference/cli/forge/coverage.md @@ -37,15 +37,8 @@ Options: Print help (see a summary with '-h') Test options: - --debug - Run a test in the debugger. - - The argument passed to this flag is the name of the test function you - want to run, and it works the same as --match-test. - - If more than one test matches your specified criteria, you must add - additional filters until only one test is found (see --match-contract - and --match-path). + --debug [] + Run a single test in the debugger. The matching test will be opened in the debugger regardless of the outcome of the test. @@ -53,29 +46,29 @@ Test options: If the matching test is a fuzz test, then it will open the debugger on the first failure case. If the fuzz test does not fail, it will open the debugger on the last fuzz case. - - For more fine-grained control of which fuzz case is run, see forge - run. --flamegraph - Generate a flamegraph for a single test. Implies `--decode-internal` + Generate a flamegraph for a single test. Implies `--decode-internal`. + + A flame graph is used to visualize which functions or operations + within the smart contract are consuming the most gas overall in a + sorted manner. --flamechart - Generate a flamechart for a single test. Implies `--decode-internal` - - --decode-internal [] - Whether to identify internal functions in traces. + Generate a flamechart for a single test. Implies `--decode-internal`. - If no argument is passed to this flag, it will trace internal - functions scope and decode stack parameters, but parameters stored in - memory (such as bytes or arrays) will not be decoded. + A flame chart shows the gas usage over time, illustrating when each + function is called (execution order) and how much gas it consumes at + each point in the timeline. + + --decode-internal [] + Identify internal functions in traces. - To decode memory parameters, you should pass an argument with a test - function name, similarly to --debug and --match-test. + This will trace internal functions and decode stack parameters. - If more than one test matches your specified criteria, you must add - additional filters until only one test is found (see --match-contract - and --match-path). + Parameters stored in memory (such as bytes or arrays) are currently + decoded only when a single function is matched, similarly to + `--debug`, for performance reasons. --gas-report Print a gas report diff --git a/src/reference/cli/forge/create.md b/src/reference/cli/forge/create.md index e4d3d340d..3291df2d8 100644 --- a/src/reference/cli/forge/create.md +++ b/src/reference/cli/forge/create.md @@ -305,7 +305,7 @@ Wallet options - raw: [default: 5] --delay - Optional delay to apply inbetween verification attempts, in seconds + Optional delay to apply in between verification attempts, in seconds [default: 5] diff --git a/src/reference/cli/forge/script.md b/src/reference/cli/forge/script.md index 1afbb819a..134c624dc 100644 --- a/src/reference/cli/forge/script.md +++ b/src/reference/cli/forge/script.md @@ -471,7 +471,7 @@ Executor environment config: [default: 5] --delay - Optional delay to apply inbetween verification attempts, in seconds + Optional delay to apply in between verification attempts, in seconds [default: 5] diff --git a/src/reference/cli/forge/snapshot.md b/src/reference/cli/forge/snapshot.md index 4fa93ff0a..6bbb1a040 100644 --- a/src/reference/cli/forge/snapshot.md +++ b/src/reference/cli/forge/snapshot.md @@ -1,6 +1,6 @@ # forge snapshot -Create a snapshot of each test's gas usage +Create a gas snapshot of each test's gas usage ```bash $ forge snapshot --help @@ -11,20 +11,20 @@ Usage: forge snapshot [OPTIONS] [PATH] Options: --diff [] - Output a diff against a pre-existing snapshot. + Output a diff against a pre-existing gas snapshot. By default, the comparison is done with .gas-snapshot. --check [] - Compare against a pre-existing snapshot, exiting with code 1 if they - do not match. + Compare against a pre-existing gas snapshot, exiting with code 1 if + they do not match. - Outputs a diff if the snapshots do not match. + Outputs a diff if the gas snapshots do not match. By default, the comparison is done with .gas-snapshot. --snap - Output file for the snapshot + Output file for the gas snapshot [default: .gas-snapshot] @@ -35,15 +35,8 @@ Options: Print help (see a summary with '-h') Test options: - --debug - Run a test in the debugger. - - The argument passed to this flag is the name of the test function you - want to run, and it works the same as --match-test. - - If more than one test matches your specified criteria, you must add - additional filters until only one test is found (see --match-contract - and --match-path). + --debug [] + Run a single test in the debugger. The matching test will be opened in the debugger regardless of the outcome of the test. @@ -51,29 +44,29 @@ Test options: If the matching test is a fuzz test, then it will open the debugger on the first failure case. If the fuzz test does not fail, it will open the debugger on the last fuzz case. - - For more fine-grained control of which fuzz case is run, see forge - run. --flamegraph - Generate a flamegraph for a single test. Implies `--decode-internal` + Generate a flamegraph for a single test. Implies `--decode-internal`. + + A flame graph is used to visualize which functions or operations + within the smart contract are consuming the most gas overall in a + sorted manner. --flamechart - Generate a flamechart for a single test. Implies `--decode-internal` - - --decode-internal [] - Whether to identify internal functions in traces. + Generate a flamechart for a single test. Implies `--decode-internal`. - If no argument is passed to this flag, it will trace internal - functions scope and decode stack parameters, but parameters stored in - memory (such as bytes or arrays) will not be decoded. + A flame chart shows the gas usage over time, illustrating when each + function is called (execution order) and how much gas it consumes at + each point in the timeline. + + --decode-internal [] + Identify internal functions in traces. - To decode memory parameters, you should pass an argument with a test - function name, similarly to --debug and --match-test. + This will trace internal functions and decode stack parameters. - If more than one test matches your specified criteria, you must add - additional filters until only one test is found (see --match-contract - and --match-path). + Parameters stored in memory (such as bytes or arrays) are currently + decoded only when a single function is matched, similarly to + `--debug`, for performance reasons. --gas-report Print a gas report diff --git a/src/reference/cli/forge/test.md b/src/reference/cli/forge/test.md index 127611c88..faabfdb5c 100644 --- a/src/reference/cli/forge/test.md +++ b/src/reference/cli/forge/test.md @@ -14,15 +14,8 @@ Options: Print help (see a summary with '-h') Test options: - --debug - Run a test in the debugger. - - The argument passed to this flag is the name of the test function you - want to run, and it works the same as --match-test. - - If more than one test matches your specified criteria, you must add - additional filters until only one test is found (see --match-contract - and --match-path). + --debug [] + Run a single test in the debugger. The matching test will be opened in the debugger regardless of the outcome of the test. @@ -30,29 +23,29 @@ Test options: If the matching test is a fuzz test, then it will open the debugger on the first failure case. If the fuzz test does not fail, it will open the debugger on the last fuzz case. - - For more fine-grained control of which fuzz case is run, see forge - run. --flamegraph - Generate a flamegraph for a single test. Implies `--decode-internal` + Generate a flamegraph for a single test. Implies `--decode-internal`. + + A flame graph is used to visualize which functions or operations + within the smart contract are consuming the most gas overall in a + sorted manner. --flamechart - Generate a flamechart for a single test. Implies `--decode-internal` - - --decode-internal [] - Whether to identify internal functions in traces. + Generate a flamechart for a single test. Implies `--decode-internal`. - If no argument is passed to this flag, it will trace internal - functions scope and decode stack parameters, but parameters stored in - memory (such as bytes or arrays) will not be decoded. + A flame chart shows the gas usage over time, illustrating when each + function is called (execution order) and how much gas it consumes at + each point in the timeline. + + --decode-internal [] + Identify internal functions in traces. - To decode memory parameters, you should pass an argument with a test - function name, similarly to --debug and --match-test. + This will trace internal functions and decode stack parameters. - If more than one test matches your specified criteria, you must add - additional filters until only one test is found (see --match-contract - and --match-path). + Parameters stored in memory (such as bytes or arrays) are currently + decoded only when a single function is matched, similarly to + `--debug`, for performance reasons. --gas-report Print a gas report diff --git a/src/reference/cli/forge/verify-check.md b/src/reference/cli/forge/verify-check.md index 79cf3c0d9..5cbd84433 100644 --- a/src/reference/cli/forge/verify-check.md +++ b/src/reference/cli/forge/verify-check.md @@ -24,7 +24,7 @@ Options: [default: 5] --delay - Optional delay to apply inbetween verification attempts, in seconds + Optional delay to apply in between verification attempts, in seconds [default: 5] diff --git a/src/reference/cli/forge/verify-contract.md b/src/reference/cli/forge/verify-contract.md index 99a78b24f..5ab3927ab 100644 --- a/src/reference/cli/forge/verify-contract.md +++ b/src/reference/cli/forge/verify-contract.md @@ -113,7 +113,7 @@ Options: [default: 5] --delay - Optional delay to apply inbetween verification attempts, in seconds + Optional delay to apply in between verification attempts, in seconds [default: 5]