Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • fio.wrapping: contract deployed to DEV server with V1 History (eventually will move to Hyperion)

  • oracle: daemon running on server

  • ERC-20: open zeppelin contracts on Ropsten testnet

...

Prototype Review

approve vs transfer when wrapping

...

  1. approve

    1. Steps:

      1. User (via a dApp) calls wraptokens

      2. The oracle executes a mint then an approve

      3. The user (via a dApp) executes a transferFrom

      4. The user adds wfio token to Metamask (or similar) holding their Ethereum key and now sees their wfio

    2. Pros:

      1. This is a more standard approach to transferring ERC20 tokens. For example, Uniswap first asks users to “approve” the transaction. Once approved a second “transferFrom” step happens.

      2. Using approve gives an extra layer of security to the transfer process. In theory, if a mistake is made during approve, the approval can be modified (assuming the transferFrom has not occurred).

      3. The user pays the fees for the transferFrom

    3. Cons:

      1. Extra steps

  2. transfer

    1. Steps:

      1. User (via a dApp) calls wraptokensT

      2. The oracle executes a mint then a transfer to the users address

      3. The user adds wfio token to Metamask (or similar) holding their Ethereum key and now sees their wfio

Alternative

  1. User (via a dApp) calls wraptokens

  2. Oracle #1 calls mintTransfer

    1. ERC20 contract collects “observation” #1

  3. Oracle #2 calls mintTransfer

    1. mintTransfer calls _mint (mints to contract , not to Oracle)

    2. mintTransfer calls transfer (to user Ethereum key)

After several discussions with the team, it was decided that the extra steps for the user to transferFrom may not be worth the security benefits of using approve. We will go with the direct mint.

Todo

  • Only initial validation was done on wraptokens.

  • Need to update oracle to use _mint (to user address).