Skip to content

Latest commit

 

History

History
52 lines (32 loc) · 1.97 KB

README.md

File metadata and controls

52 lines (32 loc) · 1.97 KB

AAVE v3 collaterallized loans tool box

This is a simple application using RainbowKit + wagmi + Next.js in order to interact with the smart contacts of AAVE v3 on the test networks of Polygon, Arbitrum and Optimism

Setup

Fill the required smart contract addresses in the file constants/contracts.js. The contracts for Polygon Mumbai have been already filled

You can find the smart contract addresses in the official AAVE Documentation

Getting Started

First, run the development server:

npm run dev

Open http://localhost:3000 with your browser to see the result.

You can start editing the page by modifying . The page auto-updates as you edit the file.

Completing the functions

Complete the file pages/index.js and create your custom components and funtions using Wagmi as a base

Example

To delegate collateral use the following function:

    const { request } = await prepareWriteContract({
      address: variableDebtAToken,
      abi: ICreditDelegationTokenArtifact.abi,
      functionName: 'approveDelegation',
      args: [delegatee, parseUnits(amount, reserveDecimals)],
    })

    const { hash } = await writeContract(request)

Resources and Documentation

To learn more about this stack, take a look at the following resources:

You can check out the RainbowKit GitHub repository - your feedback and contributions are welcome!