Skip to content

Conversation

hussein-aitlahcen
Copy link
Contributor

A CosmWasm contract that acts as a solver in the zkgm protocol, enabling fungible token transfers across IBC channels by managing escrowed assets.

Key Features

  • Dual Token Support: Handles both native Cosmos tokens (via BankMsg) and CW20 tokens
  • Fungible Lane Configuration: Maps (channel_id, base_token) pairs to counterparty beneficiaries for cross-chain settlement
  • Intent Whitelisting: Controls which packet hashes can be filled before finality
  • Solver Interface: Implements DoSolve to release escrowed tokens and return beneficiary addresses for acknowledgments

How It Works

  1. Admin configures fungible lanes linking channels/tokens to counterparty beneficiaries
  2. When zkgm calls DoSolve, the contract validates the order and releases escrowed tokens
  3. Relayers receive fees (base_amount - quote_amount)
  4. Returns the counterparty beneficiary address for source chain repayment (symmetric vault)

Security

  • Access controlled: Only zkgm can call DoSolve, only admin can configure lanes
  • Validates base_amount ≥ quote_amount to prevent underflows
  • Intent packets must be whitelisted to prevent unauthorized pre-finality fills

Copy link

vercel bot commented Aug 4, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
site ⬜️ Ignored (Inspect) Visit Preview Aug 11, 2025 0:34am

@hussein-aitlahcen hussein-aitlahcen force-pushed the cosmwasm-fungible-layer branch 2 times, most recently from 9237d5f to b0723cc Compare August 4, 2025 12:00
PoisonPhang
PoisonPhang previously approved these changes Aug 5, 2025
@unionlabs unionlabs deleted a comment from Soch-08 Aug 7, 2025
Copy link
Contributor

@benluelo benluelo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, just a few questions. also I hate to say it but some documentation on how this works would be great (either in code or a small readme)

@hussein-aitlahcen hussein-aitlahcen force-pushed the cosmwasm-fungible-layer branch 12 times, most recently from 5e8d05f to aa9d86b Compare August 11, 2025 12:27
benluelo
benluelo previously approved these changes Aug 11, 2025
@hussein-aitlahcen hussein-aitlahcen merged commit 014d506 into main Aug 11, 2025
117 of 119 checks passed
@hussein-aitlahcen hussein-aitlahcen deleted the cosmwasm-fungible-layer branch August 11, 2025 12:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants