wighawag / hardhat-deploy

hardhat deployment plugin
MIT License
1.19k stars 292 forks source link

Crazy gas estimation on Moonbeam #333

Closed rhlsthrm closed 2 years ago

rhlsthrm commented 2 years ago

I had a transaction send to deployment which burned through 32 GLMR as a gas fee!

https://moonbeam.moonscan.io/tx/0x917b0785b3777bc96a6d27ac4631770fcda26a86f5955397c8d06415d88d4be3

I'm not sure how this possibly happened, or what even triggered HH deploy to send funds to this address but I don't see how it could possibly try to consume so much gas. I even tried to manually set the gasPrice to something reasonable in the config (121 gwei) but it still happened.

https://github.com/connext/nxtp/blob/mainnet-services-deployment/packages/deployments/contracts/deploy/01_deployNomad.ts#L27

This is the line in my deploy script where the transaction happened. Any help is appreciated to see what I'm doing wrong.

wighawag commented 2 years ago

What make you think this is this line ? the line make a contract deployment, your tx has value attached to it and is not a contract deployment

As for gas price, hardhat-deploy fetch it from the node if it is not specified, so maybe the node you are talking to is giving you bigger gasprice than it should

rhlsthrm commented 2 years ago

This was very dumb and my mistake. I misconfigured things and did not realize I was using the default Hardhat mnemonic which has bots attached to it on every chain! Sorry for this!