0

I ran brownie run scripts/rizer_incept/set_tokenuri.py --network rinkeby and I got this error

TransactionError: Tx dropped without known replacement: 0x0a3c830623e6cd6d07783902f418cd1c3e169ebf1bcb08390f32ddf7aadae291

and when I ran it again I got this

Running 'scripts/rizer_incept/set_tokenuri.py::main'...
Working on rinkeby
The number of tokens you've deployed is: 1
Skipping 0, we already set that tokenURI!

The problem is that there is no image for the token on opensea:
https://testnets.opensea.io/assets/0x85994881438ed80948e2abacf9be29bf3d49f595/0

I correctly uploaded the json metadata and image to ipfs. See these content hashes

QmdxacdJ3VAXThKB2xbYCPBE9KWq8VfGHhdKhrFWMKGVij - metadata json file
QmNfavcLue8H9bsY5CC4v9rx4DSpwrVmEiC5ndjEsM8v1R - png image

this is my code in the file set_tokenuri.py, I got the code from https://github.com/PatrickAlphaC/nft-mix with some minor modifications.

from brownie import RizerIncept, accounts, network, config
from scripts.helpful_scripts import get_type, OPENSEA_FORMAT


rizer_metadata_dic = {
    "FIRST_R": "https://ipfs.io/ipfs/QmdxacdJ3VAXThKB2xbYCPBE9KWq8VfGHhdKhrFWMKGVij?filename=first-r.png",
}

def main():
    print("Working on " + network.show_active())
    rizer_incept = RizerIncept[len(RizerIncept) - 1]
    number_of_rizer_incepts = rizer_incept.tokenCounter()
    print(
        "The number of tokens you've deployed is: "
        + str(number_of_rizer_incepts)
    )
    for token_id in range(number_of_rizer_incepts):
        rizerType = get_type(rizer_incept.tokenIdToRizerType(token_id))
        if not rizer_incept.tokenURI(token_id).startswith("https://"):
            print("Setting tokenURI of {}".format(token_id))
            set_tokenURI(token_id, rizer_incept,
                         rizer_metadata_dic[rizerType])
        else:
            print("Skipping {}, we already set that tokenURI!".format(token_id))


def set_tokenURI(token_id, nft_contract, tokenURI):
    dev = accounts.add(config["wallets"]["from_key"])
    nft_contract.setTokenURI(token_id, tokenURI, {"from": dev})
    print(
        "Awesome! You can view your NFT at {}".format(
            OPENSEA_FORMAT.format(nft_contract.address, token_id)
        )
    )
    print('Please give up to 20 minutes, and hit the "refresh metadata" button')

Also I checked on checkmynft.com and I got Error: Could not fetch token URI. enter image description here

Do you know what the problem is?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.