Skip to content

Latest commit

 

History

History
66 lines (39 loc) · 1.77 KB

File metadata and controls

66 lines (39 loc) · 1.77 KB

Tutorial Protocol Composability

Stargate Protocol Composability

This tutorial demonstrates cross-chain DeFi composability using Stargate Finance. The example smart contract:

  1. Bridges ETH from Optimism Sepolia to Ethereum Sepolia
  2. 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.

Getting Started

The /src directory contains the following smart contracts:

  • StargateComposer.sol: Main contract that handles composablecross-chain token transfer via Stargate
  • Receivel.sol: Contract for receiving callbacks from Stargate bridge operations within lzCompose function

Prerequisites

  • 🔸 Node.js
  • 🔸 Forge
  • 🔸 Funded wallet with ETH on OP Sepolia

Faucets

Installation

yarn install & forge build

Usage

Deploy StargateComposer contract on Optimism Sepolia

make dc
# Update address of the composer in TransferEth.s.sol

Deploy Receiver contract on Ethereum Sepolia

make dr

Execute cross-chain transfer of ETH from Optimism Sepolia to Ethereum Sepolia

make et

Join the community

Join our community of developers creating universal apps.