Skip to content

Add RescueFacet for stranded-token recovery - #2

Merged
vonMangoldt merged 1 commit into
mainfrom
add-rescue-facet
Aug 18, 2026
Merged

Add RescueFacet for stranded-token recovery#2
vonMangoldt merged 1 commit into
mainfrom
add-rescue-facet

Conversation

@vonMangoldt

Copy link
Copy Markdown
Member

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

  • RescueFacet with rescueToken(token, to, amount): master-only escape hatch for tokens sent to a vault address by direct wallet transfers. Strictly excluded via a ProtectedToken error: the underlying USD_TOKEN (its balance backs interest claims and the sweep-buffer reservation, and its surplus exits only through sweepOverhang) and the vault's own share token.
  • Deploy-slim storage mirror pinning master (slot 0) and USD_TOKEN (slot 8), covered by the pinned-subset phase of check_storage_layout.sh.
  • TokenRescued event, rescueSelectors() library entry, and the full test suite.

Live deployments (selector 0xe5711e8b, routed on all nine vaults)

Chain RescueFacet
Ethereum 0x2dd756555f59e6013A1D9C9f10Fd3D955930e52e
Arbitrum 0xb14C70b5a0E671f25cD787F0C6d4abDe092de201
Base 0x1830ac8892c751D9331f8d6572649A5F3Cb8ab05
Robinhood 0xb18a05B0a3073CFe5c94b4456Edd7c899554b3dd

All four instances are source-verified on their explorers.

Verification on this branch

  • forge build clean
  • Test suite: 9 tests, 0 failures, full coverage on the facet
  • script/check_storage_layout.sh: diamond + 17 facets identical, 3 slim facets pinned correctly, snapshot matches

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.
@vonMangoldt
vonMangoldt merged commit feeea3b into main Aug 18, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant