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
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
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.
Complete the file pages/index.js
and create your custom components and funtions using Wagmi as a base
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)
To learn more about this stack, take a look at the following resources:
- AAVE v3 - Learn how to interact with the protocol smart contracts
- RainbowKit Documentation - Learn how to customize your wallet connection flow.
- wagmi Documentation - Learn how to interact with Ethereum.
- Next.js Documentation - Learn how to build a Next.js application.
You can check out the RainbowKit GitHub repository - your feedback and contributions are welcome!