dethcrypto / dethcrypto/TypeChain

Accessing `factoryInstance.interface` should return the exact contract interface type

Open
#872 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

When accessing `Contract_factory.interface.encodeFunctionData` (interface is of generic type `Interface`):
![image](https://github.com/dethcrypto/TypeChain/assets/19427053/45fea13b-4f0a-48cf-8c0c-755463096d76)

When accessing `Contract__factory.createInterface().encodeFunctionData` (interface is of specific type `APTeamMultiSigInterface` which enforces type-safety):
![image](https://github.com/dethcrypto/TypeChain/assets/19427053/9dd941f9-26b1-4a52-8246-c7b00a5eb489)

Without updating the former to return a properly typed interface, changes in function data or data types will not be registered by the typechain generation process, causing runtime failures.

With this update, we catch errors during compile-time.

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.