Lesson 13 - Error when using @aave/core-v3
to get pool address
#2781
-
Hi, I am trying to use Error detailsError: call revert exception [ See: https://links.ethers.org/v5-errors-CALL_EXCEPTION ] (method="getPool()", data="0x", errorArgs=null, errorName=null, errorSignature=null, reason=null, code=CALL_EXCEPTION, version=abi/5.7.0)
at Logger.makeError (/Users/levblanc/projects/web3-defi-hardhat/node_modules/@ethersproject/logger/src.ts/index.ts:269:28)
at Logger.throwError (/Users/levblanc/projects/web3-defi-hardhat/node_modules/@ethersproject/logger/src.ts/index.ts:281:20)
at Interface.decodeFunctionResult (/Users/levblanc/projects/web3-defi-hardhat/node_modules/@ethersproject/abi/src.ts/interface.ts:427:23)
at Contract.<anonymous> (/Users/levblanc/projects/web3-defi-hardhat/node_modules/@ethersproject/contracts/src.ts/index.ts:400:44)
at step (/Users/levblanc/projects/web3-defi-hardhat/node_modules/@ethersproject/contracts/lib/index.js:48:23)
at Object.next (/Users/levblanc/projects/web3-defi-hardhat/node_modules/@ethersproject/contracts/lib/index.js:29:53)
at fulfilled (/Users/levblanc/projects/web3-defi-hardhat/node_modules/@ethersproject/contracts/lib/index.js:20:58)
at processTicksAndRejections (node:internal/process/task_queues:96:5) {
reason: null,
code: 'CALL_EXCEPTION',
method: 'getPool()',
data: '0x',
errorArgs: null,
errorName: null,
errorSignature: null,
address: '0xa97684ead0e402dC232d5A977953DF7ECBaB3CDb',
args: [],
transaction: {
data: '0x026b1d5f',
to: '0xa97684ead0e402dC232d5A977953DF7ECBaB3CDb',
from: '0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266',
gasLimit: BigNumber { _hex: '0x01bad458', _isBigNumber: true }
}
} I really have no ideas why it says call exception, because I confirm that:
const lendingPoolAddressProvider = await ethers.getContractAt(
'IPoolAddressesProvider',
poolAddressProvider,
account
);
console.log(
'>>>>>> lendingPoolAddressProvider.getPool',
lendingPoolAddressProvider.getPool // function exists
);
const lendingPoolAddress = await lendingPoolAddressProvider.getPool();
console.log('>>>>>> lendingPoolAddress', lendingPoolAddress); // => throws above exception My repoHere is my repo: https://github.com/levblanc/web3-defi-hardhat Please run:
Please PR to the |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 19 replies
-
@levblanc Like we were using Are you using it intentionally core-v3? |
Beta Was this translation helpful? Give feedback.
-
What was the initial |
Beta Was this translation helpful? Give feedback.
-
@alymurtazamemon @krakxn @othaime-en I think I found something: the On v2When I click it's mainnet address link on this page: It goes to Etherscan: On v3Deployed contracts are on many different chains, and in my config, I used the Polygon one: The address link for and seems this address does not have a record on Etherscan: Possible Cause of ErrorIn my local, I am forking Ethereum mainnet following Patrick's guide, but the deployed contract address doesn't exist on my fork. This brings me to a further queries
const lendingPoolAddressProvider = await ethers.getContractAt(
'IPoolAddressesProvider',
poolAddressProvider,
account
);
console.log(
'>>>>>> lendingPoolAddressProvider',
lendingPoolAddressProvider // this can show the contract info with no issue
); |
Beta Was this translation helpful? Give feedback.
-
I have the exact same issue with Polygon, Arbitrum, Avalanche chains when attempt to use their deployed PoolAddressProvider addresses for these chains. It works perfectly under Ethereum and as able to get hold of a flashloan as per the docs, but unfortunately, not for the other chains. I´ve raised an issue on Aave v3 GitHub aave/aave-v3-core#805 but not getting any response or assistance on this matter. Would appreciate any help or guidance to resolve. Thank you |
Beta Was this translation helpful? Give feedback.
@levblanc Like we were using
"@aave/protocol-v2": "^1.0.1"
, I am not sure if they have converted to the core package or is there any v3 version available for"@aave/protocol-v2
.Are you using it intentionally core-v3?