smartcontractkit / foundry-starter-kit-old

GNU Affero General Public License v3.0
204 stars 26 forks source link

Note: This is now the old version of this template. Please see the new one here

Foundry Starter Kit


Chainlink Foundry logo


Open in Gitpod

Foundry Starter Kit is a repo that shows developers how to quickly build, test, and deploy smart contracts with one of the fastest frameworks out there, foundry!

This repo is based on the femplate

You can also check out the similar dapptools-starter-kit

Installation

Requirements

And you probably already have make installed... but if not try looking here.

Getting Started / Quickstart

git clone https://github.com/smartcontractkit/foundry-starter-kit.git
cd foundry-starter-kit
make # This installs the project's dependencies.
make test

Testing

make test

or

forge test

Deploying to a network

Deploying is done by a prompt system rather than a flexible single command to run at this time. If you'd like to contribute by writing some scripts to make deploying easier, please do!

Setup

You'll need the following:

Deploying

bash scripts/deploy_<NETWORK>.sh

You'll be prompted for the following:

Enter Your Rinkeby RPC URL:
Example: https://eth-mainnet.alchemyapi.io/v2/XXXXXXXXXX

Which contract do you want to deploy (eg Greeter)?
Enter constructor arguments separated by spaces (eg 1 2 3):

compiling...
success.
Insert private key:
0x<PRIVATE_KEY_HERE>

Full Example:

bash scripts/deploy_rinkeby.sh

Enter Your Rinkeby RPC URL:
https://eth-rinkeby.alchemyapi.io/v2/XXXXXX

Which contract do you want to deploy (eg Greeter)?
PriceFeedConsumer

Enter constructor arguments separated by spaces (eg 1 2 3):
0x8A753747A1Fa494EC906cE90E9f37563A8AF630e

Insert private key:
0xXXXXXXX

Deployer: 0x643315c9be056cdea171f4e7b2222a4ddab9f88d
Deployed to: 0xec8af3f6c8725cc60e6ecc0009ad9e756e9723e0

Contributing

Contributions are always welcome! Open a PR or an issue!

Thank You!

Resources

TODO

[ ] Make deployment more modular like in dapptools-starter-kit

[ ] Enable network & contract choice from the command line

[ ] Add scripts that interact with deployed contracts

[ ] Add documentation for running on a local network with hardhat & a forked network