fix(solana): provision fresh synthetics + correct value model (v0.2.1) - #8
Merged
Conversation
A brand-new Solana user's synthetic external-auth PDA doesn't exist until create_pda runs, and value-moving calls (the transfer_spl sweep, ERC20SPL transferFrom) are signed by it — so they revert until it's provisioned. - add provisionSynthetic / isSyntheticProvisioned / buildCreatePdaCall - submitRomeTxSolanaLane auto-provisions on first use (autoProvision defaults on; opt out for an explicit Activate step) - README: a Solana user's spendable balance is the wallet ATA surfaced as the ERC20SPL wrapper, moved with transfer/transferFrom, not native msg.value - 0.2.0 -> 0.2.1 Funded-verified on Hadrian: a fresh wallet auto-provisions, deposits into an ERC20SPL vault via transferFrom, withdraws, and sweeps back — the synthetic ends holding nothing. 66/66 tests.
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.
What
Makes the Solana lane work for a brand-new Solana user, and corrects the value model. Both gaps surfaced funded-testing the lane end-to-end with a genuinely fresh wallet.
Fresh-synthetic provisioning was missing. A new synthetic's
external_authPDA doesn't exist untilcreate_pdaruns, and value-moving calls (the sweep'stransfer_spl, ERC20SPLtransferFrom) are PDA-signed — so they revert until it's provisioned. The v0.2.0 lane never created it. (The original deposit test only passed because that synthetic was already provisioned and had leftover balance — invisible until a truly fresh wallet.)The value model. A Solana user's spendable balance is their wallet's SPL token account, surfaced 1:1 as the ERC20SPL wrapper (e.g.
wUSDC) — moved withtransfer/transferFrom, not nativemsg.value(the fund leg fills the token account, not the EVM native balance).Changes
provisionSynthetic/isSyntheticProvisioned/buildCreatePdaCallsubmitRomeTxSolanaLaneauto-provisions (create_pda) on first use —autoProvisiondefaults on; passautoProvision: falseto run your own one-time "Activate" step0.2.0→0.2.1Verification
tscclean · 66/66 tests (+3 provisioning) · lint cleanprovisioned? false → autoProvision fired create_pda → true; deposited into an ERC20SPL vault viatransferFrom, withdrew, swept the full amount back to the wallet — synthetic ended holding nothing.Companion docs update (dual-lane walkthrough → ERC20SPL model + Activate step) is a separate PR to the docs.