Error using NFT tutorial: Cannot create instance of ERC721PresetMinterPauserAutoId

Hi @abcoathup,

just a quick reply:
Your tutorial ([DRAFT] Create an NFT and deploy to a public testnet, using Truffle) is absolutely great, very well documented, thanks for that! I’m almost throught, I’m just stuck at the very last step where I get the following error when I try to mint a token on Rinkeby:

truffle(rinkeby)> nft = await ERC721PresetMinterPauserAutoId.at('0x53f45E14A37bFeA2Ce4099B413f8FfeD54593093')
Uncaught:
Error: Cannot create instance of ERC721PresetMinterPauserAutoId; no code at address 0x53f45E14A37bFeA2Ce4099B413f8FfeD54593093
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at runMicrotasks (<anonymous>)
    at Function.at (/home/code/mynft/node_modules/truffle/build/webpack:/packages/contract/lib/contract/constructorMethods.js:74:1)
    at Object.checkCode (/home/code/mynft/node_modules/truffle/build/webpack:/packages/contract/lib/utils/index.js:265:1)

Just another question: I saw that in the tutorial you use truffle - why not the openzeppelin CLI?

1 Like

Hi @some_guy,

Thanks for the feedback. :pray:

Apologies, the tutorial was using my example contract address and it wasn’t clear in the tutorial to change it to your own, I have now changed it to use deployed() instead.

truffle(rinkeby)> nft = await ERC721PresetMinterPauserAutoId.deployed()

I have also made some slight improvements to the end of the tutorial to make it clearer about what contract address to use.

Please ask all the questions that you need. I can update the tutorial to make it better for the community.


The ERC20 Preset tutorial I created Truffle, Remix, buidler and OpenZeppelin CLI versions.

I may do similar for the ERC721 Preset tutorial depending on demand.
I started with truffle as I wanted to share it with the widest audience.

Hi @some_guy,

Checking that you were able to deploy ok following the updated tutorial?