Synchronous Cross-Chain Composability
Pylon appchains already support synchronous reads from their settlement layer: your contracts can call settlement layer view functions and use the results in the same transaction. The full concept and roadmap live in Synchronous Composability—this section focuses on how to use it in practice. Today:- ✅ Read settlement layer state atomically (no async polling or bridges)
- ✅ Use forwarding proxies or the SettlementPort directly for developer ergonomics
- 🔄 Synchronous writes and broader multi-chain coordination (see the roadmap section)
- Follow the Quickstart for a step-by-step proxy deployment example
- Use forwarding proxies or call SettlementPort directly (see examples below)
- Lean on pre-deployed utility contracts for deterministic addresses and simplified setup
Standard Ethereum RPC Compatibility
Pylon appchains expose full Ethereum JSON-RPC 2.0 compatible endpoints. The RPC endpoint received during chain setup functions identically to any other Ethereum-compatible chain. What this means:- Standard RPC methods (
eth_sendRawTransaction,eth_getTransactionReceipt,eth_call, etc.) work as expected - All Ethereum development tools are compatible (Foundry, Hardhat, ethers.js, web3.js, etc.)
- Wallets connect using standard network configuration
- No special integrations or custom SDKs required
Deploying Contracts
Deploy contracts usingforge create. Configure your RPC endpoint in foundry.toml:
forge script.
Sending Transactions
Send transactions using standard methods and libraries. Examples below show the same operation using different tools: Foundry’scast send, ethers.js, and web3.js.
Interacting with Contracts
Call contract functions using standard RPC methods.View Calls
Read contract state withcast call:
State-Changing Calls
Call functions that modify state usingcast send:
Testing Your Contracts
The simplest-pylon-demo repository provides working examples of contracts and unit tests that demonstrate cross-chain calling patterns on Pylon.Testing Patterns
Unit tests for contracts that interact with the settlement layer should mock the cross-chain infrastructure. Two mocking approaches are available:- Mock the SettlementForwardingProxy - Implement the same interface your application uses (e.g.,
IERC20) with setters to configure mock responses. This is the standard contract mocking pattern. - Mock the SettlementPort - Mock the SettlementPort contract to test the full proxy code path. The repository demonstrates this approach.
forge test:
Debugging Transactions
When transactions fail or the RPC rejects them during simulation, use these debugging techniques.Simulate Calls to Inspect Errors
The RPC often rejects transactions that would fail during simulation. Usecast call to see the error that would occur:
cast calldata to encode function calls):
Debug Failed Transactions with Cast Run
When a transaction fails after submission, usecast run to trace execution and identify the failure point:
-vvv) show detailed execution traces, including:
- Opcode-level execution
- Storage changes
- Revert reasons
Verify Settlement Layer Connectivity
If cross-chain calls consistently fail, verify the coordinator can reach the settlement layer:Inspect Transaction Receipts
For successfully submitted transactions, inspect the receipt for execution details usingcast receipt:
Direct Settlement Layer Reads
You can call the SettlementPort directly using thel2Read function to read from settlement layer contracts. This provides more control over calldata encoding and error handling than forwarding proxies.
Basic Usage
Thel2Read function is available through the SettlementPort contract at address 0x0000000000000000000000000000000000000042:
Key Points
- View Function:
l2Readis aviewfunction, so it doesn’t modify state - Synchronous: The read appears synchronous to your contract, but the data is pre-fetched by the sequencer
- Error Handling: The function will revert if the L2 call fails—use
try/catchfor graceful error handling
Error Handling
For graceful error handling when L2 reads might fail:Pre-Deployed Utility Contracts
Pylon can pre-deploy utility contracts at deterministic addresses on your appchain. These contracts enable common development patterns without requiring deployment. Request these contracts or others during chain setup or through the Spire contact form.Available Contracts
The following utility contracts can be pre-deployed on request:| Contract | Default Address | Purpose |
|---|---|---|
| SettlementForwardingProxyFactory | 0x0000000000000000000000000000000000000043 | Deploy proxies for cross-chain reads |
| CREATE2Factory | 0x0000000000000000000000000000000000000044 | Deterministic contract deployments |
| Multicall | 0x0000000000000000000000000000000000000045 | Batch multiple calls in a single transaction |
| MinimalProxyFactory | 0x0000000000000000000000000000000000000046 | Deploy minimal proxies (EIP-1167) for cheap cloning |
SettlementForwardingProxyFactory
The SettlementForwardingProxyFactory deploys forwarding proxies that enable clean interface-based access to settlement layer contracts. Each proxy forwards calls to a specified settlement layer contract through the SettlementPort. Interface:computeProxyAddress to calculate the proxy address before deployment.
For complete examples, see the simplest-pylon-demo repository which demonstrates proxy deployment and usage patterns.
CREATE2Factory
Enables deterministic contract deployments using the CREATE2 opcode. Contracts can be deployed to addresses computed in advance based on the deployer address, salt, and bytecode hash. Interface:computeAddress to calculate the deployment address before calling deploy. The factory uses CREATE2 internally, ensuring that contracts with the same salt and bytecode always deploy to the same address.
Multicall
Batches multiple function calls into a single transaction, reducing gas costs by combining operations. Useful for aggregating multiple cross-chain reads or state queries in a single transaction. Interface:aggregate function reverts if any call fails, while tryAggregate allows partial failures when requireSuccess is false.
MinimalProxyFactory
Deploys EIP-1167 minimal proxies that forward calls to an implementation contract viadelegatecall. Each proxy maintains its own storage while sharing the implementation’s code, enabling cheap deployment of many instances. See EIP-1167 and OpenZeppelin Clones for details.
Next Steps
- Chain Management → - Monitor and maintain your chain
- Connect Users → - Configure wallet integration
- Architecture → - Understand how Pylon works under the hood