This guide covers deploying Across Protocol contracts on both EVM chains (using Hardhat or Foundry) and Solana/SVM chains (using Anchor).Documentation Index
Fetch the complete documentation index at: https://mintlify.com/across-protocol/contracts/llms.txt
Use this file to discover all available pages before exploring further.
Prerequisites
Before deploying, ensure you have:- Node.js (minimum version 16.18.0, recommended 20.17)
- Foundry - Installation guide
- Anchor (for Solana) - Installation guide
- Environment variables configured (RPC URLs, API keys, etc.)
If you encounter build issues, try downgrading to Node 20.17 using
nvm use 20.17. For Anchor users, run avm use latest if you’ve never used Anchor before.EVM Deployment
Environment Setup
Create environment variables for your deployment:foundry.toml for the complete list:
Foundry Deployment (Recommended)
Deploy HubPool
Deploy the HubPool contract on Ethereum mainnet:
First test deployment without
--broadcast to simulate in dry-run mode.Deploy SpokePool
Deploy a SpokePool on your target chain (e.g., Arbitrum):Available SpokePool deployment scripts:
DeployArbitrumSpokePool.s.solDeployOptimismSpokePool.s.solDeployPolygonSpokePool.s.solDeployZkSyncSpokePool.s.solDeployUniversalSpokePool.s.sol- And more in
script/directory
ZKSync Deployment
ZKSync requires special configuration using the zksolc compiler:Install foundry-zksync
Install the ZKSync fork of Foundry:See instructions here.
Hardhat Deployment (Legacy)
While Foundry is recommended, Hardhat is still supported:Solana/SVM Deployment
Solana deployment uses Anchor and requires verified builds for production.Initial Setup
Verify program IDs match keypairs
Before deploying for the first time, ensure all program IDs in Update IDs in your code to match keypairs under
lib.rs and Anchor.toml match the deployment keypairs:target/deploy/ and commit changes.Deploy Program
Initialize SVM Spoke
Forsvm_spoke, initialize the program state:
Create Token Vault
Create a vault for accepting deposits:Deployment Best Practices
- Always test in simulation mode first - Run deployment scripts without
--broadcastto verify parameters - Verify contract addresses - Double-check all referenced addresses (HubPool, WETH, bridges, etc.)
- Use verified builds for production - Especially for Solana, always use verified docker builds
- Document deployments - Update deployment registries immediately after deployment
- Set appropriate buffer values -
QUOTE_TIME_BUFFERandFILL_DEADLINE_BUFFERaffect user experience - Test upgrade authority - Verify multisig control before announcing deployments
Next Steps
After deployment:- Verify your contracts on block explorers
- Learn about upgrading contracts using the UUPS pattern
- Review contract architecture to understand the system