My Token contract compiles fine using solidity 0.5.0:

import "/Users/lennard/Desktop/GGToken/node_modules/@openzeppelin/contracts/token/ERC20/ERC20Detailed.sol";
import "/Users/lennard/Desktop/GGToken/node_modules/@openzeppelin/contracts/token/ERC20/ERC20Capped.sol";
import "/Users/lennard/Desktop/GGToken/node_modules/@openzeppelin/contracts/token/ERC20/ERC20Burnable.sol";

contract GGToken is ERC20Capped, ERC20Detailed, ERC20Burnable {

    constructor (uint256 cap)
        ERC20Detailed("GGToken", "GGT", 18)
        public {
            _mint(msg.sender, 10000);

When I deploy this contract in Remix I get the option to set a constructor argument:

enter image description here

When I try to deploy the same contract using OpenZeppelin CLI's npx oz create I don't see this option, and it throws error: Invalid number of parameters for "undefined". Got 0 expected 1!

How do I set this constructor argument using OpenZeppelin CLI?

  • 1
    Try to post it on OpenZeppelin Community, they are usually a lot more "responsive" than this website. Commented Mar 23, 2020 at 14:50
  • If you have questions on using OpenZeppelin you can ask in the Community Forum: forum.openzeppelin.com Disclosure: I am the Community Manager at OpenZeppelin
    – abcoathup
    Commented Mar 23, 2020 at 22:42

1 Answer 1


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. https://forum.openzeppelin.com/t/openzeppelin-cli-2-8-release-candidate/2297

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

As an aside, we don't need to specify the full path for imports and can start at @openzeppelin.

pragma solidity ^0.5.0;

import "@openzeppelin/contracts/token/ERC20/ERC20Detailed.sol";
import "@openzeppelin/contracts/token/ERC20/ERC20Capped.sol";
import "@openzeppelin/contracts/token/ERC20/ERC20Burnable.sol";

contract Token is ERC20Capped, ERC20Detailed, ERC20Burnable {

    constructor (uint256 cap)
        ERC20Detailed("Token", "TKN", 18)
        public {
            _mint(msg.sender, 10000);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.