Using Remix and metamask, I have deployed a contract on the rinkeby network that contains a function that, when called will send unsold tokens to a specific address. The code for it is like this

  function finalizeCrowdsale() public onlyOwner returns (bool) {
    require(token.transfer(tokenWallet, remainingTokens));
    return true;

When I attempt to call this function in remix (from the account which deployed the contract, which is the owner), I get an error

transact to JTokenCrowdsale.finalizeCrowdsale errored: Error: invalid 
argument 0: json: cannot unmarshal hex number with leading zero digits into 
Go struct field CallArgs.value of type *hexutil.Big

What causes this and how can I fix it?

Thank you.

1 Answer 1


Hope this helps:


value should be an integer (in Wei) and not a fraction of an Ether.

  • To clarify this answer to the OP a little bit: You probably might have set gas or gasPrice to something with a leading zero instead of a value in Wei.
    – n1cK
    Commented Mar 18, 2018 at 13:35

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.