Closed uhhhh2 closed 4 years ago
What would be the best way to address this:
internalType
(of type AbiDataTypes
?) to the web3x AbiInput
and AbiOutput
typesThanks for the info. Probably the former. There is PR submitted for this: https://github.com/xf00f/web3x/pull/65
I will attempt to merge later this week.
Should be fixed in v4.0.6
In Solidity version 0.5.11 (https://github.com/ethereum/solidity/releases/tag/v0.5.11), an
internalType
key was added to the generated JSON ABI objects produced by the Solidity compiler.When I compile contracts with version 0.5.10 of the Solidity compiler, I get entries like the following in the JSON ABI objects produced:
When I compile contracts with version 0.5.11 of the Solidity compiler, I get entries like the following in the JSON ABI objects produced:
web3x-codegen appears to prepare the TypeScript ABI files (the
MyContractAbi.ts
files generated from the Solidity contractMyContract
) by copying the entries from the Solidity compiler's generated ABI JSON files, regardless of which subsets of each entry exist in the corresponding TypeScript type definitions in web3x. Thus, the newinternalType
field gets copied into theMyContractAbi.ts
files even though the web3xAbiInput
andAbiOutput
types (what I think are the web3x types for the objects in theinputs
andoutputs
arrays above) don't haveinternalType
fields.When I compile a project that uses the
MyContract.ts
andMyContractAbi.ts
files produced whenMyContract
was compiled with Solidity 0.5.11, the presence of the newinternalType
key not mentioned in the web3xAbiInput
andAbiOutput
types causes the TypeScript compiler to output errors like the following:Since the entries of the
inputs
andoutputs
arrays for the smart contract functions are "not assignable" to theAbiInput
andAbiOutput
types, the TypeScript compiler throws additional "not assignable" errors with the enclosingContractEntryDefinition
objects.