I'm trying to deposit into AAVE v2 using hardhat.
My code is the following:
const hre = require('hardhat')
...
const contractAddress = '0x7d2768de32b0b80b7a3454c06bdac94a69ddc7a9'
const contract = await hre.ethers.getContractAt(AABI, contractAddress)
contract.deposit()
...
But I get the error:
contract.deposit is not a function hardhat-fork_1 | TypeError: contract.deposit is not a function
If I print the variable 'contract' I can see that something is retrieved by the blockchain but it does not contain the method.
Which is weird because I used the address specified here (LendingPool 0x7d2768de32b0b80b7a3454c06bdac94a69ddc7a9) and the ABI for the LendingPool address specified here.
I didn't put any file inside the hardhat contracts folder, should I?
My assumption is that since the contract is already on the chain I should be able to get it and use its methods.
Any idea on how I can achieve this?