Foundry is a blazing-fast, portable, and modular toolkit for Ethereum application development. This guide shows you how to deploy smart contracts to LitVM using Foundry.
[⠊] Compiling...
[⠒] Compiling 1 files with 0.8.19
[⠑] Solc 0.8.19 finished in 1.23s
Compiler run successful!
forge test
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;
import {Test, console} from "forge-std/Test.sol";
import {Counter} from "../src/Counter.sol";
contract CounterTest is Test {
Counter public counter;
function setUp() public {
counter = new Counter();
}
function test_Increment() public {
counter.increment();
assertEq(counter.count(), 1);
}
function test_Decrement() public {
counter.increment();
counter.decrement();
assertEq(counter.count(), 0);
}
function test_SetCount() public {
counter.setCount(100);
assertEq(counter.count(), 100);
}
function testFail_DecrementBelowZero() public {
counter.decrement(); // Should fail
}
}