Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 4 additions & 12 deletions src/pages/docs/sdk/foundry/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -91,16 +91,9 @@ For most projects, the most flexible option is to enable Tempo network features
tempo = true
```

This network flag, enables Tempo-specific network behavior while still letting Foundry resolve the right semantics from the chain you are targeting.
This network flag enables Tempo-specific network behavior while still letting Foundry resolve the right semantics from the chain you are targeting.

If you need advanced testing against a specific Tempo hardfork, pin it explicitly in `foundry.toml` or via inline-config:

```toml
[profile.default]
hardfork = "tempo:T3"
```

This is the advanced option when you want local simulation, tests, or scripts to run against a specific Tempo hardfork such as T3. It also infers the Tempo network in Foundry's config layer.
If you need advanced testing against historical network behavior, pin a specific Tempo hardfork explicitly in `foundry.toml` or via inline config. Most projects should avoid hardfork pinning so local tests track the current Tempo rules for the network they target.

### Verification config

Expand Down Expand Up @@ -308,8 +301,8 @@ Access-key transactions cannot create contracts, so use a root key for deploymen
Anvil supports Tempo mode for local testing and forking Tempo networks:

```bash
# Start anvil in Tempo mode with T3 rules
anvil --tempo --hardfork t3
# Start anvil in Tempo mode
anvil --tempo

# Fork a live Tempo network for local testing
anvil --tempo --fork-url $TEMPO_RPC_URL
Expand Down Expand Up @@ -444,4 +437,3 @@ cast call 0xAAAAAAAA00000000000000000000000000000000 \
<ACCOUNT> <KEY_ID> <TOKEN_ADDRESS> \
--rpc-url $TEMPO_RPC_URL
```

13 changes: 8 additions & 5 deletions src/pages/docs/sdk/foundry/signature-verifier.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ description: Verify secp256k1, P256, and WebAuthn signatures in smart contracts

# Signature Verification with Foundry

The [TIP-1020](https://github.com/tempoxyz/tempo/blob/main/tips/tip-1020.md) `SignatureVerifier` precompile lets contracts verify secp256k1, P256, and WebAuthn signatures through a single interface — no custom verifier contracts needed. This is available after the [T3 network upgrade](/docs/protocol/upgrades/t3).
The [TIP-1020](https://github.com/tempoxyz/tempo/blob/main/tips/tip-1020.md) `SignatureVerifier` precompile is available on Tempo. It lets contracts verify secp256k1, P256, and WebAuthn signatures through a single interface — no custom verifier contracts needed.

The Foundry project template for Tempo ships with a working example that demonstrates signature verification in a relayed mail contract. Initialize it with:

Expand Down Expand Up @@ -87,12 +87,16 @@ contract Mail {

## Testing

The template includes tests for both signature types. Set `hardfork = "tempo:T3"` in inline config or `foundry.toml` to enable the precompile locally:
The template includes tests for both signature types. Tempo support is enabled by the template's Foundry config. If you copy this pattern into an existing project, make sure `foundry.toml` enables Tempo mode:

```toml
[profile.default]
tempo = true
```

### secp256k1

```solidity
/// forge-config: default.hardfork = "tempo:T3"
contract MailRelayTest is MailTest {
uint256 internal constant ALICE_PK = 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80;

Expand Down Expand Up @@ -136,11 +140,10 @@ function test_SendMailWithP256Signature() public {
forge test -vvv
```

The secp256k1 and P256 relay tests run against the T3 hardfork automatically via the inline config directive.
The secp256k1 and P256 relay tests use Tempo mode through the template's Foundry config.

## Related

- [TIP-1020: Signature Verification Precompile](https://github.com/tempoxyz/tempo/blob/main/tips/tip-1020.md)
- [T3 Network Upgrade](/docs/protocol/upgrades/t3)
- [T6 Network Upgrade](/docs/protocol/upgrades/t6)
- [Foundry for Tempo](/docs/sdk/foundry)
Loading