Closed brianmcmichael closed 3 years ago
Looks good to merge after the visibility fix.
I think I prefer using the ABIEncoderV2 vs flattening into a bunch of arrays. Is there an issue with adding the V2 encoder pragma to enable struct serialization?
Yeah getting UnimplementedFeatureError
out of solc
when compiling with parameterized struct in ABIEncoderV2
.
Looks something like:
./test.sh
dapp-build: building with linked libraries
UnimplementedFeatureError: Encoding type "struct CollateralOpts memory" not yet implemented.
dapp-test: rpc block: latest
hevm: (^?!): empty Fold
CallStack (from HasCallStack):
error, called at src/Control/Lens/Fold.hs:1310:28 in lens-4.18.1-9qmhqm9T86YJHOPOEopx4d:Control.Lens.Fold
^?!, called at src/EVM/Solidity.hs:342:20 in hevm-0.44.1-LcTWU2RNn7iMuZpzDnXLB:EVM.Solidity
Makefile:3: recipe for target 'test' failed
make: *** [test] Error 1
Haven't tested with solc:0.7.X
but kind of wondering if it got straightened out by then.
Yeah getting
UnimplementedFeatureError
out ofsolc
when compiling with parameterized struct inABIEncoderV2
.Looks something like:
./test.sh dapp-build: building with linked libraries UnimplementedFeatureError: Encoding type "struct CollateralOpts memory" not yet implemented. dapp-test: rpc block: latest hevm: (^?!): empty Fold CallStack (from HasCallStack): error, called at src/Control/Lens/Fold.hs:1310:28 in lens-4.18.1-9qmhqm9T86YJHOPOEopx4d:Control.Lens.Fold ^?!, called at src/EVM/Solidity.hs:342:20 in hevm-0.44.1-LcTWU2RNn7iMuZpzDnXLB:EVM.Solidity Makefile:3: recipe for target 'test' failed make: *** [test] Error 1
Haven't tested with
solc:0.7.X
but kind of wondering if it got straightened out by then.
I was playing with it for a while and having the same error. It gets solved if you declare the experimental pragma also in the caller. That would mean the spell action itself should have the declaration as well. That's something to evaluate. Here a PR with the functionality working: https://github.com/makerdao/dss-exec-lib/pull/75
I was playing with it for a while and having the same error. It gets solved if you declare the experimental pragma also in the caller. That would mean the spell action itself should have the declaration as well. That's something to evaluate. Here a PR with the functionality working: #75
This may have been the problem. I hadn't included it in the test files, which after looking at your PR must have been the issue.
LGTM after https://github.com/makerdao/dss-exec-lib/pull/75 is merged in.
Still wondering whether we should also import
CollateralOpts
into DssAction so that it's available to the spellcrafter, otherwise they will need to do a separate explicit import.