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(hasEnded());
    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.

Hope this helps:

https://github.com/ethereum/go-ethereum/issues/14682

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. – Nikita Fuchs Mar 18 at 13:35

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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