Skip to content

Add Rescue Function for Uncommitted ERC20 Tokens #6

Description

@pali101

Description

Currently, if ERC20 tokens are sent directly to the contract, they become locked permanently. Implement a rescue function that allows the owner to recover only those tokens that aren’t committed to an active channel.

Enhancements

Rescue function

  • Add a rescueTokens function restricted to the contract owner.
  • Ensure it only withdraws tokens in excess of those committed to open channels.

Tracking commited tokens

  • Maintain a mapping to track the total ERC20 tokens tied up in channels.
  • Update this tracking during channel creation, redemption, and reclamation.

Security

  • Prevent misuse by allowing only partial withdrawals for uncommitted tokens.
  • Keep reentrancy protections and proper validations in place.

Benefits

  • Prevents accidental loss of ERC20 tokens.
  • Ensures funds tied to active channels remain secure.
  • Increases contract robustness and user trust.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions