Implement ERC-20 token recovery mechanism #974
Labels
effort: high
Large or difficult task.
good first issue
Good for newcomers.
priority: 2
We will do our best to deal with this.
type: feature
New feature or request.
work: complicated
Sense-analyze-respond. The relationship between cause and effect requires analysis or expertise.
Originally discussed in https://github.com/sablier-labs/company-discussions/discussions/11
Implement a mechanism to recover any surplus amount of assets from the core contract. The following approach has been discussed at length in the original discussion:
Define a single variable to track down the amount of assets that the protocol owes to the users:
mapping (erc20 => amount)
. This variable should be updated whenever there is a transfer of asset into/out of the protocol.Declare a function to be used to manage the surplus amount, i.e. the difference between the token balance of the protocol minus the value stored. If called by admin, it can send surplus to the specified address. If called by a random address, it can only send the surplus amount to the admin address.
The text was updated successfully, but these errors were encountered: