Code Monkey home page Code Monkey logo

forge-erc20-template's Introduction

forge-erc20 • tests lints GitHub GitHub package.json version

Template for Forge based on femplate and forge-template with ERC-20 example tests.

Getting Started

Click use this template on Github to create a new repository with this repo as the initial state.

Or run (also works for existing projects):

forge init --template https://github.com/soliditylabs/forge-erc20-template
git submodule update --init --recursive
forge install

Blueprint

lib
├─ ds-test — https://github.com/dapphub/ds-test
├─ forge-std — https://github.com/brockelmore/forge-std
├─ openzeppelin-contracts — https://github.com/OpenZeppelin/openzeppelin-contracts
src
├─ tests
│  └─ MyERC20.t — "ERC-20 Transfer Tests"
└─ MyERC20"A Minimal ERC-20 Contract"

Development

Building

forge build

Testing

forge test -vvvvv

Deployment & Verification

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

To deploy the ERC-20 to Rinkeby:

./scripts/deploy-to-rinkeby.sh

To verify the ERC-20 on Rinkeby:

./scripts/deploy-to-rinkeby.sh

First time with Forge/Foundry?

See the official Foundry installation instructions.

Then, install the foundry toolchain installer (foundryup) with:

curl -L https://foundry.paradigm.xyz | bash

Now that you've installed the foundryup binary, anytime you need to get the latest forge or cast binaries, you can run foundryup.

So, simply execute:

foundryup

🎉 Foundry is installed! 🎉

Writing Tests with Foundry

With Foundry, tests are written in Solidity! 🥳

Create a test file for your contract in the src/tests/ directory.

For example, src/MyERC20.sol has its test file defined in ./src/tests/MyERC20.t.sol.

Configure Foundry

Using foundry.toml, Foundry is easily configurable.

For a full list of configuration options, see the Foundry configuration documentation.

License

MIT

Acknowledgements

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.

forge-erc20-template's People

Contributors

gorgos avatar

Stargazers

Abel avatar Archimedes avatar Thelle Codes avatar Alderian Annatar avatar  avatar An-E IOSI avatar Jason Schwarz avatar Ehsan avatar  avatar Daniel Zarifpour avatar  avatar App Service avatar Maicon Moreira avatar Ivy Langstaff avatar Mu-Jing-Tsai avatar nslogx avatar NO MORE CODING avatar linchuan avatar Henry Hz avatar Aboubakar Koïta avatar Phuwanai Thummavet avatar Patrick Fitzgerald avatar Gary Thung avatar techer.eth avatar yuliyu123 avatar Flavio Gouvea avatar Michael Demarais avatar Etch avatar sudo rm -rf --no-preserve-root / avatar

Watchers

 avatar Michael Demarais avatar

forge-erc20-template's Issues

import "./**/*.sol" (内製ファイルの参照)に対応

market placeなどの複雑なコントラクトを使う場合、ライブラリを直接インポートせずにいくつかのファイルで solidityを書くことがある。
現状、A(本丸sol) <- B(中間.sol) <- C(ライブラリ) のように中間で override してある関数を扱えない

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.