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.
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 here. 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.
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.
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.
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.
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.