I deploy the contract to the Rinkeby. Can I calculate the contract deployment cost from HardHat?
2 Answers
You can deploy to a standalone hardhat fork of mainnet and monitor the logs. It will give you something like this:
eth_sendRawTransaction
Contract deployment: <UnrecognizedContract>
Contract address: 0x6345e5...
Transaction: 0xee7f0f...
From: 0xf39fd6...
Value: 0 ETH
Gas used: 3439611 of 3439611
Block #18153240: 0x9963cd...