aave-v3-core icon indicating copy to clipboard operation
aave-v3-core copied to clipboard

How to implement a contract for AAVE V3 "Supply, borrow, withdraw, loan etc" functsions

Open turgaycabalak opened this issue 3 years ago • 0 comments

I am trying to write a contract imported aave-v3 which includes the some aave v3 functions such as supply, borrow, repay etc. I will then make this contract accessible only to its owner.

For example:

// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.10;

import {IPool} from "@aave/core-v3/contracts/interfaces/IPool.sol";

contract AaveV3 {

     function supply(
        address pool,
        address asset,
        address onBehalfOf,
        uint256 amount
    ) public {
        IPool(pool).supply(asset, amount, onBehalfOf, 0);
        
    }

}

I don't understand what "address pool" is inside the supply function. I couldn't find any example contract defining these functions in.

Considering that I am inexperienced in this field, I am waiting for your help.

turgaycabalak avatar Aug 12 '22 12:08 turgaycabalak