Giter Site home page Giter Site logo

foundry-faucet's Introduction

Foundry Faucet

A simple project built using Foundry. This repo contains the implementation of a Faucet contract. You can find the article associated with this repo here.

This repo is created from the forge template.

Getting Started

  • Clone this repo:
git clone https://github.com/PraneshASP/foundry-faucet
  • Install the dependencies/libraries:
git submodule update --init --recursive
forge install

Directory structure

lib
├─ forge-std — https://github.com/brockelmore/forge-std
├─ openzeppelin-contracts — https://github.com/OpenZeppelin/openzeppelin-contracts
src
├─ tests
│  └─ Faucet.t.sol — "Test suite for the faucet"
├─ Facuet.sol — "A Simple Faucet contract implementation"
└─ MockERC20.sol — "A Mock ERC20 token for the faucet"

Development

Compilation

forge build

Testing

forge test

To run tests with console outputs (console.logs()):

forge test -vv

Deployment

Copy the .env.example file to .env and update the values.

Using forge create:

First, deploy the MockERC20 to Kovan:

./scripts/deploy_token_kovan.sh

Then, deploy the Faucet to Kovan:

./scripts/deploy_faucet_kovan.sh

Using scripts:

npm run deploy:forge

Verification

Add your ETHERSCAN_API_KEY to the .env file.

Then execute the scripts/verify_faucet_kovan.sh script.

./scripts/verify_faucet_kovan.sh

License

MIT

Disclaimer

These smart contracts are being provided as is. No guarantee, representation or warranty is being made, express or implied, as to the safety or correctness of the user interface or the smart contracts. They have not been audited and as such there can be no assurance they will work as intended, and users may experience delays, failures, errors, omissions, loss of transmitted information or loss of funds. The creators are not liable for any of the foregoing. Users should proceed with caution and use at their own risk.

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.