Skip to content

getAddress function is not callable #4165

Open
@mariogutval

Description

@mariogutval

Ethers Version

6.6.0

Search Terms

getAddress

Describe the Problem

I faced this issue when I created an instance of AaveLendingPoolAddressProvider contract and tried to call the getAddress function, whose signature is getAddress(bytes32). Apparently, the function call is being ignored and the returned result corresponds to the async getAddress() method included in the BaseContract type.

It's interesting that when I remove the argument on the contract call, it requires me to add an argument, but when I change the type of the argument to, for example, ethers.Typed.int24, no warning/error is displayed.

I tried all the approaches you can see in the code snippet, but the result was same.

Code Snippet

const protocolDataProvider1 = await lendingPoolAddressProvider.getAddress(
  "0x0100000000000000000000000000000000000000000000000000000000000000",
);

const protocolDataProvider2 = await addressProvider.getAddress(
  ethers.Typed.bytes32(
    "0x0100000000000000000000000000000000000000000000000000000000000000"
  )
);

const protocolDataProvider3 = await lendingPoolAddressProvider["getAddress"](
  "0x0100000000000000000000000000000000000000000000000000000000000000",
);

const protocolDataProvider4 = await addressProvider["getAddress"](
  ethers.Typed.bytes32(
    "0x0100000000000000000000000000000000000000000000000000000000000000"
  )
);

Contract ABI

No response

Errors

No response

Environment

Hardhat

Environment (Other)

No response

Metadata

Metadata

Assignees

Labels

investigateUnder investigation and may be a bug.v6Issues regarding v6

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions