All Projects → gakonst → foundry

gakonst / foundry

Licence: Apache-2.0, MIT licenses found Licenses found Apache-2.0 LICENSE-APACHE MIT LICENSE-MIT
Foundry is a blazing fast, portable and modular toolkit for Ethereum application development written in Rust.

Programming Languages

rust
11053 projects

Projects that are alternatives of or similar to foundry

Eth Crypto
Cryptographic javascript-functions for ethereum and tutorials to use them with web3js and solidity
Stars: ✭ 420 (-90.91%)
Mutual labels:  dapp, eth
Dapptools
Dapp, Seth, Hevm, and more
Stars: ✭ 362 (-92.17%)
Mutual labels:  dapp, evm
Astar
The dApp hub for blockchains of the future
Stars: ✭ 533 (-88.47%)
Mutual labels:  dapp, evm
zeneth
🏵️ Let Your ETH Chill — Gasless Ethereum account abstraction with Flashbots
Stars: ✭ 112 (-97.58%)
Mutual labels:  dapp, eth
nft-swap-sdk
Ethereum's missing p2p NFT and token swap library for web3 developers. Written in TypeScript. Powered by 0x.
Stars: ✭ 200 (-95.67%)
Mutual labels:  dapp, evm
Wallet
🚀 基于Flutter开发的跨终端数字货币交易所✨
Stars: ✭ 36 (-99.22%)
Mutual labels:  dapp, eth
web3
⚡️ Web3 PHP is a supercharged PHP API client that allows you to interact with a generic Ethereum RPC.
Stars: ✭ 609 (-86.83%)
Mutual labels:  dapp, eth
Samsung Trustzone Research
Reverse-engineering tools and exploits for Samsung's implementation of TrustZone
Stars: ✭ 85 (-98.16%)
Mutual labels:  tooling, fuzzing
LunDAO
LunDAO 是一個鼓勵撰寫與 Ethereum 社群相關的中深度的中文文章,透過一個短期的實驗專案嘗試 DAO 可以如何進行社群治理以及回饋社群貢獻。
Stars: ✭ 50 (-98.92%)
Mutual labels:  dapp, evm
vue-web3
🐙 Web3 blockchain bindings for Vue.js (inspired by Vuefire and Drizzle)
Stars: ✭ 63 (-98.64%)
Mutual labels:  dapp, eth
kbdysch
A collection of user-space Linux kernel specific guided fuzzers based on LKL
Stars: ✭ 62 (-98.66%)
Mutual labels:  fuzzing
haal
Hääl - Anonymous Electronic Voting System on Public Blockchains
Stars: ✭ 96 (-97.92%)
Mutual labels:  dapp
etherscan-python
A minimal, yet complete, python API for Etherscan.io.
Stars: ✭ 335 (-92.75%)
Mutual labels:  eth
alchemy
An app for collaborative networks (DAOs), based on the DAO stack.
Stars: ✭ 137 (-97.04%)
Mutual labels:  dapp
foodprint
Algorand dApp for blockchain-enabled food transparency and traceability in local food supply chains. For use by smallholder farmers, food co-operatives and consumers.
Stars: ✭ 43 (-99.07%)
Mutual labels:  dapp
bcdhub
Better Call Dev backend
Stars: ✭ 30 (-99.35%)
Mutual labels:  dapp
create-truffle-dapp
Create and deploy Truffle projects with no configuration.
Stars: ✭ 17 (-99.63%)
Mutual labels:  dapp
bytecode-verifier
Compile Solidity source code and verify its bytecode matches the blockchain
Stars: ✭ 78 (-98.31%)
Mutual labels:  evm
FirmWire
FirmWire is a full-system baseband firmware emulation platform for fuzzing, debugging, and root-cause analysis of smartphone baseband firmwares
Stars: ✭ 555 (-87.99%)
Mutual labels:  fuzzing
gini
A fast SAT solver
Stars: ✭ 139 (-96.99%)
Mutual labels:  fuzzing

Foundry logo

Foundry

Github Actions Telegram Chat Telegram Support

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.

Need help getting started with Foundry? Read the 📖 Foundry Book (WIP)!

Demo

Installation

Having issues? See the troubleshooting section.

First run the command below to get foundryup, the Foundry toolchain installer:

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

If you do not want to use the redirect, feel free to manually download the foundryup installation script from here.

Then, run foundryup in a new terminal session or after reloading your PATH.

Other ways to use foundryup, and other documentation, can be found here. Happy forging!

Installing from Source

For people that want to install from source, you can do so like below:

