Cloned and modified from Superchain Starter Kit
A lightweight, focused starting point for prototyping/building on the Superchain, featuring
- 🛠 InterOp Devnets
- 🎨 wagmi, viem
- @eth-optimism/viem, @eth-optimism/wagmi - viem/wagmi extensions for the Superchain
- 💡 simple example app - CrossChainCounter
git clone https://github.com/trigg3rX/triggerx-superchain.git
cd triggerx-superchainpnpm ipnpm dev:frontendThis command will:
- Launch the frontend development server at (http://localhost:5173)
- Connect your wallet to the app.
- Use 2 different methods to increment the counter:
- Direct method: Call the
incrementfunction on theCrossChainCounterIncrementercontract. - Indirect method: Send a message to the
L2ToL2CrossDomainMessengercontract.
- Direct method: Call the
- See the counter value on the destination chain in real time.
Start building on the Superchain!
- Simple
Hello worldfor Superchain Interop - Unlike the single chain Counter, this one can only be incremented via cross-chain messages
- Learn more about this contract here
This starter kit is organized to get you building on the Superchain as quickly as possible. Solidity code goes in /contracts, and the typescript frontend goes in /src
superchain-starter/
├── contracts/ # Smart contract code (Foundry)
├── src/ # Frontend code (vite, tailwind, shadcn, wagmi, viem)
│ └── App.tsx # Main application component
├── public/ # Static assets for the frontend
├── package.json # Project dependencies and scripts
└── mprocs.yaml # Run multiple commands using mprocs
While this structure is great for getting started and building proof of concepts, it's worth noting that many production applications eventually migrate to separate repositories for contracts and frontend code.
For reference, here are some examples of this separation in production applications:
- Uniswap: Uniswap contracts, Uniswap frontend
- Across: Across contracts, Across frontend
- Farcaster: Farcaster contracts
- TriggerX: TriggerX contracts, TriggerX frontend
Use the error selectors below to identify the cause of reverts.
- For a complete list of error signatures from interoperability contracts, see abi-signatures.md
- Examples:
TargetCallFailed():0xeda86850MessageAlreadyRelayed:0x9ca9480bUnauthorized():0x82b42900
- Interop recipes / guides: https://docs.optimism.io/app-developers/tutorials/interop
- Superchain Dev Console: https://console.optimism.io/
Files are licensed under the MIT license.
