Prerequisites
- Node.js 18.0.0 or higher (
node --versionto verify) - A Sepolia wallet with a private key you control — never use a key holding real funds
- SepoliaETH for gas (get some from sepoliafaucet.com or faucets.chain.link/sepolia)
- Basic familiarity with running scripts from the terminal
1. Set up the project
package.json should include:
2. Configure your environment
Create a.env file with your credentials:
SEPOLIA_RPC_URL, any of these work:
- Public:
https://rpc.sepolia.orgorhttps://ethereum-sepolia-rpc.publicnode.com - Alchemy:
https://eth-sepolia.g.alchemy.com/v2/YOUR_KEY - Infura:
https://sepolia.infura.io/v3/YOUR_KEY
3. Scaffold the script
Createbridge.ts with the imports, configuration, and a main function. You will add functions to this file in the following steps, and call them from main.
4. Mint test USDT0 on Sepolia
The test USDT0 contract on Sepolia exposes a publicmint function. Add the following function to bridge.ts above main:
main:
Checkpoint: You should see a non-zero USDT0 balance logged after the mint confirms.
5. Approve the OFT Adapter
Before the OFT Adapter can move your tokens, it needs an ERC-20 allowance. Add this function abovemain:
main after mint:
await mint(...) call if you already have tokens from the previous run.
Checkpoint: The script should log a non-zero allowance after the approval confirms.
6. Quote the fee and send the bridge transaction
ThequoteSend call returns the LayerZero messaging fee in SepoliaETH, which you pass as msg.value to send. Add this function above main:
main after approve:
7. Verify arrival on Stable testnet
After sending, the script can poll the Stable testnet RPC until the tokens arrive. Add this function abovemain:
main after send:
8. Run the complete bridge
Yourmain function should now look like this:
Checkpoint: You should see output like this:
What you have built
You bridged USDT0 from Ethereum Sepolia to Stable testnet. You now know how to:- Mint test USDT0 on Sepolia using the contract’s public
mintfunction - Approve an OFT Adapter to spend ERC-20 tokens on your behalf
- Construct LayerZero
sendParamswith 32-byte address encoding and executor options - Quote the cross-chain messaging fee with
quoteSendbefore committing funds - Execute a cross-chain token transfer with
sendand confirm delivery on the destination chain - Verify on-chain state using Stable’s RPC (
https://rpc.testnet.stable.xyz, chain ID2201) and Stablescan
- Bridges & Cross-Chain Infrastructure — supported bridge providers, contract addresses, and fee structures
- Bridging to Stable — deep dive on OFT Mesh vs Legacy Mesh mechanics
- Testnet Information — full network parameters, RPC endpoints, and faucet details

