I'm trying to deploy a contract into ethereum, but I keep getting "out of gas" error.
How can I know in advance how much ethers I need to deploy a contract?
Ethereum Stack Exchange is a question and answer site for users of Ethereum, the decentralized application platform and smart contract enabled blockchain. It only takes a minute to sign up.
Sign up to join this communityI'm trying to deploy a contract into ethereum, but I keep getting "out of gas" error.
How can I know in advance how much ethers I need to deploy a contract?
One online tool (no syncing, no installing) is Remix a.k.a. Browser Solidity.
https://ethereum.github.io/browser-solidity
In screen shot below, a trivial contract called "Mortal" cost 319,273 gas to deploy.
Hope it helps.
npx hardhat deploy --network kovan
May 27, 2022 at 15:50