Search code examples
solidityopenzeppelin

Deployment error in solidity while deploying ERC20 contract from OpenZeppelin


I was creating an ERC20 contract using an open zeppelin code. I was trying to declare the initial supply for my tokens and mind the initial supply in a constructor as shown in the image below. Everything was compiled perfectly without any errors. But when I try to deploy the contract, I get the following error:

creation of PJToken errored: Error encoding arguments: Error: invalid BigNumber string (argument="value", value="", code=INVALID_ARGUMENT, version=bignumber/5.5.0)

Code

I was trying to deploy my ERC20 contract, and was just trying to mint the total supply of tokens to my address.


Solution

  • For anyone who got the same kind of error, it was because inside the constructor I declared the integer which should be given as an input while you deploy the contract. But I was not giving it any value during the deployment, and it showed the following error. When I tried giving it some value it worked fine. Hope this helps anyone who faced this problem.