Gas estimation errored with the following message (see below). The transaction execution will likely fail. Do you want to force sending? Returned error: {"jsonrpc":"2.0","error":"execution reverted","errorData":"0x118cdaa700000000000000000000000064c20ee5b

hello i have a problem
can anyone help me plz
Iam trying to mint NFT and it gives me that error
Gas estimation errored with the following message (see below). The transaction execution will likely fail. Do you want to force sending?
Returned error: {"jsonrpc":"2.0","error":"execution reverted","errorData":"0x118cdaa700000000000000000000000064c20ee5b4476bc4eb5dd236498669335382cd31","id":6741567838280345}

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.21;

import "@openzeppelin/contracts-upgradeable/token/ERC721/ERC721Upgradeable.sol";
import "@openzeppelin/contracts-upgradeable/token/ERC721/extensions/ERC721EnumerableUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/token/ERC721/extensions/ERC721URIStorageUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/token/ERC721/extensions/ERC721PausableUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/token/ERC721/extensions/ERC721BurnableUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";

contract UniqueFish is Initializable, ERC721Upgradeable, ERC721EnumerableUpgradeable, ERC721URIStorageUpgradeable, ERC721PausableUpgradeable, OwnableUpgradeable, ERC721BurnableUpgradeable {
/// @custom:oz-upgrades-unsafe-allow constructor
constructor() {
_disableInitializers();
}

function _baseURI() internal pure override returns (string memory) {
    return "ipfs://bafybeidr3yekk24hchac6r4hzoi2wnqufxful3wliljjkrl72pedplylfy/";
}
function initialize(address initialOwner) initializer public {
    __ERC721_init("UniqueFish", "LIFE");
    __ERC721Enumerable_init();
    __ERC721URIStorage_init();
    __ERC721Pausable_init();
    __Ownable_init(initialOwner);
    __ERC721Burnable_init();
}

function pause() public onlyOwner {
    _pause();
}

function unpause() public onlyOwner {
    _unpause();
}

function safeMint(address to, uint256 tokenId, string memory uri)
    public
    onlyOwner
{
    _safeMint(to, tokenId);
    _setTokenURI(tokenId, uri);
}

// The following functions are overrides required by Solidity.

function _update(address to, uint256 tokenId, address auth)
    internal
    override(ERC721Upgradeable, ERC721EnumerableUpgradeable, ERC721PausableUpgradeable)
    returns (address)
{
    return super._update(to, tokenId, auth);
}

function _increaseBalance(address account, uint128 value)
    internal
    override(ERC721Upgradeable, ERC721EnumerableUpgradeable)
{
    super._increaseBalance(account, value);
}

function tokenURI(uint256 tokenId)
    public
    view
    override(ERC721Upgradeable, ERC721URIStorageUpgradeable)
    returns (string memory)
{
    return super.tokenURI(tokenId);
}

function supportsInterface(bytes4 interfaceId)
    public
    view
    override(ERC721Upgradeable, ERC721EnumerableUpgradeable, ERC721URIStorageUpgradeable)
    returns (bool)
{
    return super.supportsInterface(interfaceId);
}

}

Please format the question clearly.


i ty to mint NFT as trasact from remix sir and i got this message may i know what kind of message is this ?

else the gas is


how many Eth i will need to make this transaction?


this is other shot
i already made created the contract from days ago
0xdc4586d1444a10710d2fd948d470ad192c1aaa59

eath time i try to make safmint
image

i got that message

plz how i can solve this problem ?

Pass the url as a string, means, within double quotes "ipfs://......", might be an issue, or else there is some logic error.

function _baseURI() internal pure override returns (string memory) {
return "ipfs://bafybeidr3yekk24hchac6r4hzoi2wnqufxful3wliljjkrl72pedplylfy/";
maybe i havent enough money as ETh on my wallet may i know how many gas i will neeed to mint photo

This is my Github profile.
If possible, hope to discuss further details.
Telegram: @DesarrollaorTalentosa
Best regards.

I meant here:
image

its better you check everything on testnet then go to mainnet.

If need help, you may contact at telegram @hreela

Thanks.

This is the Debug

[block:18383438 txIndex:60]

from: 0x64c...2cd31

to: UniqueFish.safeMint(address,uint256,string) 0xDC4...AAa59

value: 0 wei

data: 0xcd2...00000

logs: 0

hash: 0xb91...09653

Debug

transact to UniqueFish.safeMint pending ...

transact to UniqueFish.safeMint errored: Error occured: execution reverted. execution reverted The transaction has been reverted to the initial state. Error provided by the contract: OwnableUnauthorizedAccount Parameters: { "account": { "value": "0x64c20eE5b4476bC4eB5dD236498669335382cd31" } } Debug the transaction to get more information.


iam already have deployed contract but i dont click on proxy before i doplying is there is any update i can do after i have deploying contract ?

Do you see an infinite gas error on the IDE UI? I may be having the same issue. It seems a recent update created this bug, not sure if is remix or is OZ.

Error provided by the contract: OwnableUnauthorizedAccount Parameters: { "account": {
That is mean it's has code error
I bring this contract from wizard openzeppelin
But Really I don't know what kind of code that has error and what I should adjust

same issue, copying from the wizard shows this bug. Something is definitely wrong with OZ.

what a crazy i already bought the contract before i make testnet

Hi @ElanaSigns ,
I know the solution and can fix the issue.
I'll be glad to help you, please add me on Telegram: https://t.me/fullstackweb3dev
Have a great day!

Also, I'll be glad to help you too @Sben
Please add me on Telegram: https://t.me/fullstackweb3dev
Have a nice day!

2 Likes