Giter Club home page Giter Club logo

foundry-template's Introduction

foundry-template • CI

Streamlined template for getting started with Foundry and Solmate.

Contributing

You will need a copy of Foundry installed before proceeding. See the installation guide for details.

Setup

$ git clone https://github.com/transmissions11/foundry-template.git 
$ cd foundry-template
$ git submodule init 
$ forge build 

Run Tests

$ forge test

Update Gas Snapshots

$ forge snapshot

Install dependencies

$ forge install
$ forge install transmissions11/solmate -->
$ forge install Openzeppelin/openzeppelin-contracts -->
$ forge install OpenZeppelin/openzeppelin-contracts-upgradeable --no-commit -->

Before Pushing to github

$ forge test
$ forge fmt
$ forge snapshot
$ forge fmt --check
$ forge snapshot --check
$ git push

Create a contract

$ forge create {{contract}} --rpc-url=$GOERLI_PRIVATE_KEY --private-key=$GOERLI_PRIVATE_KEY
$ forge create {{contract}} --rpc-url=$RPC_URL --private-key=$PRIVATE_KEY --constructor-args <name> <symbol>
$ forge create --rpc-url <your_rpc_url> --private-key <your_private_key> src/MyContract.sol:MyContract
$ forge create --rpc-url <your_rpc_url> --constructor-args "ForgeUSD" "FUSD" 18 1000000000000000000000 --private-key <your_private_key> src/MyToken.sol:MyToken --etherscan-api-key <your_etherscan_api_key> --verify

send a transaction

$ cast send --rpc-url=$GOERLI_PRIVATE_KEY $TARGET_ADDRESS {{method}} {{args}} --private-key=$GOERLI_PRIVATE_KEY
$ cast call --rpc-url=$GOERLI_PRIVATE_KEY $TARGET_ADDRESS {{method}} {{args}}

Debug

$ forge debug --debug {{file}} --sig {{method}} {{args}} {{args1}}
$ forge debug --debug src/SomeContract.sol --sig "myFunc(uint256,string)" 123 "hello"
$ forge test --debug "testSomething()"

foundry-template's People

Contributors

emilesean avatar

Watchers

 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.