joshstevens19 / ethereum-abi-types-generator

Generate typings based on your ABIs, with provider wrappers exposed.
MIT License
163 stars 22 forks source link

Incorrect output when using solidity structs in public interface #45

Open ssadler opened 2 years ago

ssadler commented 2 years ago

Hi, thanks for the great lib!

I have encountered a bug where the same type is used for arguments which are both a different struct, for example, in the generated output:

calcDue(                       
  config: CalcDueRequest,        // internalType is "struct Config"
  notice: CalcDueRequest,        // internalType is "struct Notice"
  toBlock: BigNumberish,           
  overrides?: ContractCallOverrides
): Promise<BigNumber>;             

This is using ethers v5 and 1.3.2 of ethereum-abi-types-generator.

Also, it seems like there might be an opportunity to unify all the interfaces that point to the same struct, so that you could just have "Notice" instead of "NoticeRequest" and "NoticeResponse", per method?

Thanks

joshstevens19 commented 2 years ago

Hey have you got the ABI for this?