question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Deploy on a private network with gasPrice set to 0 ?

See original GitHub issue

Hi!

I’m trying to deploy all the contracts from your repo on a private network (IBFT2), where the gas price is set to 0, but I’m unable to deploy the ERC1400

At first, I needed to change the 2_erc1820_registry.js because the rawTx in the file was built presuming that the gas price is NOT 0 ( pasted the rawTx in here to decode: https://www.ethereumdecoder.com/)

So I built my own custom rawTx with these parameters:

const deployerAddress = '0xF90aCf91BdAB539aAC3093E5C5b207b562354401';

module.exports = async function (deployer, network, accounts) {
  if (network == "test") return; // test maintains own contracts

  // await web3.eth.sendTransaction({
  //   from: accounts[0], to: deployerAddress, value: web3.utils.toWei('0.1'),
  // });

  var rawTx;
  await web3.eth.signTransaction(
    {
      from: "0xF90aCf91BdAB539aAC3093E5C5b207b562354401",
      gas: 0,
      gasLimit: "0x0c3500",
    }
  ).then((result) => {
    console.log("Signed Transaction result: \n");
    console.log(result);
    rawTx = result.raw;
  });

  await web3.eth.sendSignedTransaction(rawTx).then((res) => {
    console.log("Res send signed: \n");
    console.log(res);
    console.log('\n   > ERC1820 deployment: Success -->', res.contractAddress);
  }).catch((err) => {
    // eslint-disable-next-line no-useless-escape
    if (err.message.search(/the tx doesn\'t have the correct nonce|Nonce too low/g) >= 0) {
      console.log('\n   > ERC1820 deployment: Invalid nonce, probably already deployed');
    } else {
      console.log('\n   > ERC1820 deployment: Unknown error', err);
    }
  });


};

With this code I’m able to deploy the ERC1820 on ganache and my private network where the gasPrice is set to 0

However, I have an issue deploying the next contract, ie ERC1400 On ganache, the error is Method eth_signTransaction not supported And on my private network, the error is different: “ERC1400” hit an invalid opcode while deploying

My custom ERC1820 doesn’t seem to be the problem because I have no issue deploying the custom ERC1820 and the other contracts to rinkeby or kovan (which by the way shouldn’t be working since the gasPrice is NOT 0)

I’m deploying with truffle

Do you have any idea how I can solve this issue ?

Thanks

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:10 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
ecp4224commented, Jan 18, 2022

This may be related to #123 specifically the chainId opcode being used by DomainAware

Will need to confirm if Besu or Qorum support this opcode

0reactions
hiromailycommented, Oct 20, 2022

I’m using GoQuorum and faced same issue. But I found workaround from ERC1820-QUORUM. This repository works on zero gasPrice.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Deploying contract with no cost (gasPrice 0) on private network
When you set gasPrice: 0 in your Truffle configuration file, the default value is used instead. You can observe it by adding the...
Read more >
Configure free gas networks - Hyperledger Besu
In a free gas network, transactions still use gas but the gas price is zero, meaning the transaction cost is zero. Transaction cost...
Read more >
Free gas network - GoQuorum - 22.7.0 - ConsenSys
Networks that don't require gas as an incentive usually remove gas price or configure the gas price to be zero (that is, free...
Read more >
Deploying contracts privately - Truffle Suite
Using the Quorum client, you can set up a private blockchain that's only available to ... Match any network id gasPrice: 0, gas:...
Read more >
Permissioning · OpenEthereum Documentation
Network · Transaction type · Validator set · Gas price · Private transactions. Each user can have different permissions on each layer. All...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found