Skip to content

tempoxyz/tempo-foundry

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6,385 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 


tempo combomark



Tempo Foundry

Tempo is a blockchain designed specifically for stablecoin payments. Its architecture focuses on high throughput, low cost, and features that financial institutions, payment service providers, and fintech platforms expect from modern payment infrastructure.

Tempo Foundry is a custom fork of Foundry that integrates Tempo's payment-native protocol features directly into the familiar Foundry developer workflow.

This is a temporary required drop-in replacement for upstream Foundry while Tempo-specific features are being integrated into upstream Foundry, after which this fork will be deprecated.

Get started here to use Tempo's features in Foundry.

Installation

Tempo's Foundry fork is installed through the standard upstream foundryup using the -n tempo flag, no separate installer is required.

Getting started is very easy:

Install regular foundryup:

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

Or if you already have foundryup installed:

foundryup --update

Next, run:

foundryup -n tempo

It will automatically install the latest nightly release of the precompiled binaries: forge and cast.

Done!

For additional details see the installation guide in the Foundry Docs.

If you're experiencing any issues while installing, check out Getting Help and the FAQ.

Testnet

You can connect to Tempo's public testnet using the following details:

Property Value
Network Name Tempo Testnet (Moderato)
Currency USD
Chain ID 42431
HTTP URL https://rpc.moderato.tempo.xyz
WebSocket URL wss://rpc.moderato.tempo.xyz
Block Explorer https://explore.moderato.tempo.xyz

Next, grab some stablecoins to test with from Tempo's Faucet.

Alternatively, use cast:

cast rpc tempo_fundAddress <ADDRESS> --rpc-url https://rpc.moderato.tempo.xyz

Changeset

Key extensions:

  • In foundryup:

    • foundryup -n tempo: download the latest nightly release of Tempo's fork of Foundry.
    • foundryup -n tempo -i <TAG>: download a specific nightly release by tag nightly-<hash>.
  • In forge:

    • forge init -n tempo: adds a Tempo-specific Mail template showcasing a TIP20 transfer with an attached memo.
    • forge install tempoxyz/tempo-std: like forge-std, a collection of helpful contracts and libraries for Tempo-specific testing and utilities.
    • --tempo.fee-token support: pay gas fees in any TIP20 stablecoin.
  • In cast:

    • cast run: updated to correctly process Tempo's system transactions when replaying a block.
    • cast tip20: alias to cast erc20.
    • --tempo.fee-token support: pay gas fees in any TIP20 stablecoin.
  • Additionally:

    • Support for local and forked simulation of the Tempo execution environment.
    • Support for Tempo's (stateful) precompiles and default contracts including labels in traces.
    • A custom TempoEvm extends Revm's Evm to accommodate differences Tempo introduces to optimize for payments.



Blazing fast, portable and modular toolkit for Ethereum application development, written in Rust.

Tempo's fork of Foundry consists of:

  • Forge: Build, test, fuzz, debug and deploy [Solidity][solidity] contracts, like Hardhat, Brownie, Ape.
  • Cast: A Swiss Army knife for interacting with EVM smart contracts, sending transactions and getting chain data.

Need help getting started with Foundry? Read the 📖 Foundry Docs!

Demo

