Overview

The purpose of this document is to define initial recommendation for the operating procedures for running the wrapping operations, which is planned to be conducted by a decentralized group of oracles and custodians, who are also FIO Chain Block Producers. This document is not intended to describe the detailed functionality of the FIO contracts, Ethereum contracts or the Oracle software. See References below for that information.

Ethereum gas fees

Operations on the Ethereum Chain will require gas.

Oracles

Oracles receive FIO tokens every time a user wraps FIO. The amount is set by Oracles themselves and should be set in such a way that it covers all associated costs including Ethereum gas fees for wrapping. It is the Oracles' responsibility to convert FIO to ETH as required to maintain Oracle operations.

Custodians

Custodians do not receive wrapping fees, so the Ethereum gas fees should be covered by standard fee income generated by the FIO Chain.

Procedures

Custodians

Oracles

Environment Variables

Oracles will need to set environment variables as defined in the fio.oracle README: https://github.com/fioprotocol/fio.oracle

If the .env file is updated, the oracle service must be restarted to pull in the latest values.

Manual oracle transactions

Wrap/unwrap tokens/domains

If an approval is missing for some reason, it is the responsibility of the Oracle to execute a manual approval. The Mainnet Wrapping Status Page contains all of the information needed to execute a manual approval. (Click here for the Testnet Wrapping Status Page)

A command line script is included in the fio.oracle repository that enables manual wrapping and unwrapping of tokens and domains.

The manual scripts must be run on the server where the oracle is running. It uses the oracle functionality to execute the transactions. Success and error information will be logged in the usual oracle log files.

From the fio.oracle root directory:

> npm run oracle

This returns the usage:

Usage: npm run oracle ['wrap'|'unwrap'] ['tokens'|'domain'] [amount|domain] [fio handle or eth address] trxid 
     Examples: 
         npm run oracle wrap tokens 12000000000 0xe28FF0D44d533d15cD1f811f4DE8e6b1549945c9 ec52a13e3fd60c1a06ad3d9c0d66b97144aa020426d91cc43565483c743dd320 clean
         npm run oracle wrap domain fiohacker 0xe28FF0D44d533d15cD1f811f4DE8e6b1549945c9 ec52a13e3fd60c1a06ad3d9c0d66b97144aa020426d91cc43565483c743dd320 clean
         npm run oracle unwrap tokens 12000000000 alice@fiotestnet ec52a13e3fd60c1a06ad3d9c0d66b97144aa020426d91cc43565483c743dd320 clean
         npm run oracle unwrap domain fiohacker alice@fiotestnet ec52a13e3fd60c1a06ad3d9c0d66b97144aa020426d91cc43565483c743dd320 clean

Requests for manual transactions should be posted to the FIO Token Wrapping Committee Telegram channel.

Setting oracle fees

clio -u http://fiotestnet.blockpane.com push action fio.oracle setoraclefee '{
  "wrap_fio_domain": 60000000000,
  "wrap_fio_tokens": 50000000000,
  "actor": "qbxn5zhw2ypw"
}' -p qbxn5zhw2ypw@active

Potential Issues and Suggested Resolution

Security and Stability

Wrapping

User is attempting to wrap FIO to WFIO (FIO->Ethereum):

Unwrapping

User is attempting to unwrap WFIO to FIO (Ethereum->FIO):

Local devnet testing information

The nature of the local testing framework requires the use of the 3 producer accounts devtools utilized during the startup procedures.

Keys used during the startup process here:

These BPs are typically registered as oracles manually after the launch of the development chain. In the case of the oracles not registered, please use the following command using the eosio permissions:

Each oracle will be required to vote for fees prior to the activation of the wrapping services. Example of using setoraclefees:

Coordination channels

Custodians

Use Mainnet Telegram channel

Oracles

Use FIO Token Wrapping Committee Telegram channel

References

FIO Token Wrapping project

FIO Token Wrapping Go-to-market plan

/wiki/spaces/FO/pages/349569342 (Information on using the Devnet to wrap and unwrap tokens and Domains)

FIO Token Wrapping Technical Documentation