git clone https://github.com/foundry-rs/foundry
cd foundry
# install cast + forge
cargo install --path ./cli --profile local --bins --locked --force
# install anvil
cargo install --path ./anvil --profile local --locked --force

Or via cargo install --git https://github.com/foundry-rs/foundry --profile local --locked foundry-cli anvil.

Installing for CI in Github Action

See https://github.com/foundry-rs/foundry-toolchain GitHub Action.

Installing via Docker

Foundry maintains a Docker image repository.

You can pull the latest release image like so:

docker pull ghcr.io/foundry-rs/foundry:latest

For examples and guides on using this image, see the Docker section in the book.

Manual Download

You can manually download nightly releases here.

Forge

Features

  • Fast & flexible compilation pipeline
    • Automatic Solidity compiler version detection & installation (under ~/.svm)
    • Incremental compilation & caching: Only changed files are re-compiled
    • Parallel compilation
    • Non-standard directory structures support (e.g. Hardhat repos)
  • Tests are written in Solidity (like in DappTools)
  • Fast fuzz testing with shrinking of inputs & printing of counter-examples
  • Fast remote RPC forking mode, leveraging Rust's async infrastructure like tokio
  • Flexible debug logging
    • DappTools-style, using DsTest's emitted logs
    • Hardhat-style, using the popular console.sol contract
  • Portable (5-10MB) & easy to install without requiring Nix or any other package manager
  • Fast CI with the Foundry GitHub action.

How Fast?

Forge is quite fast at both compiling (leveraging ethers-solc) and testing.

See the benchmarks below. More benchmarks can be found in the v0.2.0 announcement post and in the Convex Shutdown Simulation repository.

Testing Benchmarks

Project Forge DappTools Speedup
transmissions11/solmate 2.8s 6m34s 140x
reflexer-labs/geb 0.4s 23s 57.5x
Rari-Capital/vaults 0.28s 6.5s 23x

Note: In the above benchmarks, compilation was always skipped

Compilation Benchmarks

Compilation benchmarks

Takeaway: Forge compilation is consistently faster by a factor of 1.7-11.3x, depending on the amount of caching involved.

Cast

Cast is a swiss army knife for interacting with Ethereum applications from the command line.

More documentation can be found in the cast package.

Configuration

Using foundry.toml

Foundry is designed to be very configurable. You can configure Foundry using a file called foundry.toml in the root of your project, or any other parent directory. See config package for all available options.

Configuration can be arbitrarily namespaced by profiles. The default profile is named default (see "Default Profile").

You can select another profile using the FOUNDRY_PROFILE environment variable. You can also override parts of your configuration using FOUNDRY_ or DAPP_ prefixed environment variables, like FOUNDRY_SRC.

forge init creates a basic, extendable foundry.toml file.

To see your current configuration, run forge config. To see only basic options (as set with forge init), run forge config --basic. This can be used to create a new foundry.toml file with forge config --basic > foundry.toml.

By default forge config shows the currently selected foundry profile and its values. It also accepts the same arguments as forge build.

DappTools Compatibility

You can re-use your .dapprc environment variables by running source .dapprc beforehand using a Foundry tool.

Additional Configuration

You can find additional setup and configurations guides in the Foundry Book:

Troubleshooting Installation

libusb Error When Running forge/cast

If you are using the binaries as released, you may see the following error on MacOS:

dyld: Library not loaded: /usr/local/opt/libusb/lib/libusb-1.0.0.dylib

In order to fix this, you must install libusb like so:

brew install libusb

Out of Date GLIBC Error When Running forge From Default foundryup Install:

If you run into an error resembling the following when using foundryup:

forge: /lib/x86_64-linux-gnu/libc.so.6: version 'GLIBC_2.29' not found (required by forge)

There are 2 workarounds:

  1. Building from source: foundryup -b master
  2. Using Docker

Contributing

See our contributing guidelines.

Getting Help

First, see if the answer to your question can be found in book, or in the relevant crate.

If the answer is not there:

If you want to contribute, or follow along with contributor discussion, you can use our main telegram to chat with us about the development of Foundry!

Acknowledgements

  • Foundry is a clean-room rewrite of the testing framework DappTools. None of this would have been possible without the DappHub team's work over the years.
  • Matthias Seitz: Created ethers-solc which is the backbone of our compilation pipeline, as well as countless contributions to ethers, in particular the abigen macros.
  • Rohit Narurkar: Created the Rust Solidity version manager svm-rs which we use to auto-detect and manage multiple Solidity versions.
  • Brock Elmore: For extending the VM's cheatcodes and implementing structured call tracing, a critical feature for debugging smart contract calls.
  • All the other contributors to the ethers-rs & foundry repositories and chatrooms.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].