Skip to content

Meharab/foundry

Repository files navigation

SimpleStorage

​ This is a simple Solidity contract that stores a single uint256 value. ​

Getting Started

  1. Clone this repository.
  2. Install Forge using the instructions found at https://github.com/foundry-rs/foundry.
  3. Run the following command to compile the contract: ​
forge build

​ 4. Run the following command to deploy the contract to a test network: ​

forge create

​ 5. Interact with the contract using Forge's interactive console. ​

forge console

Important Commands

forge --init

Contributing

​ We welcome contributions to this project. If you're interested in contributing, please open an issue or submit a pull request.

We can preview our `README.md` file in VS Code by going to the `View` menu and selecting `Open Preview to the Side`. This will open a new window showing what the `README.md` file will look like when it's rendered on GitHub.
​
### Using AI for Markdown Formatting
​
If you find that formatting Markdown is a bit tedious, you can use an AI tool like ChatGPT to help you out. Just copy and paste the text you want to format into ChatGPT and ask it to format it in Markdown. It will do a pretty good job of converting your plain text into Markdown, and you can then review and edit it as needed.

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

About

Storage

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors