User Interface

A description of how to use the USDfil Interface

Introduction

This document begins describing the general USDfil interface to show how to mint USDfil, and redeem FIL.

Fig. 1 shows the USDfil interface and the overlaid text indicates each aspect of the interface to be familiar with.

  1. Contract Status - the contract status indicates whether the contract is currently enabled or disabled.

  2. Current exchange rate - The current exchange rate as reported by oracles.

  3. Wallet - This is where the user can connect their wallet to the USDfil system to financially interact with the system.

  4. Current Assets - This area shows how many FIL, USDfil, and rFIL tokens the connected wallet has.

  5. User Entry - Here, the user enters how much of the selected token they would like to swap. Refer to Table 1 in the main description to understand the return token for each deposit token type.

  6. Estimated Output - This area indicates the expected amount of output for the input amount.

  7. Swap Tokens - This button initiates a configured transaction to occur.

You can easily select which token you want to swap by clicking the desired asset. As your mouse hovers over a selectable asset, that asset will expand. Fig. 2 demonstrates this.

Minting

To mint USDfil, the first step is to select the FIL token to be swapped. The input bar should indicate the token to be swapped. Enter the amount to be swapped, and press the Swap button. A Metamask window will pop up and ask you to confirm the transaction. See Fig 3 for an example.

Once the transaction is confirmed, the user interface will show a transaction hash that can be used to monitor the status of the transaction. Fig. 4 shows the transaction hash that will appear after the user confirms the transaction, and the link can be clicked to follow the transaction status. The web UI will also show the transaction status after it settles on-chain.

Once the second transaction confirms, your assets will be updated to reflect the new FIL and USDfil balances as a result of the transaction.

Fig 5 shows that if the input does not meet the minimum requirements (10 FIL) or exceeds the maximum (controlled by a dynamic rate limiter), the swap button becomes disabled.

Withdrawals - Stage 1

Recall that withdrawals follow a two-stage procedure, due to the constraints imposed by finality on the Filecoin chain. In this section, we describe the first step, which involves conversion from USDfil to rFIL.

To convert USDfil to rFIL, select the USDfil asset and enter the amount to be swapped. The expected result of the swap is shown in the text entry below the user input. Click the "Swap" button. Next, a Metamask window will pop up and ask to create an approval for the USDfil smart contract to "spend" the USDfil token. This is necessary because the USDfil token is a standard ERC-20 token, but not the native token of the chain. Fig 6 shows an example.

After clicking approve, the transaction hash will appear in the same area as before. You can follow the status of the transaction by clicking the hash hyperlink. Fig 7 shows an example.

Once the approve is confirmed, a second Metamask window will appear. This second transaction is the actual transaction that will initiate the swap between USDfil and rFIL. Click confirm to approve this transaction. An example is shown below in Fig 8.

Once the user approves the second transaction, the hash will be shown that the user can click on to follow the status of the transaction. Once it is confirmed, the USDfil and rFIL balances will update to reflect the result of the transaction.

Withdrawals - Stage 2

The second stage of withdrawals involves swapping rFIL for FIL tokens. Select the rFIL token asset and proceed with using the UI. The steps are exactly the same as the ones for FIL deposits.

Last updated