Skip to content

About

No description, website, or topics provided.

Resources

Security policy

Stars

4 stars

Watchers

0 watching

Forks

Repository files navigation

Angstrom L2

This repository contains the core contracts for the L2 Angstrom hook.

Build

$ forge build

Test

$ forge test

Deployment

Prerequisites

Vanity Address Mining

We use vanity-miner-rust to mine a salt for CREATE3 deployment that results in a desired address property (e.g., leading zeros).

$ cargo run --release -- --owner <DEPLOYER_ADDRESS> --zeros 6

This outputs a DEPLOY_TOKEN_ID and DEPLOY_TOKEN_NONCE used by the deploy script.

Mine with --owner set to the deployer: the first 20 bytes of the token ID are its owner, and the deploy scripts call SUB_ZERO.mint directly, which only the owner can do.

Signing EIP-712 permit for giving up token (only if the deployer doesn't own the salt)

If the salt was mined for a different owner, that owner has to sign a permit that lets the deployer call SUB_ZERO.claimGivenUpWithSig instead:

$ cast wallet sign --data --from-file script/eip712.json

Adjust the script/eip712.json file with the correct DEPLOY_TOKEN_ID, nonce and claimer accordingly, and replace the script's SUB_ZERO.mint call with claimGivenUpWithSig.

Network Configuration

Reference script/config.toml — currently configured for Base and Unichain with their respective Uniswap V4 PoolManager addresses.

Deploy Factory

The factory deployment script (script/AngstromL2Factory.s.sol) handles:

  • Deploying the Huff-based hook address miner
  • Minting the vanity token from Sub Zero (if not already minted)
  • Deploying AngstromL2Factory via SUB_ZERO.deploy()
$ forge script script/AngstromL2Factory.s.sol --broadcast --sender <SENDER>

Security

  • See audit for a list of audits done previously
  • See SECURITY.md for security policies and disclosures.

About

No description, website, or topics provided.

Resources

Security policy

Stars

4 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages