feat: dynamic gas margin for Tempo recovery based on user gas params#8741
Open
bhavesh-prasad wants to merge 1 commit into
Open
feat: dynamic gas margin for Tempo recovery based on user gas params#8741bhavesh-prasad wants to merge 1 commit into
bhavesh-prasad wants to merge 1 commit into
Conversation
d1f7e4b to
cfd5179
Compare
Signed-off-by: B.Prasad <[email protected]> TICKET: CECHO-917 Signed-off-by: B.Prasad <[email protected]>
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
Implements the full TSS recovery flow for the Tempo chain (TIP-20 / EIP-7702).
What was there before
buildUnsignedSweepTxnTSSandrecoveryBlockchainExplorerQuerywere stubs returning empty/dummy objectsWhat this PR adds
Recovery infrastructure (
tempo.ts)recoveryBlockchainExplorerQuery— routes Etherscan-style queries to Tempo's Alchemy JSON-RPC endpoint (configured viaenvironments.ts)queryTempoRpc— translatesaccount/balance,account/tokenbalance, andaccount/txlistqueries intoeth_call/eth_getTransactionCountJSON-RPC callsbuildTempoSweepTx— shared helper that queries token balance, computes sweep amount, and builds an unsigned TIP-20 transfer transaction; used by both recovery pathsrecoverTSS— overrides base-class recovery with two paths:buildUnsignedSweepTxnTSSbuildUnsignedSweepTxnTSS— builds an unsigned TIP-20 sweep and returns theUnsignedSweepTxMPCv2structure for offline vault signingDynamic gas margin
GAS_MARGIN_UNITS = 20_000nconstantgasMarginUnits = gasLimit × maxFeePerGas / 10^12gasLimit × gasPricepattern used across all ETH-like coin recovery flows inabstract-eth; the/10^12factor converts from wei scale (18 decimals) to pathUSD's TIP-20 units (6 decimals)Environment config (
environments.ts)evmconfig entry sorecoveryBlockchainExplorerQuerycan resolve the RPC URL and API token