-
Notifications
You must be signed in to change notification settings - Fork 2.3k
external compile step erring for contract using AbiEncoderV2 #1774
Comments
Hey @wysenynja I'm not sure you set up the external compile script correctly. In the config you have
|
That’s not really the problem here. Truffle compile generates the artifacts the first run. The second run, the external compile step sees them (notice the paths for the external artifact sources) and tries to parse them and gives the error. I did this to show that isn’t my actual external compile script causing the issues with the artifacts. The artifacts come directly from “truffle compile” I could split it up, but that isn’t really related to the bug here. |
Yes but my point is that if you are using an improper setup in the config I'm not sure what we can expect Truffle to do (who knows how it will error). If you take out the improper compiler config lines, Truffle has no problem handling the artifacts correctly. This tells me that it absolutely has something to do with the provided config. |
Hmm, but actually you might be right. It does look like there might be something up with the compiled artifact. Even though it doesn't error without the config you had, |
Ok so we found a bug with |
Thank you! I realize how the reproduction repo running twice was a bit of a strange thing to do. It just seemed simpler than having two separate projects. This contract does use |
I think this bug also means that |
We use the schema in all cases, it's just a question of whether or not we validate in all cases. I thought we were validating everywhere but I guess that's not the case [anymore?]. I kind of want to turn on the validation and let the bug reports come flying in. But I won't do that so brashly :) |
Hi there, I'm having a similar issue with When I attempt to compile contracts through a custom compiler, the artifact object I'm creating is failing
I can post more details about the error messages I'm getting, if that helps. They're almost identical to @wysenynja 's log. I don't think multidimensional static arrays are an experimental ABI encoding either - the solc compiler has supported this kind of interface since at least version 0.4.8. Additionally, if I attempt to compile a standard Solidity contract that has the same inteface, via Are there any plans to support for 2-dimensional static-sized arrays into |
Ah I remember discussing the fix but looks like it didn't get into a PR. Just made a quick change that will support n-dimensional arrays of any type, static and dynamic. This is kind of a naïve fix, and doesn't account for structs. I'll need to refresh my memory on the allowable types syntax with the new encoder, but it should be relatively straightforward to get those in too. (Anyone here good with a regex and got a spare moment? PRs appreciated :) |
Quick follow-up (but then I have to stop procrastinating taxes): whoa structs are expressed as tuples! {
"name": "t",
"type": "tuple",
"components": [
{
"name": "x",
"type": "uint256"
},
{
"name": "y",
"type": "uint256"
}
]
}, So that's not even just string matching, then. Shouldn't be too hard to express this in JSON-Schema, but it does appear that it's more than a regex. |
I think truffle 5.0.8 has the fix for this. Will test soon |
|
Issue
truffle-contract-schema errs when validating a contract artifact created by truffle when the contract uses AbiEncoderV2.
Steps to Reproduce
https://github.com/WyseNynja/truffle-ABIEncoderV2-error-repro
Expected Behavior
The artifact should validate.
Actual Results
The text was updated successfully, but these errors were encountered: