delvtech / pypechain

Static Python bindings for Ethereum smart contracts.
Apache License 2.0
9 stars 2 forks source link

[ISSUE] Contract types of interface definitions not supported in pypechain #128

Open slundqui opened 2 months ago

slundqui commented 2 months ago

E.g., MorphoBlueConversions arguments include types IMorpho and IERC20, both of which are contract interfaces. Pypechain does not support this, which results in the following codegen:

def __call__(self, vault: IMorpho, baseToken: IERC20, ...) -> MorphoBlueConversionsConvertToBaseContractFunction:  # type: ignore
        clone = super().__call__(
        ...

Here, IMorpho and IERC20 are not valid types, which is ignored with the following type:ignore. Additionally, there are some oddities with calling this function via vanilla web3, which results in function abi does not match if attempting to pass in an address for these two arguments.