Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/wighawag/forge-deploy


https://github.com/wighawag/forge-deploy

Last synced: 2 months ago
JSON representation

Awesome Lists containing this project

README

        

# forge-deploy

A cli and associated contracts to keep track of deployments by name and reuse them in solidity.

It tries to keep compatibility with [hardhat-deploy](https://github.com/wighawag/hardhat-deploy) as far as possible (work in progress).

forge-deploy aims at providing the minimal set of function to provide an elegant deployment system for foundry.

## Template to get started:

https://github.com/wighawag/template-foundry

## Features

- generate type-safe deployment function for forge contracts. no need to pass in string of text and hope the abi encoded args are in the correct order or of the correct type.
- save deployments in json file (based on hardhat-deploy schema)
- modular system based on templates and solidity library

## Modularity

The system is modular. The deploy functions provided by default offer a basic set of feature but the system can be extended by custom function easily. See [contracts/DefaultDeployerFunction.sol](./contracts/DefaultDeployerFunction.sol) and how this is a simple library that you can provide yourself. The only thing forge-deploy really provide is the specific set of functions in [contrats/Deployer.sol](./contracts/Deployer.sol) to `save` and `get` deployments

## How to use

There are 2 way to get started, one [without npm](#without-npm) and one [with npm](#with-npm)

### with npm

1. have a forge project with npm and cd into it

```bash
mkdir my-project;
cd my-project;
forge init;
npm init
```

1. add the forge-deploy package

```bash
npm i -D forge-deploy
```

This will install the forge-deploy binary automatically

1. add to .gitignore the generated files

```bash
cat >> .gitignore <> foundry.toml <
```

You could also download the binaries (if you dont want to use cargo): https://github.com/wighawag/forge-deploy/releases

1. add to .gitignore the generated file + the binary we just installed

```bash
cat >> .gitignore <> foundry.toml <> foundry.toml <> .gitignore < script/Deploy.s.sol <