Giter Club home page Giter Club logo

create_ico's Introduction

Foundry

Foundry is a blazing fast, portable and modular toolkit for Ethereum application development written in Rust.

Foundry consists of:

  • Forge: Ethereum testing framework (like Truffle, Hardhat and DappTools).
  • Cast: Swiss army knife for interacting with EVM smart contracts, sending transactions and getting chain data.
  • Anvil: Local Ethereum node, akin to Ganache, Hardhat Network.
  • Chisel: Fast, utilitarian, and verbose solidity REPL.

Documentation

https://book.getfoundry.sh/

Usage

1) Create New Project:

forge init hello_foundry

2) Link with github:

a) Create a repository on github
b) git remote add origin <REMOTE_URL>
   git remote -v
c) git push -u origin main
d) If error look chatGPT (git config user.name "name")

1) Bis) Quickstart:

- git clone URL
- cd NEW_FOLDER
- forge build

3) Dependencies:

- forge install openzeppelin/openzeppelin-contracts

4) Deploy on a Devnet:

a) In an other terminal run: anvil
c) Create a Script
b) forge script script/Token.s.sol --rpc-url http://127.0.0.1:8545 --broadcast --private-key 0xac097...

4) Bis) Create .env file:

a) Create the file
b) Add it to the .gitignore
c) Add to the terminal the variables : source .env
d) forge script script/Token.s.sol --rpc-url $RPC_URL --broadcast --private-key $PRIVATE_KEY

5) Interact with the Devnet:

a) Recup the Contract Address: 0xe7f17...
b) Interact with function : cast send 0xe7f17... "addToAllowList(address)" "<Public Key>" --rpc-url $RPC_URL --private-key $PRIVATE_KEY
c) Read Function: cast call 0xe7f17... "isUserAllowed(address)(bool)" <Public Key>
d) Remark:
	- Convert Hex to decimal: cast --to-base 0x15b7d6 dec

6) Deploy on Testnet:

a) Add to the .env: 
	SEPOLIA_RPC_URL=https://sepolia.infura.io/v3/...
	SEPOLIA_PRIVATE_KEY=c5d83... (Metamask private key)
b) forge script script/Token.s.sol --rpc-url $SEPOLIA_RPC_URL --private-key $SEPOLIA_PRIVATE_KEY --broadcast
c) Recup the hash of the transaction and put it on sepolia.etherscan: https://sepolia.etherscan.io/tx/0xbe6...
c) Bis) If you want to automaticly verify your contract:
	- Create an Etherscan api key on etherscan site: ETHERSCAN_API_KEY=...
	- forge script script/Token.s.sol --rpc-url $SEPOLIA_RPC_URL --private-key $SEPOLIA_PRIVATE_KEY --broadcast --verify --etherscan-api-key $ETHERSCAN_API_KEY

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.