cosmwasm/cw-escrow-vault/README.md
The CW Escrow Vault is a CosmWasm smart contract that acts as a solver in the UCS03 ZKGM protocol, enabling fungible cross-chain asset transfers between Cosmos and EVM chains. It manages the escrow and release of native and CW20 tokens, serving as the Cosmos-side counterparty to the UnionversalToken.sol contract on EVM chains.
In the UCS03 ZKGM protocol, cross-chain transfers use a sophisticated filling mechanism where:
The CW Escrow Vault implements the ISolver interface to participate as an automated market maker in this system, creating a fungible lane between chains.
Both vaults are configured as solvers where:
counterparty_beneficiaryThe contract implements the ZKGM solver interface:
pub enum QueryMsg {
IsSolver, // Returns success to indicate solver capability
AllowMarketMakers, // Returns true to allow other market makers
}
pub enum ExecuteMsg {
DoSolve {
packet: Packet,
order: CwTokenOrderV2,
path: Uint256,
caller: Addr,
relayer: Addr,
relayer_msg: Bytes,
intent: bool,
}
}
When DoSolve is called:
base_amount - quote_amountquote_amount to the receivercounterparty_beneficiary addressSetFungibleCounterparty {
path: Uint256, // Routing path identifier
channel_id: ChannelId, // IBC channel
base_token: Bytes, // Token on source chain
counterparty_beneficiary: Bytes, // UnionversalToken.sol address on EVM
escrowed_denom: String, // Local token to use for filling
}
WhitelistIntents {
hashes_whitelist: Vec<(H256, bool)>, // Packet hashes and approval
}
DoSolveTo integrate with the Escrow Vault:
The vault will automatically participate as a solver in the ZKGM protocol, filling orders and maintaining fungibility between chains.