dethcrypto / dethcrypto/TypeChain

Overloads not generated for encode/decodeFunctionData

Open
#752 1 comment 1 reaction 0 assignees View on GitHub
Dominant language
TypeScript
Stars
2.8k
Forks
376
PR merge metrics
No merged PRs in 30d

Description

The following contract:
```
contract Overloads {
function myFunc(uint a) public {}
function myFunc(bool b) public {}
}
```
generates an interface like this:
```
export interface OverloadInterface extends utils.Interface {
contractName: "Overload";
functions: {
"myFunc(bool)": FunctionFragment;
};

encodeFunctionData(functionFragment: "myFunc", values: [boolean]): string;

decodeFunctionResult(functionFragment: "myFunc", data: BytesLike): Result;

events: {};
}
```
which has an incomplete `functions`object, and invalid `encodeFunctionData` and `decodeFunctionData`.

It should be:
```
export interface OverloadInterface extends utils.Interface {
contractName: "Overload";
functions: {
"myFunc(bool)": FunctionFragment;
"myFunc(uint256)": FunctionFragment;
};

encodeFunctionData(functionFragment: "myFunc(bool)", values: [boolean]): string;
encodeFunctionData(functionFragment: "myFunc(uint256)", values: [BigNumberish]): string;

decodeFunctionResult(functionFragment: "myFunc(bool)", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "myFunc(uint256)", data: BytesLike): Result;

events: {};
}
```

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.