This query is for informational purposes, with something that has had me in doubt all night.

I am trying to send a self-signed transaction for the creation of a contract

My Tx transaction to send is

  const rawTx = {
    from: config.public_key,
    to: 0x0,
    chainId: 3,
    data: handle.encodeABI()

At the beginning I had the shipping address to create a contract


Well, in eth this is the address to create contracts


Send my transaction with this address, I got the following error.

the contract is not created, but is sent to the address set, when I try to obtain information from the block, I get the following

"invalid argument 1: json: cannot unmarshal non-string into Go value of type hexutil.Uint"

      const status = await this.web3.eth.sendSignedTransaction(
      const { data, ...temp } = rawTx;
      const form = {
        transaction: rawTx
      const block= await this.web3.eth.getTransactionFromBlock(status.transactionHash);

status.transactionHash if it exists "0x5ae4a37cacbcebd222d3ed48e278266a0e15b06fa83b289d71a8f0122dd12a93" https://ropsten.etherscan.io/tx/0x5ae4a37cacbcebd222d3ed48e278266a0e15b06fa83b289d71a8f0122dd12a93

My question is, because using 0x0, or 0x0000000000000000000000000000000000000000, no errors, compared to using "0x0000000000000000000000000000000000000000", Because when I send ethers with the same function in the to field, I put an address in string format,

I use web@1.0.0-beta.35

  • from should be (public) account address, not public key. – goodvibration Dec 10 '19 at 19:30
  • it's an address, just that it was a typing mistake, The problem is not the appointment of the variables, but the to field, when it is named as string or number directly. – user7362292 Dec 10 '19 at 20:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.