Lesson 13: Argument of type 'string' is not assignable to parameter of type 'Signer' #2645
-
Whenever I fetch a contract using Example: const getLendingPool = async (account: string): Promise<ILendingPool> => {
const lendingPoolAddressesProvider = await ethers.getContractAt(
"ILendingPoolAddressesProvider",
"0xB53C1a33016B2DC2fF3653530bfF1848a515c8c5",
// ** Type "string" is not assignable to type "Signer"
account
);
const lendingPoolAddress =
await lendingPoolAddressesProvider.getLendingPool();
// Getting Lending Pool Contract itself
const lendingPool = await ethers.getContractAt(
"ILendingPool",
lendingPoolAddress,
// ** Type "string" is not assignable to type "Signer"
account
);
return lendingPool;
}; Typecasting Although surprisingly, everything seems to run correctly without connecting these contracts to our My repo: https://github.com/SimasG/Solidity-JS-32hr-Course-FCC/tree/main/hardhat-defi-fcc-ts Any help would be appreciated! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 9 replies
-
@SimasG give it a type |
Beta Was this translation helpful? Give feedback.
@SimasG give it a type
Address