I have written a simple Token contract and when I deploy it in Remix I get the option to set a constructor parameter to set the Token cap:
When I try to compile and create this token in OpenZeppelin CLI using npx oz create I don’t see an option to insert this constructor parameter, and so it throws:
GGCoin deployment failed with error: Invalid number of parameters for "undefined". Got 0 expected 1!
How do I set this constructor parameter using OpenZeppelin CLI?
Given that your contract has a constructor (regular contracts) rather than an initializer (upgradeable contracts) I assume you are deploying a regular contract.
OpenZeppelin CLI supports deploying regular (non-upgradeable) contracts from 2.8.
OpenZeppelin CLI 2.8 is currently at release candidate.
To install run npm i @openzeppelin/cli@rc
We can then deploy a regular contract using the OpenZeppelin CLI and the interactive commands will ask for the constructor parameters:
$ npx oz deploy
✓ Compiled contracts with solc 0.5.17 (commit.d19bba13)
? Choose the kind of deployment regular
? Pick a network development
? Pick a contract to deploy Token
? cap: uint256: 1000000000000
✓ Deployed instance of Token
0xe78A0F7E598Cc8b0Bb87894B0F60dD2a88d6a8Ab
As an aside, we don't need to specify the full path for imports and can start at @openzeppelin.