Coder Social home page Coder Social logo

phuson / foundry-starter-kit Goto Github PK

View Code? Open in Web Editor NEW

This project forked from smartcontractkit/foundry-starter-kit-old

1.0 0.0 0.0 324 KB

License: GNU Affero General Public License v3.0

Shell 14.40% Makefile 3.84% JavaScript 1.15% Solidity 80.62%

foundry-starter-kit's Introduction

Foundry Starter Kit


Chainlink Foundry logo


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:

  • RPC URL: A URL to connect to the blockchain. You can get one for free from Alchemy.
  • Private Key: A private key from your wallet. You can get a private key from a new Metamask account
    • Additionally, if you want to deploy to a testnet, you'll need test ETH and/or LINK. You can get them from faucets.chain.link.
  • Constructor Arguments: These are the arguments that you pass to your smart contract on deployment. If you look at the constructor function in each contract, those are the values that they need. If you want some examples, we've provided some in our scripts/helper-config.sh file.
  • Contract: The name of the contract you want to deploy, ie PriceFeedConsumer.

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

foundry-starter-kit's People

Contributors

aelmanaa avatar patrickalphac avatar

Stargazers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.