Links
Wrapping Wiki: FIO Token and Domain NFT wrapping
Overview of development environment: [FIP-17.a] FIO Token Wrapping
Wrap use case: Wrap
Unwrap use case: Unwrap
Overview
Oracle code will be run by designated FIO Chain BPs with access to:
Oracles will:
On the FIO Chain
Monitor specific account by inspecting every block and looking for FIO contract
wraptokens
actionExecute ERC20
wrap
action to mint wFIO to the designated account
On the Ethereum Chain
Monitor Ethereum smart contract for inbound transfers of ERC-20 wFIO
Execute FIO contract
unwrap
action to transfer FIO to the designated account
Oracle Go Prototype
The original Oracle prototype code was written in Go and is located at: https://github.com/blockpane/fio.oracle
The FIO wrapping/unwrapping contract
The FIO wrapping/unwrapping contract specification is detailed in FIP 17.a: https://github.com/fioprotocol/fips/blob/master/fip-0017a.md
Github
fio.oracle
contract: https://github.com/fioprotocol/fio.contracts/tree/oracle/tokenwrap/contracts/fio.oracle
The Ethereum ERC20 wrapping/unwrapping contract
The Ethereum wrapping/unwrapping contract specification is detailed on the wiki: fio.erc20 - wFIO Contract Specification
Github
fio.erc20
repository: https://github.com/fioprotocol/fio.erc20
Functionality
There are two main use cases that concern the Oracle, Wrap and Unwrap. These are detailed below.
TBD: What are the watchdog/monitoring routines we expect from the Oracles?
Wrap
Wrap creates wFIO on the Ethereum chain.
See the following page for an overview of the Wrap use case: Wrap
Functionality | |
---|---|
Alice (via dApp) called |
|
Oracle monitors | Todd G What was the Go code doing to monitor the chain? |
Oracle validates | Todd G Need bullet list of validations |
If exceptions are found, Oracle takes action to unwind transaction | See Exception handling below Todd G Need to flesh this out |
Oracle executes | wrap(ethaddress, FIO (SUF) amount, obtid);
|
Listen for unwrapped events | |
Oracle validates | Todd G What type of validation is done on the Ethereum chain during a wrap? |
Once all Oracles have submitted | Todd G Does the oracle do any kind of monitoring or validation of the overall transaction (post consensus?) |
Exception handling
Error condition | Trigger | Type | fields:name | fields:value | Error message | Oracle Action |
---|---|---|---|---|---|---|
Invalid chain | Chain passed to | Oracle triggers | ||||
Invalid Ethereum address | Public address passed to | Oracle triggers | ||||
Unwrap
Unwrap converts wFIO on Ethereum chain to FIO Tokens on FIO chain.
See the following page for an overview of the Unwrap use case: Unwrap
Functionality | |
---|---|
Alice (dApp) executes | unwrap(fio address, amount);
|
Oracle monitors | Todd G What was the Go code doing to monitor the chain? Does it confirm burn? |
Oracle validates | Todd G Need bullet list of validations |
If exceptions are found, Oracle takes action to unwind transaction | See Exception handling below Todd G Need to flesh this out |
Registered Oracles call | fio.oracle contract Actions:
|
Oracle validates | Todd G What type of validation is done on the Ethereum chain during a wrap? |
Once all Oracles have submitted | Todd G Does the oracle do any kind of monitoring or validation of the overall transaction (post consensus?) |
Exception handling
Error condition | Trigger | Type | fields:name | fields:value | Error message | Oracle Action |
---|---|---|---|---|---|---|
Invalid FIO Address | FIO Address passed in with ERC-20 is not valid or does not exist | Oracle triggers a ERC20 | ||||
Oracle Components
TBD
0 Comments