Cross Chain Loan Repayment

How can you repay a loan in a cross-chain transaction?

The process of repaying a loan on the Mirai Protocol from Ethereum to Polygon can be broken down as follows:

  1. The user calls the Repay function on the dDAI contract and sends 50 DAI to the Mirai Protocol on Polygon to repay a portion of their loan.

  2. The repaid DAI is sent from Ethereum to Polygon using the Connext Network, which is a layer-2 scaling solution for Ethereum that enables fast, low-cost cross-chain transactions.

  3. Once the DAI is received on Polygon, it is sent to the smart contract wallet created for the user for accounting purposes.

  4. The 50 DAI is then used to repay a portion of the loan on the Mirai Network, which burns the corresponding dDAI token from the user's smart contract wallet. The user is notified of the repayment via the Push Protocol, which allows for real-time notifications of transactions on the blockchain.

  5. The dDAI token burned on Polygon is sent back to the Ethereum chain using the Connext Network.

  6. The dDAI token is then burned from the user's Ethereum wallet, the users credit is updated and the user is notified via the Push Protocol that the repayment process is complete.

In summary, the process of repaying a loan on the Mirai Protocol from Ethereum involves sending DAI from Ethereum to the Mirai Protocol on Polygon using the Connext Network, repaying the loan by burning the dDAI token from the user's smart contract wallet, and sending the burned dDAI back to Ethereum using the Connext Network, with notifications being sent to the user via the Push Protocol to keep them informed throughout the process.

Last updated