Deploy on a private network with gasPrice set to 0 ?
See original GitHub issueHi!
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:
- Created 2 years ago
- Comments:10 (1 by maintainers)
Top GitHub Comments
This may be related to #123 specifically the
chainId
opcode being used byDomainAware
Will need to confirm if Besu or Qorum support this opcode
I’m using GoQuorum and faced same issue. But I found workaround from ERC1820-QUORUM. This repository works on zero gasPrice.