/
Unwrap

Unwrap

Todo

  • Need to create a dapp to interact with erc20 contract. Currently using: https://oneclickdapp.com/matrix-second

    • The complexity of this depends on how we structure the ERC20 contract. If we update the contract with all of the fields needed (e.g., passing in a FIO Address to approve) we may be able to use a simple contract explorer.

  • Decide on how to pass in FIO Address (see below)

Use case

Unwrap FIO Token:

  1. Alice (dApp) executes ERC20 unwrap sending in a hashed FIO Address

  2. ERC20 calls burn from Alice’s account

  3. Oracle monitors unwrap

  4. When ERC20 unwrap event is seen, Oracle validates and calls fio.oracle unwraptokens

  5. fio.oracle contract collects Oracle unwraptokens observations (consensus)

  6. When consensus is reached fio.oracle executes unwraptokens

Diagram link: https://app.diagrams.net/#G1ETfA3K6VTa-rhqcH7gJmRsFUIiGS2kDn

Discussion

Passing FIO Address into approve

  • Discussed using (hashed) FIO Address versus FIO Public Key.

    • A hashed address will generally be smaller and is a known fixed size.

    • To use a FIO Pub Key we would need to convert the pub key to a raw ecc pubkey so we can fit it in 32 bytes, otherwise it's 56 -> padded to 64 and we end up adding even more gas

    • The “standard” in FIO is to use FIO Pub Key

    • The oracle does a validation check on the FIO Address

    • Decision: We will pass in a (hashed) FIO Address to the ERC20 contract

    • TBD: Does the oracle pass a FIO pub key into unwrap tokens?

  • How to pass in FIO Address

 

Related content

FIO Token Wrapping Operations Manual
FIO Token Wrapping Operations Manual
More like this
Wrap
Read with this
[COMPLETE] Unwrap FIO Token Prototype
[COMPLETE] Unwrap FIO Token Prototype
More like this
Domain Wrapping
Domain Wrapping
Read with this
[COMPLETE] Wrap FIO Token Prototype
[COMPLETE] Wrap FIO Token Prototype
More like this
[FIP-17.a] FIO Token Wrapping
[FIP-17.a] FIO Token Wrapping
More like this