Skip to content

Commit

Permalink
feat(config): set gasPrice
Browse files Browse the repository at this point in the history
  • Loading branch information
mradkov committed May 1, 2024
1 parent f646d7d commit 4508ea1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion contracts/networks.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const networks = {
},
optimismSepolia: {
url: process.env.OPTIMISM_SEPOLIA_RPC_URL || "UNSET",
gasPrice: undefined,
gasPrice: 1_500_000, // for spikes and higher L2 prices.
accounts: PRIVATE_KEY !== undefined ? [PRIVATE_KEY] : [],
verifyApiKey: process.env.OP_ETHERSCAN_API_KEY || "UNSET",
chainId: 11155420,
Expand Down
6 changes: 5 additions & 1 deletion contracts/tasks/deploy-game.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,11 @@ task("deploy-game", "Deploys the SportsPredictionGame contract")
}

const gameContractFactory = await ethers.getContractFactory("SportsPredictionGame")
const gameContract = await gameContractFactory.deploy(deployParams)
const overrides = {
// L2s can require more gas or may produce "transaction underpriced: tip needed" errors.
gasPrice: networkConfig.gasPrice,
}
const gameContract = await gameContractFactory.deploy(deployParams, overrides)

console.log(`\nSportsPredictionGame contract deployed to ${gameContract.address} on ${network.name}`)

Expand Down

0 comments on commit 4508ea1

Please sign in to comment.