Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Predefined gas settings? #62

Closed
h0rizons opened this issue Mar 4, 2022 · 5 comments
Closed

Predefined gas settings? #62

h0rizons opened this issue Mar 4, 2022 · 5 comments

Comments

@h0rizons
Copy link

h0rizons commented Mar 4, 2022

I had a txn get stuck when running yarn presale-open --network mainnet and was wondering if theres any way I can change the gas used when executing the script commands? I tried looking in the hardhat config file but didn't see anything.

@liarco
Copy link
Member

liarco commented Mar 4, 2022

Hi @h0rizons, what do you mean by "stuck"? was it set to a low gas setting so you had to wait more than expected? Is it still stuck? Dit it fail?

The CLI uses your provider (e.g. Infura) in order to estimate the gas fee, so the default values should be fine as long as you don't get stuck in the middle of a gas war for some reason.

If you really want to, you can change the settings manually following the Hardhat documentation but it's not recommended.

Here is where you can customize those settings in your project:

// Setup Rinkeby network
if (process.env.NETWORK_RINKEBY_URL !== undefined) {
config.networks!.rinkeby = {
url: process.env.NETWORK_RINKEBY_URL,
accounts: [process.env.NETWORK_RINKEBY_PRIVATE_KEY!],
};
}
// Setup Ethereum network
if (process.env.NETWORK_MAINNET_URL !== undefined) {
config.networks!.mainnet = {
url: process.env.NETWORK_MAINNET_URL,
accounts: [process.env.NETWORK_MAINNET_PRIVATE_KEY!],
};
}

Let me know if it helps.

@liarco liarco added the feedback requested To be closed if no feedback is received label Mar 4, 2022
@h0rizons
Copy link
Author

h0rizons commented Mar 5, 2022

When I did 'yarn presale-open' the transaction to set the cost was stuck pending for a few hours. I sent myself a 0 ETH transaction with the same nonce and got it cleared - I did push that command right as ETH was dropping and gas was shooting up, so I think that might have been the issue.

I wanted to take a second to thank you for all your amazing work, all of the responses & time that you've put into this for the community. I really really appreciate it.

@liarco
Copy link
Member

liarco commented Mar 5, 2022

@h0rizons I see, unfortunately gas wars are pretty bad! 😞
Our code is not setting gas parameters, everything is handled by the provider itself which does its best in order to avoid transactions getting stuck, but it may happen. With out latest update you will be able to use Truffle Dashboard in order to run all transactions from MetaMask (and without private keys), this should make it easier to manage this kind of situations.

If you are wondering, if you already deployed your contract you should still be able to take advantage of the new version, try following these steps:

  1. download the latest version
  2. install all dependencies
  3. run yarn rename-contract NEW_NAME using the same name of the contract you already deployed
  4. replace the contract with the code you already deployed
  5. run yarn compile

Then you should be able to use all the new features while still using the old Solidity code. I hope this helps.

@h0rizons
Copy link
Author

h0rizons commented Mar 5, 2022

Thank you so much!

I also just wanted to let you know that I successfully used the ERC-721A beta build that you had posted (I think #29?) before 2.0 got pushed today. Deployed to mainnet, verified, successful pre-sale, public-sale, and reveal. 2500/3000. image

@liarco liarco removed the feedback requested To be closed if no feedback is received label Mar 5, 2022
@liarco
Copy link
Member

liarco commented Mar 5, 2022

I'm very happy to hear that @h0rizons. I wish you the best of luck with your collection! 😃

@liarco liarco closed this as completed Mar 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants