An open API service indexing awesome lists of open source software.

https://github.com/pooltogether/v5-testnet


https://github.com/pooltogether/v5-testnet

Last synced: about 1 year ago
JSON representation

Awesome Lists containing this project

README

          

# Foundry template

Template to kickstart a Foundry project.

## Getting started

The easiest way to get started is by clicking the [Use this template](https://github.com/pooltogether/foundry-template/generate) button at the top right of this page.

If you prefer to go the CLI way:

```
forge init my-project --template https://github.com/pooltogether/foundry-template
```

## Development

### Installation

You may have to install the following tools to use this repository:

- [Foundry](https://github.com/foundry-rs/foundry) to compile and test contracts
- [direnv](https://direnv.net/) to handle environment variables
- [lcov](https://github.com/linux-test-project/lcov) to generate the code coverage report

Install dependencies:

```
npm i
```

### Env

Copy `.envrc.example` and write down the env variables needed to run this project.

```
cp .envrc.example .envrc
```

Once your env variables are setup, load them with:

```
direnv allow
```

### Compile

Run the following command to compile the contracts:

```
npm run compile
```

### Coverage

Forge is used for coverage, run it with:

```
npm run coverage
```

You can then consult the report by opening `coverage/index.html`:

```
open coverage/index.html
```

### Code quality

[Husky](https://typicode.github.io/husky/#/) is used to run [lint-staged](https://github.com/okonet/lint-staged) and tests when committing.

[Prettier](https://prettier.io) is used to format TypeScript and Solidity code. Use it by running:

```
npm run format
```

[Solhint](https://protofire.github.io/solhint/) is used to lint Solidity files. Run it with:

```
npm run hint
```

### CI

A default Github Actions workflow is setup to execute on push and pull request.

It will build the contracts and run the test coverage.

You can modify it here: [.github/workflows/coverage.yml](.github/workflows/coverage.yml)

For the coverage to work, you will need to setup the `MAINNET_RPC_URL` repository secret in the settings of your Github repository.

## Deployment

### Local

Start `anvil` with the following command: `anvil -m $MNEMONIC`

In another terminal window, run the following command: `npm run deploy:contracts:local`

Then configure the contracts: `npm run deploy:config-contracts:local`

### Testnet

Use one of the following commands to deploy on the testnet of your choice.

#### Ethereum Sepolia

`npm run deploy:contracts:ethSepolia`

Then configure the contracts: `npm run deploy:config-contracts:ethSepolia`

#### Ethereum Goerli

`npm run deploy:contracts:ethGoerli`

Then configure the contracts: `npm run deploy:config-contracts:ethGoerli`

#### Polygon Mumbai

`npm run deploy:contracts:mumbai`

Then configure the contracts: `npm run deploy:config-contracts:mumbai`

### Contract List

To generate the local contract list, run the following command: `npm run gen:local`

To generate the testnet contract list, run the following command: `npm run gen:testnet`