0

I have downloaded and configured Besu as a Free Gas Network (https://besu.hyperledger.org/en/stable/HowTo/Configure/FreeGas/ ).

Creating transaction using Truffle works fine, but not in my application with ethereumjs tx:

        var rawTransaction = {
            "from": account,
            gasPrice:0,
            "gasLimit": web3js.utils.toHex(4000000),
            "to": contract._address,
            "value": "0x0",
            "data": encodedData,
            "nonce": web3js.utils.toHex(count),
        };
    const customCommon = Common.default.forCustomChain(
       'mainnet',
       {
          name: 'my-network',
          networkId: "2018",
          chainId: "2018",
       },
        "muirGlacier"
      );
      var transaction = new Tx(rawTransaction,{common:customCommon});
      //signing transaction with private key
      transaction.sign(privateKeyBuff);

      web3js.eth.sendSignedTransaction('0x' + transaction.serialize().toString('hex'))

Than I have an error:

Error : { Error: Transaction has been reverted by the EVM:
{
  "blockHash": "0x4c91078b140c84aae379bb704fa2a248ce9008675b4a0bcd8bd1ccb648b17011",
  "blockNumber": 33202,
  "contractAddress": null,
  "cumulativeGasUsed": 24221,
  "from": "0x90f8bf6a479f320ead074411a4b0e7944ea8c9c1",
  "gasUsed": 24221,
  "logs": [],
  "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
  "status": false,
  "to": "0x5e774d2a4726722d893ea4a45954ea9e38087e18",
  "transactionHash": "0xe384b93e253f9182b837a7d4cdd6c6b47b7f3a6eeecd63efd8e91a548fbcbe28",
  "transactionIndex": 0
}

This works fine on ropsten for instance (with a different gas parameter, and no customCommon call...).

2
  • From the gas used 24221 it seems to have started executing the contract. What does the contract do?
    – Ismael
    Oct 21 '20 at 16:26
  • 1
    The contract was trying to create an ERC721 based token. But it's a good direction, I will try to simplify the contract to soo if it's something linked to the code itself.
    – tomsoft
    Oct 22 '20 at 7:12

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.