This tutorial demonstrates cross-chain DeFi composability using Stargate Finance. The example smart contract:
- Bridges ETH from Optimism Sepolia to Ethereum Sepolia
- Automatically deposits received tokens into Aave on the destination chain
This pattern can be adapted for various cross-chain use cases and integrated with other DeFi protocols.
The /src directory contains the following smart contracts:
StargateComposer.sol: Main contract that handles composablecross-chain token transfer via StargateReceivel.sol: Contract for receiving callbacks from Stargate bridge operations withinlzComposefunction
yarn install & forge buildDeploy StargateComposer contract on Optimism Sepolia
make dc
# Update address of the composer in TransferEth.s.solDeploy Receiver contract on Ethereum Sepolia
make drExecute cross-chain transfer of ETH from Optimism Sepolia to Ethereum Sepolia
make etJoin our community of developers creating universal apps.
- Stargate on GitHub: Stargate protocol open source code.
- Discord Builders Community: Chat with Stargate builders community.
