Skip to content
This repository has been archived by the owner on Jan 24, 2022. It is now read-only.

Set compiler options not working with OpenZeppelin/cli init() script #1565

Open
maxweng opened this issue Jul 8, 2020 · 3 comments
Open

Comments

@maxweng
Copy link

maxweng commented Jul 8, 2020

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.

@abcoathup
Copy link
Contributor

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

@maxweng
Copy link
Author

maxweng commented Jul 16, 2020

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.

@abcoathup
Copy link
Contributor

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants