Skip to content

kartik01112004/foundry-simple-storage

Repository files navigation

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

Build

$ forge build

Test

$ forge test

Format

$ forge fmt

Gas Snapshots

$ forge snapshot

Anvil

$ anvil

Deploy

$ forge script script/Counter.s.sol:CounterScript --rpc-url <your_rpc_url> --private-key <your_private_key>

Cast

$ cast <subcommand>

Help

$ forge --help
$ anvil --help
$ cast --help

forge create SimpleStorage --interactive

and then pass the private key this will deploy our contract on local anvil chain if you want to add another chain you must paasss rpc-url and priavte key to an acoount on that chain

.s.sol - is a convention to tell that its a script

forge script script/DeploySimpleStorage.s.sol --rpc-url http://127.0.0.1:8545 --broadcast
--private-key 0x00000000000000000000000000000000000000000000000000000000000000
000

this is how we deploy on anvil local chain

Never use .env

erc2335

thirdweb deploy

zkSync CLI

needs : node, npm, npx docker, zksync

# start foundry zksync
foundryup-zksync

# Start docker and check if running by
docker --version

# configure the dev cli you will be using
npx zksync-cli dev config

# start the docker container
npx zksync-cli dev start

# check of docker process running
docker ps

# Output looks like

#CONTAINER ID   IMAGE                         COMMAND               CREATED      STATUS          PORTS                    NAMES
#ff3d5a0e448c   zkcli-in-memory-node-zksync   "era_test_node run"   7 days ago   Up 22 seconds   0.0.0.0:8011->8011/tcp   zkcli-in-memory-node-zksync-1

deploy localy

forge create src/SimpleStorage.sol:SimpleStorage --rpc-url http://127.0.0.1:8011 --private-key 0 --legacy --zksync

types of transactions

why deploy on L2

its too much pricy to use ethurium directly so we use L2

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published