Deploy Your First Cross-Chain Contract
Get started with Pylon by deploying a contract on one of our demo appchains and read from their settlement layer.Prerequisites
- Testnet ETH - Apply for testnet funding (tell us which network and provide your wallet address)
- Foundry installed - Install from foundryup.rs
Step 1: Create Your Project
Step 2: Configure Your Network
Add to yourfoundry.toml:
| Network | Settlement Layer | RPC URL | Chain ID | Status | Add to Wallet |
|---|---|---|---|---|---|
| Pylon Base Sepolia | Base Sepolia | https://pylon.base-sepolia.spire.dev | 2137 | Testnet | |
| Pylon Base Mainnet | Base | https://pylon.base-mainnet.spire.dev | 7312 | Mainnet | |
| Pylon Optimism Sepolia | Optimism Sepolia | https://pylon.optimism-sepolia.spire.dev | 2138 | Testnet | |
| Pylon Celo Mainnet | Celo | https://pylon.celo-mainnet.spire.dev | 2139 | Mainnet |
Step 3: Make a Direct Cross-Chain Call
Let’s start by understanding how cross-chain calls work. Pylon provides a Port Contract that reads from the settlement layer. Make a direct call to read WETH name from Base Sepolia:- Called the SettlementPort contract at
0x0000000000000000000000000000000000000042 - Told it to call
name()on WETH (0x4200000000000000000000000000000000000006) - The coordinator detected the cross-chain call, forwarded it to the settlement layer, and returned the result synchronously
- The result is encoded as bytes
Step 4: Create Forwarding Proxy (Better Developer Experience)
Making rawreadSettlement calls works, but it’s verbose. We can create a forwarding proxy that makes settlement layer contracts callable using standard interfaces like ERC20.
Create src/SettlementForwardingProxy.sol:
src/ISettlementReader.sol:
- Constructor takes two addresses: the SettlementPort and a target contract (in this case WETH)
fallback()captures any function call and forwards it toreadSettlement()- Returns the result as if the target contract were local
- This lets you call settlement layer contracts using standard interfaces
Step 5: Create a Contract That Uses the Proxy
Now let’s create a contract that demonstrates using the proxy with standard interfaces: Createsrc/ProxyCaller.sol:
ProxyCallercalls standard ERC20 functions on the PROXY address- The proxy’s
fallback()forwards these calls to SettlementPort - SettlementPort reads from the settlement layer synchronously via priming transactions
- Results return as if WETH were deployed on your appchain
Step 6: Deploy Contracts
Deploy the ProxyCaller contract:Step 7: Test Your Cross-Chain Calls
What This Demonstrates
- Direct Pattern (Step 3): Made raw
readSettlementcalls to SettlementPort, showing the foundation of cross-chain reads - Proxy Pattern (Step 4-5): Created a forwarding proxy that enables standard interface calls to settlement layer contracts from your appchain contracts
- Developer Experience: Now you can call settlement layer contracts using familiar Solidity syntax and interfaces
How Cross-Chain Calls Flow Through Pylon

Next Steps
- Chain Setup → - Configure your own based appchain development environment
- Build Onchain → - Learn to deploy and test applications
- Architecture → - Understand how it works