Skip to content

Commit

Permalink
increase gas price to prevent error: insufficient funds for gas * pri…
Browse files Browse the repository at this point in the history
…ce + value
  • Loading branch information
jp-ryuji committed Mar 28, 2023
1 parent 361f288 commit fb04f7a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion section7-kickstart-solc-0.8.9/ethereum/deploy.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ const provider = new HDWalletProvider(
process.env.GOERLI_ENDPOINT_WITH_API_KEY,
);
const web3 = new Web3(provider);
const gasForDeploy = 2000000;

const deploy = async () => {
const accounts = await web3.eth.getAccounts();
Expand All @@ -18,7 +19,7 @@ const deploy = async () => {
try {
const result = await new web3.eth.Contract(compiledFactory.abi)
.deploy({ data: compiledFactory.evm.bytecode.object })
.send({ gas: "1400000", from: accounts[0] });
.send({ gas: gasForDeploy, from: accounts[0] });

console.log("Contract deployed to", result.options.address);
} catch (err) {
Expand Down

0 comments on commit fb04f7a

Please sign in to comment.