dethcrypto / dethcrypto/TypeChain

ethers-v6: AddressLike in encodeFunctionData is incorrect

Open
#890 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
2.8k
Forks
376
PR merge metrics
No merged PRs in 30d

Description

`encodeFunctionData` is a synchronous function, so it cannot resolve `AddressLike`.
Interfaces functions (`encodeFunctionData` and others) should accept `string` instead of `AddressLike`

This code will throw an error:
```ts
declare const alice: Wallet
iface.encodeFunctionData('balanceOf', [alice]);
```

But this will NOT:
```ts
iface.encodeFunctionData('balanceOf', [await alice.getAddress()]);
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.