dethcrypto / TypeChain

🔌 TypeScript bindings for Ethereum smart contracts
MIT License
2.76k stars 365 forks source link

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

Open 0xNeshi opened 1 year ago

0xNeshi commented 1 year ago

When accessing Contract_factory.interface.encodeFunctionData (interface is of generic type Interface): image

When accessing Contract__factory.createInterface().encodeFunctionData (interface is of specific type APTeamMultiSigInterface which enforces type-safety): image

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.