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 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(); } }