From 2eadcd54706b6d20c90d1ae4a0dad91004b1a371 Mon Sep 17 00:00:00 2001 From: Ben DiFrancesco Date: Fri, 7 Nov 2025 16:29:22 -0500 Subject: [PATCH 1/2] Bump forge-std to v1.11.0 --- foundry.lock | 8 ++++++++ lib/forge-std | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 foundry.lock diff --git a/foundry.lock b/foundry.lock new file mode 100644 index 0000000..fee8a95 --- /dev/null +++ b/foundry.lock @@ -0,0 +1,8 @@ +{ + "lib/forge-std": { + "tag": { + "name": "v1.11.0", + "rev": "8e40513d678f392f398620b3ef2b418648b33e89" + } + } +} \ No newline at end of file diff --git a/lib/forge-std b/lib/forge-std index 77041d2..8e40513 160000 --- a/lib/forge-std +++ b/lib/forge-std @@ -1 +1 @@ -Subproject commit 77041d2ce690e692d6e03cc812b57d1ddaa4d505 +Subproject commit 8e40513d678f392f398620b3ef2b418648b33e89 From 3907e5bfcf5db9dbb4b7aa9add8284d49ed89df7 Mon Sep 17 00:00:00 2001 From: Ben DiFrancesco Date: Fri, 7 Nov 2025 16:38:21 -0500 Subject: [PATCH 2/2] Update template imports to avoid warnings These changes resolve warnings on unused imports in the test file. In one case, the import of console2, we suppress the warning because it's convenient to leave console2 imported in test files even if not actively used, so it doesn't first have to be imported by the dev when debugging. Second, we change the deploy script to return the Counter rather than store it locally. This change resolves the import issue in an opinionated way: it's better for the script to be stateless anyway. --- script/Deploy.s.sol | 6 ++---- test/Counter.t.sol | 8 ++++++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/script/Deploy.s.sol b/script/Deploy.s.sol index ba4691e..f009f18 100644 --- a/script/Deploy.s.sol +++ b/script/Deploy.s.sol @@ -7,10 +7,8 @@ import {Script} from "forge-std/Script.sol"; import {Counter} from "src/Counter.sol"; contract Deploy is Script { - Counter counter; - - function run() public { + function run() public returns (Counter _counter) { vm.broadcast(); - counter = new Counter(); + _counter = new Counter(); } } diff --git a/test/Counter.t.sol b/test/Counter.t.sol index a2558a5..651040f 100644 --- a/test/Counter.t.sol +++ b/test/Counter.t.sol @@ -1,13 +1,17 @@ // SPDX-License-Identifier: UNLICENSED pragma solidity 0.8.30; -import {Test, console2} from "forge-std/Test.sol"; +/// forge-lint: disable-next-line(unused-import) +import {console2} from "forge-std/Test.sol"; +import {Test} from "forge-std/Test.sol"; import {Deploy} from "script/Deploy.s.sol"; import {Counter} from "src/Counter.sol"; contract CounterTest is Test, Deploy { + Counter counter; + function setUp() public { - Deploy.run(); + counter = Deploy.run(); } }