Skip to content

[TASK] Add rescue tokens functionality to the handlers/bridge systemΒ #125

@drewstone

Description

@drewstone

Overview

We want to "rescue tokens" by signature on the Substrate side which can come about using a handler or potentially not. This task should include investigate into the potential routes we can take given Substrate's capabilities.

Details

There is already a treasury account in protocol-substrate and the fees are being sent there:
https://github.com/webb-tools/protocol-substrate/blob/main/pallets/token-wrapper/src/lib.rs#L105
https://github.com/webb-tools/protocol-substrate/blob/main/pallets/token-wrapper/src/lib.rs#L291

So we don't need to implement a separate treasury pallet. What we can instead do is the following:

  • Add a rescue_tokens function to the token-wrapper pallet. This function signature for rescue_tokens should look something like:
fn rescue_tokens(asset_id: T::asset_id, to: T::AccountId, amount_to_rescue: BalanceOf<T>, nonce: u32)
  • Add an execute_rescue_tokens function to the token-wrapper-handler pallet.
  • Test the execution of rescue_tokens via the signature-bridge.

Metadata

Metadata

Assignees

No one assigned

    Labels

    p3 πŸ”΅Issues should be resolved eventually

    Type

    No type

    Projects

    Status

    Not Started πŸ•§

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions