Skip to content

Feature/rescue funds#243

Merged
ifelsedeveloper merged 5 commits intomasterfrom
feature/rescue-funds
Mar 10, 2026
Merged

Feature/rescue funds#243
ifelsedeveloper merged 5 commits intomasterfrom
feature/rescue-funds

Conversation

@ifelsedeveloper
Copy link
Contributor

Change Summary

What does this PR change?
Add Rescuable mixin (contracts/mixins/Rescuable.sol) and IRescuable interface (contracts/interfaces/IRescuable.sol) allowing contract owners to recover stuck ERC20 tokens and native ETH. Add RescuableMock and NoReceiveOwnerMock test helpers, and a full Hardhat test suite.

Related Issue/Ticket:
https://1inch.atlassian.net/browse/PT1-421

Testing & Verification

How was this tested?

  • Unit tests
  • Integration tests
  • Manual testing (describe steps)
  • Verified on staging

New test file test/contracts/Rescuable.test.ts covers:

  • ERC20 token rescue by owner
  • Partial ERC20 balance rescue
  • Native ETH rescue by owner
  • Partial ETH balance rescue
  • Revert when called by non-owner (OwnableUnauthorizedAccount)
  • Revert when ETH transfer fails (ETHTransferFailed)
  • Revert when token transfer returns false (SafeTransferFailed)

All 8 tests pass.

Risk Assessment

Risk Level:

  • Low - Minor changes, no operational impact
  • Medium - Moderate changes, limited impact, standard rollback available
  • High - Significant changes, potential operational impact, complex rollback

Risks & Impact

  • New abstract mixin — no changes to existing contracts; adopters opt in by inheriting Rescuable.
  • rescueFunds is onlyOwner-gated; no risk to user funds. Owner can only withdraw tokens/ETH held directly by the contract.

@codecov
Copy link

codecov bot commented Mar 10, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Copy link

@BoogerWooger BoogerWooger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All ok

@ifelsedeveloper ifelsedeveloper merged commit 81ad207 into master Mar 10, 2026
8 checks passed
@ifelsedeveloper ifelsedeveloper deleted the feature/rescue-funds branch March 10, 2026 15:54
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.

2 participants