Skip to content

Testnet: EVM→Stellar Cross-Chain Payment — Full End-to-End Test #118

@0xdevcollins

Description

@0xdevcollins

Summary

Complete a full cross-chain payment end-to-end on testnet: EVM payer (Base Sepolia) → Stellar merchant. This validates the HTLC relay, CCTP bridge, and atomic swap guarantee.

Test Scenario

  • Payer: MetaMask on Base Sepolia
  • Payment method: USDC on Base (ERC-20)
  • Merchant settlement: USDC on Stellar
  • Bridge: Circle CCTP

Steps to Validate

Setup

  • HTLCEvm.sol deployed on Base Sepolia (address in .env)
  • Relay EVM private key funded with Base Sepolia ETH for gas
  • CIRCLE_API_KEY configured
  • Relay watching Base Sepolia for Locked events

Payment Flow

  1. Merchant creates payment: sourceChain: base, sourceAsset: USDC
  2. Quote fetched: ETH/Base → Stellar path found via CCTP
  3. Checkout: HTLC params fetched from API (not hardcoded) — Checkout: Fix Crypto Payment — Fetch HTLC Params from API (Not Hardcoded Zeros) #105
  4. Payer approves USDC and calls lock() on Base HTLC contract
  5. Relay detects Locked event on Base Sepolia
  6. Relay calls Soroban Settlement contract
  7. Settlement executes Stellar path payment via CCTP
  8. Soroban HTLC locks USDC for merchant on Stellar
  9. Relay calls withdraw() on Stellar → reveals secret S
  10. Relay calls withdraw(lockId, S) on Base → reimburses relay liquidity pool
  11. Payment → COMPLETED, merchant receives USDC on Stellar

Edge Case Tests

  • Quote expires before payer confirms → payer gets refund prompt
  • Relay goes down mid-flow → timelock expires → both sides auto-refund

Pass Criteria

  • Both HTLC sides complete atomically
  • Merchant receives correct amount net of fees
  • Relay liquidity pool reimbursed
  • Full flow completes under 60 seconds
  • No funds lost in any test run

Metadata

Metadata

Assignees

No one assigned

    Labels

    blockchainSmart contracts and chain integrationstestingTests and validation

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions