rust-ethereum / ethabi

Encode and decode smart contract invocations
Apache License 2.0
517 stars 186 forks source link

Add support for the internalType (Solidity 0.5.11+) of the abi #230

Closed mattsse closed 3 years ago

mattsse commented 3 years ago

Solidity compiler at version 0.5.11 added a internalType field in the abi inputs/outputs.

This field contains the type as declared in the solidity code, this is useful to determine the actually struct type of a tuple. for exmaple:

{
  "components": [
    {
      "components": [..]
      "internalType": "struct Pairing.G1Point",
      "name": "A",
      "type": "tuple"
    }
  ],
  "internalType": "struct Verifier.Proof",
  "name": "proof",
  "type": "tuple"
}