GETTING_STARTED.md

December 3, 2022 ยท View on GitHub

Getting Started

This is a guide to get you started with refcell/femplate.

Installing

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/refcell/femplate
git submodule update --init --recursive
forge install

Run ./utils/rename.sh to rename all instances of femplate with the name of your project/repository.

First time with Forge/Foundry?

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

๐ŸŽ‰ Foundry is installed! ๐ŸŽ‰

Writing Tests with Foundry

With Foundry, all tests are written in Solidity! ๐Ÿฅณ

Create a test file for your contract in the test/ directory.

For example, src/Greeter.sol has its test file defined in ./test/Greeter.t.sol.

To learn more about writing tests in Solidity for Foundry, reference Rari Capital's solmate repository created by @transmissions11.

Configure Foundry

Using foundry.toml, Foundry is easily configurable.

For a full list of configuration options, see the Foundry configuration documentation.

That's it!

Now you are all set up to start building your project with femplate!

Navigate back to the Readme to resume your setup!