Mai Finance - Tutorials
🇺🇸/🇬🇧 English
🇺🇸/🇬🇧 English
  • The Unofficial Guide to Mai Finance
  • Tutorials
    • Polygon
      • How to get started on Polygon
      • Leverage Your Aave Market Tokens
      • camDAI beginner strategy
      • Farming using only stable coins
      • What to do with MAI on Polygon
      • What to do with Qi on Polygon
      • Stack DApps like Lego bricks
      • Farming or Staking? Or both?
      • How to combine farming and borrowing rewards
      • OHM forks on Polygon: The case of KLIMA
      • MAI single-staking with Ethalend
      • The Elephant, the Chimp and the Otter
      • From Traditional Finance to DeFi with Jarvis
      • DCA in bear and bull markets
      • Guides for Polygon supporters with Qi DAO
    • Avalanche
      • How to get started on Avalanche
    • Fantom
      • How to get started on Fantom
      • Leverage your crypto on Fantom
      • What to do with MAI on Fantom
      • Farming loop using SpiritSwap
      • Exodia Combo on Fantom
      • A Spooky Symfony
    • Moonriver
      • How to get started on Moonriver
      • Farming MAI on SolarBeam
    • Cronos
      • How to get started on Cronos
      • Farming Legos with CroDex
    • Harmony
      • How to get started on Harmony
      • One LP Pair, Many ways to farm
    • Gnosis Chain
      • How to get started on Gnosis Chain
    • Optimism
      • How to get started on Optimism
      • Three things have to notice before taking OP QiDao quest
      • Starter Guide for wstETH yield on Optimism
    • Arbitrum
      • How to get started on Arbitrum
    • BNB Chain
      • How to get started on BNB Chain
    • Moonbeam
      • How to get started on Moonbeam
      • Playing with MAI legos on StellaSwap
  • MAI University
    • Earning Passive Income with QiDAO
    • How does MAI work?
    • MAI loans and Vaults incentives
    • Debt repayment - Why and When?
    • Debt repayment - How?
    • MAI Metaverse
    • MAI Metaverse Pt.2
    • How to use MAI in the real life
    • How to interact directly with QiDao’s contracts
  • Join the Community
    • Discord
    • Telegram
    • Twitter
    • Use the app
Powered by GitBook
On this page
  • Step #1: Find an address of your vault
  • Step 2#. Go to a block explorer
  • Step #3: Interact with a smart contract.
  • Conclusion

Was this helpful?

  1. MAI University

How to interact directly with QiDao’s contracts

In case the front-end get any UI error or the RPC you have been using become congested, you could continue your works by interacting with contracts directly on blockchain explorers.

PreviousHow to use MAI in the real life

Last updated 2 years ago

Was this helpful?

Step #1: Find an address of your vault

Since you have to interact with a contract on blockchain explorers, it is necessary to find the exact addresses of the vault. QiDao has dedicated a specific and actively updated page for important addresses that you could find . Scroll down to find the vault address you wish to interact with, which has been already categorized into network sections.

In our guide, we will take the address of WETH V1 vault and OP V2 vault on Optimism as an example due to the recent raising demand for such vaults on Optimism network.

WETH Vault

0x062016cd29fabb26c52bab646878987fc9b0bc55

OP Vault

0xbf1aea8670d2528e08334083616dd9c5f3b087ae

Step 2#. Go to a block explorer

Blockchain explorer is a blockchain search engine that allows people to retrieve information about transactions, address, blocks, fees, and more. By using simple operations, you could extract useful information and interact directly with a smart contract under the Write Contract tab.

  1. Paste the address of vault you want to interact.

For exmple: 0x062016cd29fabb26c52bab646878987fc9b0bc55

3. Direct to Contract tab then go to Write Contract.

4. Connect your wallet. For example MetaMask

NOTE: Refresh the page if the page doesn’t show its connected wallet.

Step #3: Interact with a smart contract.

After your wallet connection completed, there are numerous ways to interact with a contract similar with front-end interactions including vault creation, MAI borrowing, repayment, collateral withdrawal… In this guide, we will use the payBacktoken function as example.

  1. Find your vault ID at Manage tab on your vault page on the website to put into _vaultID space.

2. Write the amount of token you want to repay. NOTE: The amount of token which you need to deposit/withdraw/repay followed by 18 decimal spots. Therefore, you need to adjust the number format before adding any number by using the automatic convert feature on blockscan as the following pictures show:

  • Press the cross button on the amount(unit256) section.

  • Select the 10 ^18 format for allowing blockscan automatically converts your number.

In case of QiDAO’s V2 contracts (screenshots below), there is an additional space called _front(unit256) where you also have to put a number zero (0) in order to the function be enable.

3. Press Write to proceed your transaction as normal.

Here's an example video made by a member of our community.

Conclusion

We showed the WriteContract features on Optimism, as an illustration, to assist users in interacting with any smart contract deployed by QiDao, which is also on any currently supported EVM blockchain. You should be more careful about the amount token you want to proceed followed by 18 decimal spots. Make sure you write the number correctly in the first time which will save you plenty of gas fees.

Go to a specific blockchain explorer. For example

https://optimistic.etherscan.io
here