Open maxweng opened 4 years ago
Hi @maxweng,
Can you provide more information on why you are trying to do?
You can specify the compiler version with the CLI and it will be saved in project.json
$ npx oz compile --solc-version v0.6.8
That's part of my deployment script, because I need to write project settings based on different testnet. So what I have been doing is in my deploy script, to create a ProjectFile object so I can pass it to the init() function from OpenZeppelin/cli to write to the project.json file.
It worked like a charm for previous CLI versions, but stopped working after upgraded to v2.8.2. I know that I can specify those options as command arguments, but that's outside of my deploy script. The fix I have now is, in my deploy script, I call init() to create the project settings file, then set the ProjectFile object, and call ProjectFile.write(). It works for me. But I think there're still logic issues in your init() script.
Hope that helps to troubleshoot.
Hi @maxweng ! I’m sorry that you had this issue.
Thanks so much for reporting it! The project owner will review and triage this issue as soon as they can.
I'm glad that you have a workaround. Alternatively you could try using an earlier version of the CLI, such as v2.7.2 which was prior to the inclusion of regular deploys
For version 2.8.2, I created a ProjectFile() object, and was able to successfully set the compiler options with ProjectFile.setCompilerOptions().
But it doesn't actually get written to the
project.json
file when passing that ProjectFile object to the OpenZeppelin/cli init() script.