Add RescueFacet for stranded-token recovery - #2
Merged
Conversation
Master-only rescueToken(token, to, amount) returns tokens stranded on a vault by direct wallet transfers. The underlying USD_TOKEN (its vault balance backs interest claims and the sweep-buffer reservation; surplus exits only through sweepOverhang to the worker) and the vault's own share token are strictly excluded via a ProtectedToken error. Deploy-slim storage mirror pinning master (slot 0) and USD_TOKEN (slot 8), asserted by the pinned-subset phase of check_storage_layout.sh. No reentrancy guard: the single external call happens after all checks, the function writes no vault storage, and the caller is the master. Nine tests with full line, statement, branch and function coverage on the facet.
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.
Publishes the stranded-token rescue facet that is already live and registered on all nine vaults, so the public repo matches the deployed selector surface.
What is included
rescueToken(token, to, amount): master-only escape hatch for tokens sent to a vault address by direct wallet transfers. Strictly excluded via aProtectedTokenerror: the underlyingUSD_TOKEN(its balance backs interest claims and the sweep-buffer reservation, and its surplus exits only throughsweepOverhang) and the vault's own share token.master(slot 0) andUSD_TOKEN(slot 8), covered by the pinned-subset phase ofcheck_storage_layout.sh.TokenRescuedevent,rescueSelectors()library entry, and the full test suite.Live deployments (selector
0xe5711e8b, routed on all nine vaults)0x2dd756555f59e6013A1D9C9f10Fd3D955930e52e0xb14C70b5a0E671f25cD787F0C6d4abDe092de2010x1830ac8892c751D9331f8d6572649A5F3Cb8ab050xb18a05B0a3073CFe5c94b4456Edd7c899554b3ddAll four instances are source-verified on their explorers.
Verification on this branch
script/check_storage_layout.sh: diamond + 17 facets identical, 3 slim facets pinned correctly, snapshot matches