Open
Description
Version of Hardhat
2.22.15
What happened?
Cannot deploy a specific contract to a blockchain (tried fantom, sonic testnet and arbitrum). It stores the tx.gasPrice in the constructor.
Transaction failing to deploy it with default args:
const contract = await ethers.deployContract("Contract");
await contract.waitForDeployment();
https://arbiscan.io/tx/0x4aba3be69ebbff1c9696fd7f71f62334249ad72a21e150973917bd425cdabf98
Transaction successful specifying a higher gas price:
const contract = await ethers.deployContract("Contract", {gasLimit: 200000});
await contract.waitForDeployment();
https://arbiscan.io/tx/0x3b97e44c329f71a7ba502162578e7761d20b2cb1ab64475f41d066a9f7a2e1d1
Minimal reproduction steps
Create this contract:
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.28;
contract Contract {
uint64 private price; // Making it immutable works
constructor() {
price = uint64(tx.gasprice);
}
}
Try to deploy it on a network other than hardhat:
const contract = await ethers.deployContract("Contract");
await contract.waitForDeployment();
A repo which can replicate this has been set up:
https://github.com/0xSamWitch/VRFRequestInfoDeploymentFailure
Search terms
out of gas, tx.gasPrice
Metadata
Metadata
Assignees
Type
Projects
Status
Backlog