Open mubasharofficial opened 2 years ago
If I'm not mistaken the gas estimation is not handled by the contract, nor by the DAPP. It's the wallet (or the web3 provider in use) that estimates the gas usage for you. This project shouldn't be the culprit IMHO...
So, why are Rise this error when we call min() function and passed other wallet (except mint wallet address) and number of nft after call function remix ide give Wraning 'Gas estimation errored with the following message .....' if we execute force fully transiction will be failed..
Sorry for the late reply, unfortunately I don't understand the exact issue you are facing, but I would suggest taking a look at the new "lower gas" version of the contract (SimpleNftLowerGas.sol) to see if it solves the gas issue.
@liarco Hello, I am facing same issue the error from remix after using mint function is given below, There is enough ethereum and if i force it and metamask will then give error and transaction will fail. i'm doing this all testing on rinkeby testnet
the error from Remix- "Gas estimation errored with the following message (see below). The transaction execution will likely fail. Do you want to force sending? execution reverted: Insufficient funds! { "originalError": { "code": 3, "data": "0x08c379a000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000013496e73756666696369656e742066756e64732100000000000000000000000000", "message": "execution reverted: Insufficient funds!" } }"
@mubashar-official did you find any solution to this ?
Hi @jthak052, I think that both you and @mubashar-official are facing a problem that has nothing to do with gas. Simply, your wallet is telling you that it's unable to estimate the gas because the transaction is expected to fail for some reason. I don't have any clue about @mubashar-official since he didn't share the whole message, but in your case you can see the following error message: execution reverted: Insufficient funds!
. So, I don't know what transaction you are trying to run, but you are sending an invalid amount of ETH along with the transaction data.
I hope this can help you.
@liarco I thought the same first but the issue is something else coz minting of 1 token I've kept 0.26 eth and I've above 1 eth in my wallet soo I've attached the Transaction link and I've also published the code flat file on the etherscan soo you can check it out and mint it by yourself soo you can also get the same error
Transaction Error- https://rinkeby.etherscan.io/tx/0x0b5537811145a61c8223effdb9818ca2f9bd725b9db43be318a0b0640c367e94
Code- https://rinkeby.etherscan.io/address/0x0C9Df9ad4dd8b4ee870E6229C0B624a72A66eCe7#code
@jthak052 I'm afraid you are missing how transactions work when you are sending them directly through Etherscan or Remix. As you can see from the transaction you sent above you are trying to mint without passing any ETH with the transaction:
You have to specify the correct amount there, otherwise it will fail. Minting DAPPs are processing this stuff automatically for the user, but both Etherscan and Remix leave that to you so you can perform advanced tasks.
Edit: also, your wallet balance doesn't make any difference. You have to send an ETH value with the transaction explicitly, the amount is not managed by the contract method, it just verifies the requirements.
in the code the cost is define
uint256 public cost = 0.26 ether;
and the function mint just ask the number of the token I want to mine and it will multiply it with the cost which is predefined so the amount should be passed right?
function mint(uint256 _mintAmount) public payable mintCompliance(_mintAmount) {
require(!paused, "The contract is paused!");
require(msg.value >= cost * _mintAmount, "Insufficient funds!");
_mintLoop(msg.sender, _mintAmount);
}
Ok, so here is the misunderstanding! 😉
The contract cannot ask a person to send a specific amount of crypto with along with the transaction, it can only check that the amount he sends is enough in order to complete the process.
So the values in the code just do the following things:
N
tokensAs I said before, you have to send ETH explicitly when calling the mint(...)
function, otherwise it will see your transaction as if you are simply sending 0.0
(and then it fails for Insufficient funds!
).
Ok, so if I put 0.26 then i get this below error:- transact to SimpleNftLowerGas.mint errored: Error encoding arguments: Error: invalid BigNumber string (argument="value" value="0.26" code=INVALID_ARGUMENT version=bignumber/5.5.0)
and if i put the same amount in wei then i get this error:- Gas estimation errored with the following message (see below). The transaction execution will likely fail. Do you want to force sending? execution reverted: Invalid mint amount! { "originalError": { "code": 3, "data": "0x08c379a000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000014496e76616c6964206d696e7420616d6f756e7421000000000000000000000000", "message": "execution reverted: Invalid mint amount!" } }
and I checked 0 amount is going in metamask.
Ohh I did transaction from etherscan like this and it worked. i saw the video again and got the mistake i was doing. thanks mate.
@jthak052 I'm really happy to hear that! 😄 Btw, yes, unfortunately different platforms require different user input (ETH, WEI, dot/comma for decimails, etc.) so you must be very careful to what you are dealing with.
Good luck with your projects.
Is there any way we can hire you for the project for your expertise and guidance? You can take your fees.
Is there any way we can hire you for the project for your expertise and guidance? You can take your fees.
Thank you for your request @jthak052. I would be happy to have a chat in order to know a bit more about your project and see if I have enough time to support you as you need. Would you please reach out to me on Discord so we can have a chat?
See you there! :)
So, why are Rise this error when we call min() function and passed other wallet (except mint wallet address) and number of nft after call function remix ide give Wraning 'Gas estimation errored with the following message .....' if we execute force fully transiction will be failed..
thanks to all Hashlips community. I am fix this error actually do don't put gas fee gei.
Ohh I did transaction from etherscan like this and it worked. i saw the video again and got the mistake i was doing. thanks mate.
Can you please tell the mistake? Having same issue
@jthak052
when mint nft some other wallets address rise this issue and but remix VM network nft create by other wallets successfullly.