Home

Awesome

@gemstation/contracts-foundry

Example smart contracts repo for Gemforge using Foundry.

This contains the optimal folder structure for use with Gemforge:

There are two facets provided:

Note: A Hardhat equivalent of this repo is available at https://github.com/gemstation/contracts-hardhat

Requirements

Installation

In an empty folder:

npx gemforge scaffold

Change into the folder and run in order:

$ foundryup  # On OS X you may first need to run: brew install libusb
$ pnpm i
$ git submodule update --init --recursive

Create .env and set the following within:

LOCAL_RPC_URL=http://localhost:8545
SEPOLIA_RPC_URL=<your infura/alchemy endpoint for spolia>
ETHERSCAN_API_KEY=<your etherscan api key>
MNEMONIC=<your deployment wallet mnemonic>

Usage

Run a local dev node in a separate terminal:

pnpm devnet

To build the code:

$ pnpm build

To run the tests:

$ pnpm test

To deploy to the local target:

$ pnpm dep local

To deploy to the testnet target (sepolia):

$ pnpm dep testnet

For verbose output simply add -v:

$ pnpm build -v
$ pnpm dep -v

License

MIT - see LICSENSE.md