Features

  • High-Performance Compilation

    • Fast and Flexible: Automatically detects and installs the required Solidity compiler version.
    • Solidity and Vyper Support: Fully supports both Solidity and Vyper out-of-the-box.
    • Incremental Compilation: Re-compiles only changed files, saving time.
    • Parallelized Pipeline: Leverages multi-core systems for ultra-fast builds.
    • Broad Compatibility: Supports non-standard directory structures, including Hardhat repos.
  • Advanced Testing

    • No Context Switching: Write tests directly in Solidity.
    • Fuzz Testing: Quickly identify edge cases with input shrinking and counter-example generation.
    • Invariant Testing: Ensure complex system properties hold across a wide range of inputs.
    • Debugging Made Easy: Use forge-std's console.sol for flexible debug logging.
    • Interactive Debugger: Step through your Solidity code with Foundry's interactive debugger, making it easy to pinpoint issues.
  • Powerful Runtime Features

    • RPC Forking: Fast and efficient remote RPC forking backed by [Alloy][alloy].
    • Lightweight & Portable: No dependency on Nix or other package managers for installation.
  • Streamlined CI/CD

    • Optimized CI: Accelerate builds, run tests and execute scripts using [Foundry's GitHub action][foundry-gha].

How Fast?

Forge is quite fast at both compiling (leveraging solc with [foundry-compilers]) and testing.

See the benchmarks below. Older benchmarks against [DappTools][dapptools] can be found in the [v0.2.0 announcement post][benchmark-post] and in the [Convex Shutdown Simulation][convex] repository.

Testing Benchmarks

Project Type [Forge 1.0][foundry-1.0] [Forge 0.2][foundry-0.2] DappTools Speedup
[vectorized/solady][solady] Unit / Fuzz 0.9s 2.3s - 2.6x
[morpho-org/morpho-blue][morpho-blue] Invariant 0.7s 1m43s - 147.1x
[morpho-org/morpho-blue-oracles][morpho-blue] Integration (Cold) 6.1s 6.3s - 1.04x
[morpho-org/morpho-blue-oracles][morpho-blue] Integration (Cached) 0.6s 0.9s - 1.50x
[transmissions11/solmate][solmate] Unit / Fuzz 2.7s 2.8s 6m34s 1.03x / 140.0x
[reflexer-labs/geb][geb] Unit / Fuzz 0.2s 0.4s 23s 2.0x / 57.5x

In the above benchmarks, compilation was always skipped

Takeaway: Forge dramatically outperforms the competition, delivering blazing-fast execution speeds while continuously expanding its robust feature set.

Compilation Benchmarks

 

Takeaway: Forge compilation is consistently faster than Hardhat by a factor of 2.1x to 5.2x, depending on the amount of caching involved.

Forge

Forge helps you build, test, fuzz, debug and deploy Solidity contracts.

The best way to understand Forge is to simply try it (in less than 30 seconds!).

First, let's initialize a new counter example repository:

forge init counter

Next cd into counter and build:

forge init counter && cd counter
forge build
forge test

Interact with a live network:

cast block-number --rpc-url https://eth.merkle.io
cast balance vitalik.eth --ether --rpc-url https://eth.merkle.io

Replay and trace a transaction

cast run 0x9c32042f5e997e27e67f82583839548eb19dc78c4769ad6218657c17f2a5ed31 --rpc-url https://eth.merkle.io

Optionally, pass --etherscan-api-key <API_KEY> to decode transaction traces using verified source maps, providing more detailed and human-readable information.


Run cast --help to explore the full list of available subcommands and their usage.

More documentation can be found in the cast section of the Foundry Docs.

Configuration

Foundry is highly configurable, allowing you to tailor it to your needs. Configuration is managed via a file called foundry.toml located in the root of your project or any parent directory. For a full list of configuration options, refer to the config package documentation.

You can find additional setup and configurations guides in the Foundry Docs and in the config crate:

Profiles and Namespaces

  • Configuration can be organized into profiles, which are arbitrarily namespaced for flexibility.
  • The default profile is named default. Learn more in the Default Profile section.
  • To select a different profile, set the FOUNDRY_PROFILE environment variable.
  • Override specific settings using environment variables prefixed with FOUNDRY_ (e.g., FOUNDRY_SRC).

Contributing

Contributions are welcome and highly appreciated. To get started, check out the contributing guidelines.

Join our Telegram to chat about the development of Foundry.

Security

See SECURITY.md.

License

Having trouble? See if the answer to your question can be found in the Foundry Docs.

If the answer is not there:

License

Licensed under either of Apache License, Version 2.0 or MIT license at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in these crates by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

About

Temporary fork of Foundry with Tempo support

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Contributing

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors