diff --git a/src/MyContract.sol b/src/MyContract.sol new file mode 100644 index 00000000..1b279360 --- /dev/null +++ b/src/MyContract.sol @@ -0,0 +1,10 @@ +// src/MyContract.sol +pragma solidity ^0.8.0; + +contract MyContract { + // Existing functions and variables + + function newFunction() public pure returns (string memory) { + return "Hello, Farcaster!"; + } +} diff --git a/test/TestMyContract.t.sol b/test/TestMyContract.t.sol new file mode 100644 index 00000000..3871d967 --- /dev/null +++ b/test/TestMyContract.t.sol @@ -0,0 +1,18 @@ +// test/TestMyContract.t.sol +pragma solidity ^0.8.0; + +import "forge-std/Test.sol"; +import "../src/MyContract.sol"; + +contract TestMyContract is Test { + MyContract myContract; + + function setUp() public { + myContract = new MyContract(); + } + + function testNewFunction() public { + string memory result = myContract.newFunction(); + assertEq(result, "Hello, Farcaster!"); + } +}