A very simple foundry template for optimal contract testing.
Click use this template
to create a new repository with this repo as the initial state.
Or, if your repo already exists, run:
forge init --template https://github.com/z0r0z/zenplate
git submodule update --init --recursive
forge install
Run ./utils/rename.sh
to rename all instances of zenplate
with the name of your project/repository.
See the official Foundry installation instructions.
Then, install the foundry toolchain installer (foundryup
) with:
curl -L https://foundry.paradigm.xyz | bash
Now that you've installed the foundryup
binary,
anytime you need to get the latest forge
or cast
binaries,
you can run foundryup
.
So, simply execute:
foundryup
Build the foundry project with forge build
. Run tests with forge test
. Measure gas with forge snapshot
. Format with forge fmt
.
This template comes with GitHub Actions pre-configured. Your contracts will be linted and tested on every push and pull
request made to the main
branch.
You can edit the CI script in .github/workflows/ci.yml.
lib
├─ forge-std — https://github.com/foundry-rs/forge-std
scripts
├─ Deploy.s.sol — Example Contract Deployment Script
src
├─ Tester — Test Contract
test
└─ Tester.t - Testing Contract
These smart contracts are being provided as is. No guarantee, representation or warranty is being made, express or implied, as to the safety or correctness of the user interface or the smart contracts. They have not been audited and as such there can be no assurance they will work as intended, and users may experience delays, failures, errors, omissions, loss of transmitted information or loss of funds. The creators are not liable for any of the foregoing. Users should proceed with caution and use at their own risk.
See LICENSE for more details.