feat: implement Soroban router contract for atomic vault rebalancing#299
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
packages/contracts/router/with aMeridianRouterSoroban contract exposing a singlerebalance(depositor, from_vault, to_vault, shares, min_out, route_to)entry point that withdraws from one Meridian vault and deposits into another within a single transaction.depositor.require_auth()is called before any sub-invocations, so Soroban's auth tree enforces the depositor's signature over both legs atomically.min_out, ensuring the depositor cannot receive less than they specified.VaultInterfacetrait drives the cross-contract calls viacontractclient, so no vault WASM is compiled into the router.soroban-sdk::testutils: one verifies funds move correctly between vaults, the other confirms the slippage guard reverts as expected.scripts/deploy-testnet.shto build and deploy the router alongside the vault contract.docs/contracts.mddocumenting the contract interface, auth model, and slippage behaviour.packages/contracts/Cargo.tomlto include the router as a workspace member.Test plan
pnpm lint && pnpm typecheck && pnpm testpass locallycargo test -p meridian-routerpasses with both test cases green"slippage"message whenmin_outexceeds withdrawal amountscripts/deploy-testnet.shdeploys the router and prints its contract ID without errorCloses #15