[FIP-17.a] Technical Overview

Wrap FIO Tokens

Transfers FIO Tokens to designated FIO account for the purpose of wrapping.

Use case

  • User A wants to wrap X FIO Tokens to P public address on C chain.

  • User A fetches amount of Oracle fee using /get_oracle_fees.

  • User A executes FIO wraptokens action and passes in:

    • amount (X) of FIO tokens to wrap

    • public_address (P) on chain C where tokens should be delivered

    • chain_code C

    • max_oracle_fee - maximum amount of FIO user A is willing to pay the Oracles

  • X FIO Tokens are transferred to wrapping smart contract account.

  • Oracle fee is transferred from user A and distributed evenly to all registered Oracles.

  • Oracles monitor every block looking for wraptoken action (not covered by this FIP).

  • Once detected Oracles trigger minting of wrapped tokens on another chain.

Unwrap FIO Tokens

Transfers FIO Tokens from fio.wrapping to designated FIO account.

Use case

  • User A wants to unwrap FIO Domain to P public address on FIO Chain.

  • User A executes action on another chain (not covered by this FIP):

  • Oracles monitor every block on another chain (not covered by this FIP).

  • Once detected each Oracle executes unwrapdomain action and passes in:

    • fio_public_key where to transfer domain

    • fio_domain (D) to transfer

  • Once the last Oracle executes unwrapdomain action, FIO Domain is transferred to P.

Oracle Fees

  • Oracles set a fee they desire for wrapping.

Setting Oracle Fees

  • Each Oracle submits a fee for token and domain wrapping using setoraclefee.

  • Oracle fee is set to median of fees provided by all Oracles and then multiplied by number of registered oracles.

Fee Distribution

  • Oracle fee is transferred from user A and distributed evenly to all registered Oracles.