Giter VIP home page Giter VIP logo

all-on-chain-generated-nft's Introduction

Hi there ๐Ÿ‘‹, I'm Patrick Collins!

๐Ÿ›ก๏ธ Co-founder of Cyfrin

Learn smart contracts & solidity here!

YouTube Playlist

Patrick Collins Linkedin Alpha Chain YouTube Patrick Collins Medium Patrick Collins Twitter Patrick Collins StackOverflow Patrick Collins Twitch

I'm an avid Smart Contract/Blockchain Software Engineer, Web3 Developer Advocate & Educator, and Smart Contract Auditor.

I'm here to help the world learn to code, do great things with data prowess, python lover, dance enthusiast, and life enthusiast.

Github Stats ๐Ÿ“Š

Patricks's github stats

Stack Overflow & Stack Exchange Stats

profile for Patrick Collins on Stack Exchange, a network of free, community-driven Q&A sites

YouTube Stats

Patrick's youtube stats

all-on-chain-generated-nft's People

Contributors

bodasooqa avatar patrickalphac avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

all-on-chain-generated-nft's Issues

gas error

Error: ERROR processing /Users//Desktop/all-on-chain-generated-nft/deploy/01_Deploy_SVGNFT.js:
InvalidInputError: Transaction gas limit is 30582296 and exceeds block gas limit of 30000000

thats the issue that comes up when i try to deploy my svg .... any way to fix this ?

Transactions working on SVGNFT but fails on RandomSVG

Hey, I have been trying to follow the instruction mentioned in one of your tutorials and I am unable to mint the random SVG.

I have set up the correct URLs and private key environment variables.

I am getting the following error:

`Let's wait for the Chainlink VRF node to respond...
Now let's finsih the mint...
An unexpected error occurred:

Error: ERROR processing /Users/raviagrawal/Work/NFT On Chain/all-on-chain-generated-nft/deploy/02_Deploy_RandomSVG.js:
Error: transaction failed (transactionHash="0xd7930b5bba305cdda3bfd8b998824caf54aad80414c2997880e95efabe42a833", transaction={"hash":"0xd7930b5bba305cdda3bfd8b998824caf54aad80414c2997880e95efabe42a833","type":2,"accessList":[],"blockHash":null,"blockNumber":null,"transactionIndex":null,"confirmations":0,"from":"0x9894ED3DD29241DB5229DD9E54FA6C8ABd044EE5","gasPrice":{"type":"BigNumber","hex":"0x69fc890b"},"maxPriorityFeePerGas":{"type":"BigNumber","hex":"0x59600ed7"},"maxFeePerGas":{"type":"BigNumber","hex":"0x69fc890b"},"gasLimit":{"type":"BigNumber","hex":"0x1e8480"},"to":"0xdCF351e91BBA51125FA871A93FAC873022D9E24e","value":{"type":"BigNumber","hex":"0x00"},"nonce":15,"data":"0x624194c70000000000000000000000000000000000000000000000000000000000000003","r":"0xa8a37caf2a32071c9824fae1bf5cee88b84896a8102944dff67cb9c21b64fe56","s":"0x349d07927fcf29df6c9a65684ed2a6ecc2d07ff50560b3a0f56aeaa588373edb","v":1,"creates":null,"chainId":4}, receipt={"to":"0xdCF351e91BBA51125FA871A93FAC873022D9E24e","from":"0x9894ED3DD29241DB5229DD9E54FA6C8ABd044EE5","contractAddress":null,"transactionIndex":36,"gasUsed":{"type":"BigNumber","hex":"0x5eba"},"logsBloom":"0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000","blockHash":"0x47c5a77fc2b388222e59bb67b1714a807eb3ae88db544ad0652e26a301d479a7","transactionHash":"0xd7930b5bba305cdda3bfd8b998824caf54aad80414c2997880e95efabe42a833","logs":[],"blockNumber":10006270,"confirmations":1,"cumulativeGasUsed":{"type":"BigNumber","hex":"0x0122e634"},"effectiveGasPrice":{"type":"BigNumber","hex":"0x66800a43"},"status":0,"type":2,"byzantium":true}, code=CALL_EXCEPTION, version=providers/5.5.2)
at Logger.makeError (/Users/raviagrawal/Work/NFT On Chain/all-on-chain-generated-nft/node_modules/@ethersproject/logger/src.ts/index.ts:225:28)
at Logger.throwError (/Users/raviagrawal/Work/NFT On Chain/all-on-chain-generated-nft/node_modules/@ethersproject/logger/src.ts/index.ts:237:20)
at EthersProviderWrapper. (/Users/raviagrawal/Work/NFT On Chain/all-on-chain-generated-nft/node_modules/@ethersproject/providers/src.ts/base-provider.ts:1336:24)
at step (/Users/raviagrawal/Work/NFT On Chain/all-on-chain-generated-nft/node_modules/@ethersproject/providers/lib/base-provider.js:48:23)
at Object.next (/Users/raviagrawal/Work/NFT On Chain/all-on-chain-generated-nft/node_modules/@ethersproject/providers/lib/base-provider.js:29:53)
at fulfilled (/Users/raviagrawal/Work/NFT On Chain/all-on-chain-generated-nft/node_modules/@ethersproject/providers/lib/base-provider.js:20:58)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at DeploymentsManager.executeDeployScripts (/Users/raviagrawal/Work/NFT On Chain/all-on-chain-generated-nft/node_modules/hardhat-deploy/src/DeploymentsManager.ts:1014:19)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at DeploymentsManager.runDeploy (/Users/raviagrawal/Work/NFT On Chain/all-on-chain-generated-nft/node_modules/hardhat-deploy/src/DeploymentsManager.ts:849:5)
at Environment._runTaskDefinition (/Users/raviagrawal/Work/NFT On Chain/all-on-chain-generated-nft/node_modules/hardhat/src/internal/core/runtime-environment.ts:217:14)
at Environment.run (/Users/raviagrawal/Work/NFT On Chain/all-on-chain-generated-nft/node_modules/hardhat/src/internal/core/runtime-environment.ts:129:14)
at SimpleTaskDefinition.action (/Users/raviagrawal/Work/NFT On Chain/all-on-chain-generated-nft/node_modules/hardhat-deploy/src/index.ts:446:32)
at Environment._runTaskDefinition (/Users/raviagrawal/Work/NFT On Chain/all-on-chain-generated-nft/node_modules/hardhat/src/internal/core/runtime-environment.ts:217:14)
at Environment.run (/Users/raviagrawal/Work/NFT On Chain/all-on-chain-generated-nft/node_modules/hardhat/src/internal/core/runtime-environment.ts:129:14)
at SimpleTaskDefinition.action (/Users/raviagrawal/Work/NFT On Chain/all-on-chain-generated-nft/node_modules/hardhat-deploy/src/index.ts:521:5)
at Environment._runTaskDefinition (/Users/raviagrawal/Work/NFT On Chain/all-on-chain-generated-nft/node_modules/hardhat/src/internal/core/runtime-environment.ts:217:14)
`

On checking the transaction details on Etherscan

The error I see is: Fail with error 'ERC721URIStorage: URI query for nonexistent token'
I havent made any changes to the JS or the SOL files, so I assume, it must be passing the generated tokenID.

I am unable to understand what might be wrong here. Can someone please help?

failed to get chainId, falling back on net_version...

Hello I keep getting this Error, can you explain as to what i am doing wrong? Thank you

''Nothing to compile
failed to get chainId, falling back on net_version...
An unexpected error occurred:

ProviderError: Must be authenticated!
at HttpProvider.request (/Users/blurrd/Documents/Dev/blockChain/all-on-chain-generated-nft/all-on-chain-generated-nft/node_modules/hardhat/src/internal/core/providers/http.ts:49:19)
at HDWalletProvider.request (/Users/blurrd/Documents/Dev/blockChain/all-on-chain-generated-nft/all-on-chain-generated-nft/node_modules/hardhat/src/internal/core/providers/accounts.ts:168:34)
at processTicksAndRejections (internal/process/task_queues.js:95:5)
at GanacheGasMultiplierProvider._isGanache (/Users/blurrd/Documents/Dev/blockChain/all-on-chain-generated-nft/all-on-chain-generated-nft/node_modules/hardhat/src/internal/core/providers/gas-providers.ts:315:30)
at GanacheGasMultiplierProvider.request (/Users/blurrd/Documents/Dev/blockChain/all-on-chain-generated-nft/all-on-chain-generated-nft/node_modules/hardhat/src/internal/core/providers/gas-providers.ts:304:23)
at DeploymentsManager.getChainId (/Users/blurrd/Documents/Dev/blockChain/all-on-chain-generated-nft/all-on-chain-generated-nft/node_modules/hardhat-deploy/src/DeploymentsManager.ts:381:23)
at DeploymentsManager.loadDeployments (/Users/blurrd/Documents/Dev/blockChain/all-on-chain-generated-nft/all-on-chain-generated-nft/node_modules/hardhat-deploy/src/DeploymentsManager.ts:554:17)
at DeploymentsManager.runDeploy (/Users/blurrd/Documents/Dev/blockChain/all-on-chain-generated-nft/all-on-chain-generated-nft/node_modules/hardhat-deploy/src/DeploymentsManager.ts:815:5)
at Environment._runTaskDefinition (/Users/blurrd/Documents/Dev/blockChain/all-on-chain-generated-nft/all-on-chain-generated-nft/node_modules/hardhat/src/internal/core/runtime-environment.ts:217:14)
at Environment.run (/Users/blurrd/Documents/Dev/blockChain/all-on-chain-generated-nft/all-on-chain-generated-nft/node_modules/hardhat/src/internal/core/runtime-environment.ts:129:14)!

error's when "finishing the mint"

PS C:\Users\Nancy\hello\hh\repo\all-on-chain-generated-nft> yarn hardhat deploy --network rinkeby

yarn run v1.22.15
$ C:\Users\Nancy\hello\hh\repo\all-on-chain-generated-nft\node_modules\.bin\hardhat deploy --network rinkeby
Nothing to compile
----------------------------------------------------
reusing "SVGNFT" at 0xAD4B9c2783dE05d441Fa0b024a9E1394aF4B2533
You have deployed an NFT contract to 0xAD4B9c2783dE05d441Fa0b024a9E1394aF4B2533
Verify with:
 npx hardhat verify --network rinkeby 0xAD4B9c2783dE05d441Fa0b024a9E1394aF4B2533
Let's create an NFT now!
We will use ./img/small_enough.svg as our SVG, and this will turn into a tokenURI.
You've made your first NFT!
You can view the tokenURI here data:application/json;base64,eyJuYW1lIjoiU1ZHIE5GVCIsICJkZXNjcmlwdGlvbiI6IkFuIE5GVCBiYXNlZCBvbiBTVkchIiwgImF0dHJpYnV0ZXMiOiIiLCAiaW1hZ2UiOiJkYXRhOmltYWdlL3N2Zyt4bWw7YmFzZTY0LFBITjJaeUI0Yld4dWN6MGlhSFIwY0RvdkwzZDNkeTUzTXk1dmNtY3ZNakF3TUM5emRtY2lJR2hsYVdkb2REMGlOVEF3SWlCM2FXUjBhRDBpTlRBd0lqNE5DaUFnUEdOcGNtTnNaU0JqZUQwaU1qVXdJaUJqZVQwaU1qVXdJaUJ5UFNJeU1EQWlJSE4wY205clpUMGlZbXhoWTJzaUlITjBjbTlyWlMxM2FXUjBhRDBpTXlJZ1ptbHNiRDBpWW14MVpTSWdMejRnRFFvOEwzTjJaejRnIn0=
----------------------------------------------------
reusing "RandomSVG" at 0x50d60Bd20D5fd1baAF55f7CAeA5716108A25f915
You have deployed an NFT contract to 0x50d60Bd20D5fd1baAF55f7CAeA5716108A25f915
Verify with:
 npx hardhat verify --network rinkeby 0x50d60Bd20D5fd1baAF55f7CAeA5716108A25f915 0xb3dCcb4Cf7a26f6cf6B120Cf5A73875B7BBc655B 0x01be23585060835e02b77ef475b0cc51aa1e0709 0x2ed0feb3e7fd2022120aa84fab1945545a9f2ffc9076fd6156fa96eaff4c1311 100000000000000000
Duplicate definition of Transfer (Transfer(address,address,uint256,bytes), Transfer(address,address,uint256))
Let's create an NFT now!
You've made your NFT! This is number 0x0000000000000000000000000000000000000000000000000000000000000001
Let's wait for the Chainlink VRF node to respond...
You can view the tokenURI here data:application/json;base64,eyJuYW1lIjoiU1ZHIE5GVCIsICJkZXNjcmlwdGlvbiI6IkFuIE5GVCBiYXNlZCBvbiBTVkchIiwgImF0dHJpYnV0ZXMiOiIiLCAiaW1hZ2UiOiJkYXRhOmltYWdlL3N2Zyt4bWw7YmFzZTY0LFBITjJaeUI0Yld4dWN6MG5hSFIwY0RvdkwzZDNkeTUzTXk1dmNtY3ZNakF3TUM5emRtY25JR2hsYVdkb2REMG5OVEF3SnlCM2FXUjBhRDBuTlRBd0p6NDhjR0YwYUNCa1BTZE5JRE00TWlBeE5EWk1JRE16TlNBNU4wMGdNekUwSURNNU5VMGdPVE1nTkRjMkp5Qm1hV3hzUFNkMGNtRnVjM0JoY21WdWRDY2djM1J5YjJ0bFBTZDVaV3hzYjNjbkx6NDhjR0YwYUNCa1BTZE5JREU1TVNBeE9UUk1JREl3TXlBMU5Fd2dOalVnTVRrelRTQXlOekFnTWpBeEp5Qm1hV3hzUFNkMGNtRnVjM0JoY21WdWRDY2djM1J5YjJ0bFBTZDVaV3hzYjNjbkx6NDhjR0YwYUNCa1BTZE1JREV3TkNBME56Sk5JRGt6SURNMU1rd2dOREUxSURJME9DY2dabWxzYkQwbmRISmhibk53WVhKbGJuUW5JSE4wY205clpUMG5ZbXhoWTJzbkx6NDhjR0YwYUNCa1BTZE5JRE16TkNBek16Wk1JRE0zTUNBeE1qSk5JRFF6TXlBME1qSk1JRFE1TlNBeU5UQk5JREV6TnlBeU9UTW5JR1pwYkd3OUozUnlZVzV6Y0dGeVpXNTBKeUJ6ZEhKdmEyVTlKMkpzZFdVbkx6NDhjR0YwYUNCa1BTZE1JRE0wTnlBeU1Ea25JR1pwYkd3OUozUnlZVzV6Y0dGeVpXNTBKeUJ6ZEhKdmEyVTlKM0psWkNjdlBqd3ZjM1puUGc9PSJ9
Now let's finsih the mint...
An unexpected error occurred:

Error: ERROR processing C:\Users\Nancy\hello\hh\repo\all-on-chain-generated-nft\deploy\02_Deploy_RandomSVG.js:
Error: transaction failed [ See: https://links.ethers.org/v5-errors-CALL_EXCEPTION ] (transactionHash="0x3781d6b254e21ac0d6a0ed4b2406f2e3f49d725ac23022907e79021f2306b7ce", transaction={"hash":"0x3781d6b254e21ac0d6a0ed4b2406f2e3f49d725ac23022907e79021f2306b7ce","type":2,"accessList":[],"blockHash":null,"blockNumber":null,"transactionIndex":null,"confirmations":0,"from":"0xFc73F357Fb770845063dD42104A6F167fF3aE433","gasPrice":{"type":"BigNumber","hex":"0x59682f0c"},"maxPriorityFeePerGas":{"type":"BigNumber","hex":"0x59682f00"},"maxFeePerGas":{"type":"BigNumber","hex":"0x59682f0c"},"gasLimit":{"type":"BigNumber","hex":"0x1e8480"},"to":"0x50d60Bd20D5fd1baAF55f7CAeA5716108A25f915","value":{"type":"BigNumber","hex":"0x00"},"nonce":275,"data":"0x624194c70000000000000000000000000000000000000000000000000000000000000001","r":"0xe06af8c83e3c7745b4c8c7729e53601b2918bac66668b69b9eed4879e2a94c25","s":"0x7dab70428714257bcbe3be4fb730ad9dade81baebc6e3bfab5171fd26ecabded","v":0,"creates":null,"chainId":4}, receipt={"to":"0x50d60Bd20D5fd1baAF55f7CAeA5716108A25f915","from":"0xFc73F357Fb770845063dD42104A6F167fF3aE433","contractAddress":null,"transactionIndex":24,"gasUsed":{"type":"BigNumber","hex":"0x01b234"},"logsBloom":"0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000","blockHash":"0x2700b4b5d87672f4bd4ed4f81433320a411b02cab414edf86a964d8c38f7bf7d","transactionHash":"0x3781d6b254e21ac0d6a0ed4b2406f2e3f49d725ac23022907e79021f2306b7ce","logs":[],"blockNumber":10314298,"confirmations":1,"cumulativeGasUsed":{"type":"BigNumber","hex":"0x3603e4"},"effectiveGasPrice":{"type":"BigNumber","hex":"0x59682f0a"},"status":0,"type":2,"byzantium":true}, code=CALL_EXCEPTION, version=providers/5.6.0)
    at Logger.makeError (C:\Users\Nancy\hello\hh\repo\all-on-chain-generated-nft\node_modules\@ethersproject\logger\src.ts\index.ts:261:28)
    at Logger.throwError (C:\Users\Nancy\hello\hh\repo\all-on-chain-generated-nft\node_modules\@ethersproject\logger\src.ts\index.ts:273:20)
    at EthersProviderWrapper.<anonymous> (C:\Users\Nancy\hello\hh\repo\all-on-chain-generated-nft\node_modules\@ethersproject\providers\src.ts\base-provider.ts:1523:24)
    at step (C:\Users\Nancy\hello\hh\repo\all-on-chain-generated-nft\node_modules\@ethersproject\providers\lib\base-provider.js:48:23)
    at Object.next (C:\Users\Nancy\hello\hh\repo\all-on-chain-generated-nft\node_modules\@ethersproject\providers\lib\base-provider.js:29:53)
    at fulfilled (C:\Users\Nancy\hello\hh\repo\all-on-chain-generated-nft\node_modules\@ethersproject\providers\lib\base-provider.js:20:58)
    at DeploymentsManager.executeDeployScripts (C:\Users\Nancy\hello\hh\repo\all-on-chain-generated-nft\node_modules\hardhat-deploy\src\DeploymentsManager.ts:1014:19)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

How to Mint After Deploying Contract?

Great repo! I followed along with your YouTube video and everything seems to work but I am not able to generate a token that I can look up on Opensea. I am not sure if I am missing a step or if the process is just taking some time to finish.

The issue is that when I run the scripts to generate a contract from an SVG, a contract is generated but a token is never minted. For example, when I go to Opensea and look for the contract (as you do early in the video at 12:15), nothing shows up for my test project when I perform the equivalent steps. However, the Etherscan seems to verify that the transaction went through. Link to my last contract's Etherscan: https://rinkeby.etherscan.io/address/0xdd73138E76A04f5392c776147F0725A1b7E5867D

I followed along with the quick start instructions and my only deviation was to use a different SVG file (simple cartoon of a cat) to see if something with a bit more complexity would work. I should note that I got the same results with the circle SVG example you provide. I thought that the call to _safeMint() in the creat function should perform this task but the token counter is at 0 when I look up the metadata online - not sure how to debug this or where to start.

I am still learning so please excuse me if I am not asking for the correct thing but I guess my question is this: On a testnet such as Rinkeby and after I successfully create the contract and verify it on Etherscan, how do I actually mint a token?

Some CLI outputs and screencaps to illustrate what has worked and what has not:

# output from CLI when running npx hardhat deploy --network rinkeby --taks svg
You have deployed an NFT contract to 0xdd73138E76A04f5392c776147F0725A1b7E5867D

etherscan

opensea

Transaction Error. Exception thrown in contract code.

Hi Patrick - first of all, amazing tutorial! Thanks for sharing it on YT.

Deployed and verified successfully on Rinkeby, then went to Etherscan to call directly create( ) and the tx failed with error "Exception thrown in contract code".

Tested also with your contract in Polygon and got the same error: https://polygonscan.com/tx/0x66bb8c33fa94f3d33505cb6ba3dc36027aac8eaec5308e9e2c764004db6d3af1

Does it make sense what I'm trying to do? I wanted to first call create( ) and then finishMint( ) directly from Etherscan.

Less of an issue and more of a question about where the raw seed is stored in RandomSVG.sol

Which variable in the contract stores the generated hex seed from the VRF Coordinator, similar to this example "0xa6bf20172530b7a6656624c41e4942a55d4080dedf63f0fc5dfee990f7883885". The reason for this is all I need to do is pass this seed to my JS, which I already made to interpret, parse, and generate traits from the seed. I tried to find the variable storing this raw unparsed seed, but seems like it starts parsed into an integer.

File import callback not supported

Hi, I am new to this and need some help. I am seeing these in my Problems panel:

Source "@openzeppelin/contracts/access/Ownable.sol" not found: File import callback not supported
Source "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol" not found: File import callback not supported
Source "base64-sol/base64.sol" not found: File import callback not supported

But I do see these files and folders in my C:/

What should I do? Please help!

Amount of tokens required to mint rsvg using polygon?

Hi Patrick, in the video, to run the command

npx hardhat deploy --network polygon --tags rsvg

you mentioned that it would cost you about $3 (I know that the price changes, so it is just a ballpark) but I have 0.05 ETH, 1.4 LINK, and 11 MATIC, but I am still getting insufficient funds. Is there any other token I need to be able to deploy on polygon?

I've modified 02_Deploy_RandomSVG.js: 62 to the one you had in the video,
tx = await randomSVG.finishMint(tokenId, { gasLimit: 2000000, gasPrice: 20000000000 })

[open question]: Are svg handled the same way than Aavegotchi ?

Helloย @PatrickAlphaC ,

Very nice repo !

โ€จI was wondering if your approach was the same than Aavegotchi (as far as I understand ... it is not) ?

Apparently:

It costs less gas to store SVG data as contract data than to store it in contract storage. Normally contract bytecode is stored as contract data, but it is possible to store other data as contract data, as we are doing with SVG data.

(https://docs.aavegotchi.com/overview/onchain-svgs)

Also, another question, do you think fees are sustainable to handle complex svg (let's say a picture like a knight in your D&D repo that can evolve with different items on it ... a hat, gloves, ...) or is it better to stick to an ipfs method with standard setTokenURI() ?

Thanks for your feedback ! :)

[EDIT 1]: I didn't realize but there is a youtube video for this repo :). I've just watched it and realised you've already answered to my second question with the example of the complex nft svg you've minted for 2 millions gas ๐Ÿ˜ฑ (https://youtu.be/nS9xP1hxg3w?t=2858). So clearly not the best option ... (right ? ๐Ÿ˜… )

[EDIT 2]: Ok so so the real youtube video for this repo is https://www.youtube.com/watch?v=9oERTH9Bkw0 ๐Ÿ˜…. There is a question in the coments about fees and your answer was:

They will be a little higher, but this is what youโ€™d need to do to create customization on your NFT smart contracts

So I assume it would be possible to deploy and mint a D&D Knight on Polygon without spending a huge amount in fees ... ?

Image changing NFTs

Hey Patrick!,

This might sound like a simple question. I would like to know if it's possible to make an NFT's image change on the blockchain. For example, we have an NFT featuring picture A. We would like to change the image to B whenever we want via a function in our solidity code. As I read from your description, and the sources I found online, it seems possible but I would like to hear from a professional.

Thank you for your time!
Best regards,
Barkin

How token is generated when we call finishMint()

Hey Patrick!
Thank you vm for all the information. I am a bit confused. When a person calls the finishMint() function the NFT is minted but I don't see the connection between finishMint() and _safeMint(). Could you please explain me how they actually interact with each other?
I am trying to write a code where the user would have to give a string input while minting the NFT. I am not sure where I should get that input
Thanks in advance

error code = UNPREDICTABLE_GAS_LIMIT

Hi.
I tried to deploy with svg /img/pug.svg and got an error.

Error: cannot estimate gas; transaction may fail or may require manual gas limit (error={"name":"ProviderError","code":-32000,"_isProviderError":true}, method="estimateGas", transaction={"from":"0xFB344eB59cEE6CC05add9e7C81a7e305a5400FB1","to":"0x984827822572764c4aF4335849Dbd856eC7C1D4F","data":"0x...","accessList":null}, code=UNPREDICTABLE_GAS_LIMIT, version=providers/5.5.0)

How to solve this?
I'm afraid we can't calculate the gas for the transaction ...

Cant Deploy Tags

I am very new to coding and all these steps

On this step:
npx hardhat deploy --tags svg
and Im receiving this error.

**Error HH8: There's one or more errors in your config file:

Not sure what to do here

Deployment of RandomSVG hangs for 30+ minutes

Started the tutorial for this, and during the initial deployment tests before coding - deployment of RandomSVG hangs for 30+ minutes and does not complete or timeout. Account has Eth and Test coin. Using Rinkeby network just like in the tut. SVGNFT deploys fine, no problems. RandomSVG just hangs - screenshot bellow.

Env vars are set (accept no MAINNET_RPC_URL, because I'm not deploying to main net yet)

using command: npx hardhat deploy --network rinkeby --tags rsvg

OSX 10.15.7
Macbook Pro Mid 2018

Screen Shot 2022-05-16 at 2 54 53 PM

Error in plugin @nomiclabs/hardhat-etherscan: Invalid API Key

Hardhat version: 2.6.8
Node version: 16.13.0

I'm doing the vid tutorial
https://youtu.be/9oERTH9Bkw0?t=519

and I get to about 8:40 before I encounter errors.

The errors start when I try to verify my smart contract on etherscan using hardhat.

I enter the command

npx hardhat verify --network rinkeby 0x3df62d91850c6C9FdfDc1161c3C73406b2253C67

and it prints out the error Error in plugin @nomiclabs/hardhat-etherscan: Invalid API Key

Okay, so I go to etherscan, make an account, get an api key token, and copy/paste it in my .env file as

ETHERSCAN_API_KEY=my_api_key

I save everything.

at this point in time, my .env file consists of
RINKEBY_RPC_URL
PRIVATE_KEY
ETHERSCAN_API_KEY

I know the .env file is working properly because my contract would not have properly deployed otherwise.

I try to verify again now having the ETHERSCAN_API_KEY in my .env file.
I get the same error again.
"Error in plugin @nomiclabs/hardhat-etherscan: Invalid API Key"

Weird. I go back, verify the key is the same key I got from etherscan. It is. I make sure there's not a weird space somewhere, there isn't. I double check the hardhat.config.js file to make sure it's spelled the same. It is. I cloned the repo, but didn't change anything other than adding the .env file.

I try again, same error.

I decide to try and deploy over the previous deploy, but it just reuses the previous contracts and addresses.
Again, "Error in plugin @nomiclabs/hardhat-etherscan: Invalid API Key".

Okay, maybe I just need to try and do a fresh deploy.
I do hardhat clean hoping that fixes something. Idk if that even does what I think it does.

I try to deploy again, but it just reuses the previous contracts and addresses again.
I try to verify again.
"Error in plugin @nomiclabs/hardhat-etherscan: Invalid API Key"

I try to get a new API Key token from etherscan, maybe there was just something wrong with the one they gave me just to rule that out.
I replace the old api key in my .env file with the new api key and save the file.
I go through all the motions again.
Error in plugin @nomiclabs/hardhat-etherscan: Invalid API Key

I try to deploy again, because maybe it needs to compile again after having saved.
"Error in plugin @nomiclabs/hardhat-etherscan: Invalid API Key"

I'm really pulling my hair out on this one. I know it's probably something super simple that's been overlooked, and I'm probably being a dumb dumb, but I am completely lost on this one. I've spent way longer than I care to admit trying to troubleshoot this.

Does Verify need extra arguments?

npx hardhat verify --network mumbai 0x7B4d4B5189446e5A5dC03f40F35Dd1A3B96AF740 --show-stack-traces

Error in plugin @nomiclabs/hardhat-etherscan: The constructor for contracts/RandomSVG.sol:RandomSVG has 4 parameters
but 0 arguments were provided instead.

Duplicate definition of Transfer (Transfer(address,address,uint256,bytes), Transfer(address,address,uint256))

Dear Patrick:

  I am your fan first of all!

 I git-download your code, then "yarn install", compile, deploy. It went smooth except NFT deploy token address is 0xX. I have sufficient token in rinkeby wallet. 

1)Here is the output:
npx hardhat verify --network rinkeby 0xF049E1Bc7C96947F015ed3F0B0cce55eD1E0d922 0xb3dCcb4Cf7a26f6cf6B120Cf5A73875B7BBc655B 0x01be23585060835e02b77ef475b0cc51aa1e0709 0x2ed0feb3e7fd2022120aa84fab1945545a9f2ffc9076fd6156fa96eaff4c1311 100000000000000000
Duplicate definition of Transfer (Transfer(address,address,uint256,bytes), Transfer(address,address,uint256))
Let's create an NFT now!
You've made your NFT! This is number 0x0000000000000000000000000000000000000000000000000000000000000000
Let's wait for the Chainlink VRF node to respond...

  1. Here is the event log
    image

  2. The only change is during compile time, I have to add solidity version "0.6.6" and "0.8.1" otherwise keep failing.

image

 I doubt version confliction somewhere.  Please advise.

Thanks

how would you add tokenURI attributes to your code here?

For example add attribute -> eye : "green"

`function formatTokenURI(string memory imageURI) public pure returns (string memory) {
        return string(
                abi.encodePacked(
                    "data:application/json;base64,",
                    Base64.encode(
                        bytes(
                            abi.encodePacked(
                                '{"name":"',
                                "SVG NFT", // You can add whatever name here
                                '", "description":"An NFT based on SVG!", "attributes":"", "image":"',imageURI,'"}'
                            )
                        )
                    )
                )
            );
    }`

ProviderError: invalid opcode: INVALID

So I'm at the part where the contract has been issued and upload and a verification link is given and it's just about to mint the NFT and I get this error with no clear error message:

An unexpected error occurred:

Error: ERROR processing /Users/rainless/Downloads/all-on-chain-generated-nft/deploy/02_Deploy_RandomSVG.js:
ProviderError: invalid opcode: INVALID
    at HttpProvider.request (/Users/rainless/Downloads/all-on-chain-generated-nft/node_modules/hardhat/src/internal/core/providers/http.ts:74:19)

This is what's on that line in http.ts:

const error = new ProviderError("HttpProviderError", -1);

...but I'm not sure how that helps us. And I have no idea how to get around this error message.

The updated config file wouldn't compile unless I changed the compiler to 8.1 and commented out the private keys.

/**
 * @type import('hardhat/config').HardhatUserConfig
 */
require("@nomiclabs/hardhat-waffle")
require("@nomiclabs/hardhat-ethers")
require("@nomiclabs/hardhat-truffle5")
require("@nomiclabs/hardhat-etherscan")
require("hardhat-deploy")


require('dotenv').config()

const MAINNET_RPC_URL = process.env.MAINNET_RPC_URL || process.env.ALCHEMY_MAINNET_RPC_URL || "https://eth-mainnet.alchemyapi.io/v2/..........your key"
const RINKEBY_RPC_URL = process.env.RINKEBY_RPC_URL || "https://rinkeby.infura.io/v3/.....................your key"
const KOVAN_RPC_URL = process.env.KOVAN_RPC_URL || "https://kovan.infura.io/v3/......your key"
const MNEMONIC = process.env.MNEMONIC || "your mnemonic"
const ETHERSCAN_API_KEY = process.env.ETHERSCAN_API_KEY || "your api key"
// optional
const PRIVATE_KEY = process.env.PRIVATE_KEY || "your private key"

module.exports = {
    defaultNetwork: "hardhat",
    networks: {
        hardhat: {

            // // If you want to do some forking, uncomment this
            // forking: {
            //   url: MAINNET_RPC_URL
            // }
        },
        localhost: {
        },
        kovan: {
            url: KOVAN_RPC_URL,
            // accounts: [PRIVATE_KEY],
            accounts: {
                mnemonic: MNEMONIC,
            },
            saveDeployments: true,
        },
        rinkeby: {
            url: RINKEBY_RPC_URL,
            //  accounts: [PRIVATE_KEY],
            // accounts: {
            //  mnemonic: MNEMONIC,
            // },
            saveDeployments: true,
        },
        ganache: {
            url: 'http://localhost:8545',
            accounts: {
                mnemonic: MNEMONIC,
            }
        },
        mainnet: {
            url: MAINNET_RPC_URL,
            // accounts: [PRIVATE_KEY],
            accounts: {
                mnemonic: MNEMONIC,
            },
            saveDeployments: true,
        },
        polygon: {
            url: "https://rpc-mainnet.maticvigil.com/",
            // accounts: [PRIVATE_KEY],
            accounts: {
                mnemonic: MNEMONIC,
            },
            saveDeployments: true,
        },
    },
    etherscan: {
        // Your API key for Etherscan
        // Obtain one at https://etherscan.io/
        apiKey: ETHERSCAN_API_KEY
    },
    namedAccounts: {
        deployer: {
            default: 0, // here this will by default take the first account as deployer
            1: 0 // similarly on mainnet it will take the first account as deployer. Note though that depending on how hardhat network are configured, the account 0 on one network can be different than on another
        },
        feeCollector: {
            default: 1
        }

    },
    solidity: {
        compilers: [
            {
                version: "0.8.1"
            },
            {
                version: "0.7.0"
            },
            {
                version: "0.6.6"
            },
            {
                version: "0.4.24"
            }
        ]
    },
    mocha: {
        timeout: 100000
    }
}

Pending tx on Mumbai tesnet

when deploying on Mumbai testnet (npx hardhat deploy --network mumbai --tags svg), the transaction stays spending.

waiting for tx 0x0de60df180d69ad61ea28725163b407efe3056ff956bcd95025e93329e725914 for SVGNFT Deployment

I have 1 MATIC / 10 LINK in my Mumbai wallet.
I've added in the hardhat.config.js:

mumbai: {
            url: MUMBAI_RPC_URL,
            accounts: [PRIVATE_KEY],
            saveDeployments: true,
        },

And in the helper-hardhat-config.js

80001: {
      name: 'mumbai',
      linkToken: '0x326C977E6efc84E512bB9C30f76E30c160eD06FB',
      ethUsdPriceFeed: '0x0715A7794a1dc8e42615F059dD6e406A6594651A',
      keyHash: '0x6e75b569a01ef56d18cab6a8e71e6600d6ce853834d4a5748b720d06f878b3a4',
      vrfCoordinator: '0x8C7382F9D8f56b33781fE506E897a4F1e2d17255',
      oracle: '0x58bbdbfb6fca3129b91f0dbe372098123b38b5e9',
      jobId: 'da20aae0e4c843f6949e5cb3f7cfe8c4',
      fee: '100000000000000',
      fundAmount: "100000000000000"
    },

TypeError: Cannot read property 'length' of undefined

Hi patrick,

I am following your tutorial and it is very instrictive. However, I face some troubles when I try to deploy the code to rinkeby (when I try to deploy it on a local network I do not have this issue) , I got the error "Cannot read property 'length' of undefined" and I am not able to find from where it comes from.

Here is the error :
image

Here is my hardhat.config.js file


require("@nomiclabs/hardhat-waffle")
 require("@nomiclabs/hardhat-ethers")
 require("@nomiclabs/hardhat-truffle5")
 require("@nomiclabs/hardhat-etherscan")
 require("hardhat-deploy")
 require('dotenv').config()
 //const MAINNET_RPC_URL = process.env.MAINNET_RPC_URL  
 const RINKEBY_RPC_URL = process.env.RINKEBY_RPC_URL 
 //const KOVAN_RPC_URL = process.env.KOVAN_RPC_URL 
 //const MNEMONIC = process.env.MNEMONIC 
 const ETHERSCAN_API_KEY = process.env.ETHERSCAN_API_KEY
 // optional
 const PRIVATE_KEY = process.env.PRIVATE_KEY 
 module.exports = {
     defaultNetwork: "hardhat",
     networks: {
         hardhat: {
             // // If you want to do some forking, uncomment this
             // forking: {
             //   url: MAINNET_RPC_URL
             // }
         },
         localhost: {
         }, 
         rinkeby: {
             url: RINKEBY_RPC_URL,
             accounts: [PRIVATE_KEY],
             //accounts: {
             //    mnemonic: MNEMONIC,
             //},
             saveDeployments: true,
         },
     },
     etherscan: {
         // Your API key for Etherscan
         // Obtain one at https://etherscan.io/
         apiKey: ETHERSCAN_API_KEY
     },
     namedAccounts: {
         deployer: {
             default: 2, // here this will by default take the first account as deployer
             1: 0 // similarly on mainnet it will take the first account as deployer. Note though that depending on how hardhat network are configured, the account 0 on one network can be different than on another
         },
         feeCollector: {
             default: 1
         }
     },
     solidity: {
         compilers: [
             {
                 version: "0.8.0"
             }
         ]
     },
     mocha: {
         timeout: 100000
     }
 }

Here is my 01_deploy_svgnft.js file:


let { networkConfig } = require('/mnt/c/Users/.../all-on-chain-generated-nft/all-on-chain-test/helper-hardhat-config')
const fs = require('fs')

module.exports = async ({
    getNamedAccounts,
    deployments,
    getChainId
}) => {
    
    const { deploy, log } = deployments
    const { deployer } = await getNamedAccounts()
    const chainId = await getChainId()

    log("----------------------------------------------------")
    const SVGNFT = await deploy('SVGNFT', {
        from: deployer,
        log: true
    })
    log(`You have deployed an NFT contract to ${SVGNFT.address}`)
    const svgNFTContract = await ethers.getContractFactory("SVGNFT")
    const accounts = await hre.ethers.getSigners()
    const signer = accounts[0]
    const svgNFT = new ethers.Contract(SVGNFT.address, svgNFTContract.interface, signer)
    const networkName = networkConfig[chainId]['name']

    log(`Verify with:\n npx hardhat verify --network ${networkName} ${svgNFT.address}`)
    log("Let's create an NFT now!")
    let filepath = "/mnt/c/Users/.../all-on-chain-generated-nft/all-on-chain-test/img/triangle.svg"
    let svg = fs.readFileSync(filepath, { encoding: "utf8" })
    log(`We will use ${filepath} as our SVG, and this will turn into a tokenURI. `)
    tx = await svgNFT.create(svg)
    await tx.wait(1)
    log(`You've made your first NFT!`)
    log(`You can view the tokenURI here ${await svgNFT.tokenURI(0)}`)
}

module.exports.tags = ['all', 'svg']

tell me if you need any more file!

Error: cannot estimate gas; transaction may fail or may require manual gas limit

a- project that i target and setting:

1- i use the (SVGNFT.sol and 01_Deploy_SVGNFT.js) version, from YouTube video (as i do not need the random).
2- i use the (hardhat.config.js) for same version from YouTube video, at the end i add the hardhat.config.js and helper-hardhat-config.js code (same version of YouTube).

b- the main problem:

the code is work and every thing is good as the svg file size less than 27Kb. but when the svg file more than 27kb it deploy the contract but can not deploy (upload, deal, mint) the svg file (tokenuri) and return next error message:

An unexpected error occurred:

Error: ERROR processing /home/naive/demos/secondtry/deploy/01_Deploy_SVGNFT.js:
Error: cannot estimate gas; transaction may fail or may require manual gas limit (error={"name":"ProviderError","code":-
32000,"_isProviderError":true}, method="estimateGas", transaction={"from":"metamask wallet address","to":"contract address",

c- what i try until now and the results:

1- try set the gas limit in "hardhat.config" but did not make any effect.
2- in "01_Deploy_SVGNFT" add gaslimit to tx, so the code line look like next:

 2-0 origonal code line before edit it:  tx = await svgNFT.create(svg)
 2-1 code line after edit it:  tx = await svgNFT.create(svg, {gasLimit: 3000000 })
 2-2 the result: give me some error message about wrong syntic (form, typing)

3- in "01_Deploy_SVGNFT" add gaslimit to tx, so the code line look like next:

    3-0 origonal code line before edit it:  tx = await svgNFT.create(svg)
    3-1 code line after edit it:  tx = await svgNFT.create({svg}, {gasLimit: 3000000 })

   3-2 the results:
          3-2-0 contract deploying, svg uploading, contract verifying, the matic value decrease in metamask wallet(gas value transfer succeed) all thing look good.
          3-2-1 when go to opensea there's no image appears.
          3-2-2 when go to polygonscan or etherscan and use token id to see the token uri it return nothing (ther's no metadata string appears, nothing appears).

so hope help me find how set the gas limit manually for the first smart contract(SVGNFT.sol) without face this problem when use polygon test or main network.

thanks in advanced

require("@nomiclabs/hardhat-ethers")
require("@nomiclabs/hardhat-etherscan")
require("hardhat-deploy")
require('dotenv').config()


const Mumbai_RPC_URL = process.env.Mumbai_RPC_URL
const Polygon_RPC_URL = process.env.Polygon_RPC_URL
const MNEMONIC = process.env.MNEMONIC
const POLYGONSCAN_API_KEY = process.env.POLYGONSCAN_API_KEY 

// optional
const PRIVATE_KEY = process.env.PRIVATE_KEY

module.exports = {
    defaultNetwork: "matic",
    networks: {

        matic: {
            url: Mumbai_RPC_URL,
               accounts: [PRIVATE_KEY],
           /** accounts: {
                mnemonic: MNEMONIC,
            },**/
            saveDeployments: true,
        },
        polygon: {
            url: Polygon_RPC_URL,
            // accounts: [PRIVATE_KEY],
            accounts: {
                mnemonic: MNEMONIC,
            },
            saveDeployments: true,
        },
        
        
    },
    etherscan: {
        // Your API key for Etherscan
        // Obtain one at https://etherscan.io/
        apiKey: POLYGONSCAN_API_KEY
    },
    namedAccounts: {
        deployer: {
            default: 0, // here this will by default take the first account as deployer
            1: 0 // similarly on mainnet it will take the first account as deployer. Note though that depending on how hardhat network are configured, the account 0 on one network can be different than on another
        },
        feeCollector: {
            default: 1
        }
    },
    solidity: {
        compilers: [
            {
                version: "0.8.0"
            },
            {
                version: "0.7.0"
            },
            {
                version: "0.6.6"
            },
            {
                version: "0.4.24"
            }
        ]
    },
    mocha: {
        timeout: 100000
    }
}

const networkConfig = {
     80001: {
          name: 'matic',
     },
     137: {
        name: 'polygon',
     },
}
module.exports = {
networkConfig,
}

what am i missing ... have a .env file ... deleted username ... but yea need help ...

An unexpected error occurred:

Error: Cannot find module 'dotenv'
Require stack:

  • /Users//demo/all-on-chain-nft/hardhat.config.js
  • /Users//demo/all-on-chain-nft/node_modules/hardhat/internal/core/config/config-loading.js
  • /Users//demo/all-on-chain-nft/node_modules/hardhat/internal/cli/cli.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:815:15)
    at Function.Module._load (internal/modules/cjs/loader.js:667:27)
    at Module.require (internal/modules/cjs/loader.js:887:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at Object. (/Users//demo/all-on-chain-nft/hardhat.config.js:10:1)
    at Module._compile (internal/modules/cjs/loader.js:999:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
    at Module.load (internal/modules/cjs/loader.js:863:32)
    at Function.Module._load (internal/modules/cjs/loader.js:708:14)
    at Module.require (internal/modules/cjs/loader.js:887:19) {
    code: 'MODULE_NOT_FOUND',
    requireStack: [
    '/Users//demo/all-on-chain-nft/hardhat.config.js',
    '/Users//demo/all-on-chain-nft/node_modules/hardhat/internal/core/config/config-loading.js',
    '/Users//demo/all-on-chain-nft/node_modules/hardhat/internal/cli/cli.js'
    ]
    }

Transactions working on SVGNFT but fails on RandomSVG

This is similar to this issue
I am also getting the same error however it happens when waiting for the randomSVG.create() function to complete. I have a tx.wait(1) as suggested yet still receiving the same error. Deploying SVG works successfully on rinkeby. The rinkeby etherscan does not reveal much either. I am able to deploy the contract locally. Currently up to here in the youtube video


Error: ERROR processing C:\Users\harri\Desktop\SideProj\Prophecy\Prophecy-Smart-Contract\deploy\02_deploy_randomSVG.js:
Error: transaction failed (transactionHash="0xe40a797055ade03893ed76fcbd1f51e7cbff44b457be2c442014af0d5eda6cac", transaction={"hash":"0xe40a797055ade03893ed76fcbd1f51e7cbff44b457be2c442014af0d5eda6cac","type":2,"accessList":[],"blockHash":null,"blockNumber":null,"transactionIndex":null,"confirmations":0,"from":"0x67cF969cD864E915E45d84eD416053148B61C6AE","gasPrice":{"type":"BigNumber","hex":"0x3b9aca1d"},"maxPriorityFeePerGas":{"type":"BigNumber","hex":"0x3b9aca11"},"maxFeePerGas":{"type":"BigNumber","hex":"0x3b9aca1d"},"gasLimit":{"type":"BigNumber","hex":"0x98967f"},"to":"0xb7402F1527bBF603018A21ee46194D3Ebc940890","value":{"type":"BigNumber","hex":"0x00"},"nonce":47,"data":"0xefc81a8c","r":"0x7e02bdbe9ec497f542c096752b123460288ab2bc6fece599d470f77e7809b2dd","s":"0x676a56f0d924fa15e5bed21b3c8df262faac36224643e3b3af2e4d9e64f3300f","v":1,"creates":null,"chainId":4}, receipt={"to":"0xb7402F1527bBF603018A21ee46194D3Ebc940890","from":"0x67cF969cD864E915E45d84eD416053148B61C6AE","contractAddress":null,"transactionIndex":23,"gasUsed":{"type":"BigNumber","hex":"0xcb9c"},"logsBloom":"0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000","blockHash":"0x71e2fa49c8281e0bf27c4d47f525718dfc0f72356cbd94a2e16436d28e88e7e2","transactionHash":"0xe40a797055ade03893ed76fcbd1f51e7cbff44b457be2c442014af0d5eda6cac","logs":[],"blockNumber":10302431,"confirmations":1,"cumulativeGasUsed":{"type":"BigNumber","hex":"0x3fe15d"},"effectiveGasPrice":{"type":"BigNumber","hex":"0x3b9aca1b"},"status":0,"type":2,"byzantium":true}, code=CALL_EXCEPTION, version=providers/5.5.3)
    at Logger.makeError (C:\Users\harri\Desktop\SideProj\Prophecy\Prophecy-Smart-Contract\node_modules\@ethersproject\logger\src.ts\index.ts:225:28)        
    at Logger.throwError (C:\Users\harri\Desktop\SideProj\Prophecy\Prophecy-Smart-Contract\node_modules\@ethersproject\logger\src.ts\index.ts:237:20)       
    at EthersProviderWrapper.<anonymous> (C:\Users\harri\Desktop\SideProj\Prophecy\Prophecy-Smart-Contract\node_modules\@ethersproject\providers\src.ts\base-provider.ts:1352:24)
    at step (C:\Users\harri\Desktop\SideProj\Prophecy\Prophecy-Smart-Contract\node_modules\@ethersproject\providers\lib\base-provider.js:48:23)
    at Object.next (C:\Users\harri\Desktop\SideProj\Prophecy\Prophecy-Smart-Contract\node_modules\@ethersproject\providers\lib\base-provider.js:29:53)      
    at fulfilled (C:\Users\harri\Desktop\SideProj\Prophecy\Prophecy-Smart-Contract\node_modules\@ethersproject\providers\lib\base-provider.js:20:58)        
    at DeploymentsManager.executeDeployScripts (C:\Users\harri\Desktop\SideProj\Prophecy\Prophecy-Smart-Contract\node_modules\hardhat-deploy\src\DeploymentsManager.ts:1223:19)
    at DeploymentsManager.runDeploy (C:\Users\harri\Desktop\SideProj\Prophecy\Prophecy-Smart-Contract\node_modules\hardhat-deploy\src\DeploymentsManager.ts:1053:5)
    at SimpleTaskDefinition.action (C:\Users\harri\Desktop\SideProj\Prophecy\Prophecy-Smart-Contract\node_modules\hardhat-deploy\src\index.ts:422:5)        
    at Environment._runTaskDefinition (C:\Users\harri\Desktop\SideProj\Prophecy\Prophecy-Smart-Contract\node_modules\hardhat\src\internal\core\runtime-environment.ts:217:14)
    at Environment.run (C:\Users\harri\Desktop\SideProj\Prophecy\Prophecy-Smart-Contract\node_modules\hardhat\src\internal\core\runtime-environment.ts:129:14)
    at SimpleTaskDefinition.action (C:\Users\harri\Desktop\SideProj\Prophecy\Prophecy-Smart-Contract\node_modules\hardhat-deploy\src\index.ts:568:32)       
    at Environment._runTaskDefinition (C:\Users\harri\Desktop\SideProj\Prophecy\Prophecy-Smart-Contract\node_modules\hardhat\src\internal\core\runtime-environment.ts:217:14)
    at Environment.run (C:\Users\harri\Desktop\SideProj\Prophecy\Prophecy-Smart-Contract\node_modules\hardhat\src\internal\core\runtime-environment.ts:129:14)
    at SimpleTaskDefinition.action (C:\Users\harri\Desktop\SideProj\Prophecy\Prophecy-Smart-Contract\node_modules\hardhat-deploy\src\index.ts:653:5)        
    at Environment._runTaskDefinition (C:\Users\harri\Desktop\SideProj\Prophecy\Prophecy-Smart-Contract\node_modules\hardhat\src\internal\core\runtime-environment.ts:217:14)

harri@DESKTOP-01G6233 MINGW64 ~/Desktop/SideProj/Prophecy/Prophecy-Smart-Contract
$ npx hardhat deploy --network rinkeby --tags rsvg
Compiled 1 Solidity file successfully
---------------------------------
deploying "RandomSVG" (tx: 0x0513be012626dc4f663e76dbce4e054b5e9e611c2ddbcc77ab6ef7478c8734a5)...: deployed at 0xaC130C6ECa213451b0eeEbAe74Dfc6BbAC840382 with 4547588 gas
You have deployed your NFT contract!
Verify with:
 npx hardhat verify --network rinkeby 0xaC130C6ECa213451b0eeEbAe74Dfc6BbAC840382 0x6168499c0cFfCaCD319c818142124B7A15E857ab 0x01BE23585060835E02B77ef475b0Cc51aA1e0709 0xd89b2bf150e3b9e13446986e571fb9cab24b13cea0a43ea20a6049a85cc807cc 250000000000000000
linkTokenContract
accounts
Duplicate definition of Transfer (Transfer(address,address,uint256,bytes), Transfer(address,address,uint256))
fund_tx
creation_tx
An unexpected error occurred:

Error: ERROR processing C:\Users\harri\Desktop\SideProj\Prophecy\Prophecy-Smart-Contract\deploy\02_deploy_randomSVG.js:
Error: transaction failed (transactionHash="0x020c88c9742991bb8c93d018daa153ce6916916d8fd726c9adce30240da0f2e2", transaction={"hash":"0x020c88c9742991bb8c93d018daa153ce6916916d8fd726c9adce30240da0f2e2","type":2,"accessList":[],"blockHash":null,"blockNumber":null,"transactionIndex":null,"confirmations":0,"from":"0x67cF969cD864E915E45d84eD416053148B61C6AE","gasPrice":{"type":"BigNumber","hex":"0x59682f0b"},"maxPriorityFeePerGas":{"type":"BigNumber","hex":"0x59682f00"},"maxFeePerGas":{"type":"BigNumber","hex":"0x59682f0b"},"gasLimit":{"type":"BigNumber","hex":"0x98967f"},"to":"0xaC130C6ECa213451b0eeEbAe74Dfc6BbAC840382","value":{"type":"BigNumber","hex":"0x00"},"nonce":50,"data":"0xefc81a8c","r":"0x02bad9fdecc258b0d4435792528e50eff08489ae6171a989f71b6bab4c613923","s":"0x6ed9b5942dff55b78b7fcb0c0fae10d475518b9b839af858fa9fcd9badef298b","v":1,"creates":null,"chainId":4}, receipt={"to":"0xaC130C6ECa213451b0eeEbAe74Dfc6BbAC840382","from":"0x67cF969cD864E915E45d84eD416053148B61C6AE","contractAddress":null,"transactionIndex":40,"gasUsed":{"type":"BigNumber","hex":"0xd8e6"},"logsBloom":"0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000","blockHash":"0x5ea44c88f90f0bf79f91570c57648b694ec9af1f0183055b4dc5c7bc6a277cb7","transactionHash":"0x020c88c9742991bb8c93d018daa153ce6916916d8fd726c9adce30240da0f2e2","logs":[],"blockNumber":10302445,"confirmations":1,"cumulativeGasUsed":{"type":"BigNumber","hex":"0x218ee3"},"effectiveGasPrice":{"type":"BigNumber","hex":"0x59682f09"},"status":0,"type":2,"byzantium":true}, code=CALL_EXCEPTION, version=providers/5.5.3)
    at Logger.makeError (C:\Users\harri\Desktop\SideProj\Prophecy\Prophecy-Smart-Contract\node_modules\@ethersproject\logger\src.ts\index.ts:225:28)        
    at Logger.throwError (C:\Users\harri\Desktop\SideProj\Prophecy\Prophecy-Smart-Contract\node_modules\@ethersproject\logger\src.ts\index.ts:237:20)       
    at EthersProviderWrapper.<anonymous> (C:\Users\harri\Desktop\SideProj\Prophecy\Prophecy-Smart-Contract\node_modules\@ethersproject\providers\src.ts\base-provider.ts:1352:24)
    at step (C:\Users\harri\Desktop\SideProj\Prophecy\Prophecy-Smart-Contract\node_modules\@ethersproject\providers\lib\base-provider.js:48:23)
    at Object.next (C:\Users\harri\Desktop\SideProj\Prophecy\Prophecy-Smart-Contract\node_modules\@ethersproject\providers\lib\base-provider.js:29:53)      
    at fulfilled (C:\Users\harri\Desktop\SideProj\Prophecy\Prophecy-Smart-Contract\node_modules\@ethersproject\providers\lib\base-provider.js:20:58)        
    at runNextTicks (node:internal/process/task_queues:61:5)
    at processTimers (node:internal/timers:497:9)
    at DeploymentsManager.executeDeployScripts (C:\Users\harri\Desktop\SideProj\Prophecy\Prophecy-Smart-Contract\node_modules\hardhat-deploy\src\DeploymentsManager.ts:1223:19)
    at runNextTicks (node:internal/process/task_queues:61:5)
    at processTimers (node:internal/timers:497:9)
    at DeploymentsManager.runDeploy (C:\Users\harri\Desktop\SideProj\Prophecy\Prophecy-Smart-Contract\node_modules\hardhat-deploy\src\DeploymentsManager.ts:1053:5)
    at SimpleTaskDefinition.action (C:\Users\harri\Desktop\SideProj\Prophecy\Prophecy-Smart-Contract\node_modules\hardhat-deploy\src\index.ts:422:5)        
    at Environment._runTaskDefinition (C:\Users\harri\Desktop\SideProj\Prophecy\Prophecy-Smart-Contract\node_modules\hardhat\src\internal\core\runtime-environment.ts:217:14)
    at Environment.run (C:\Users\harri\Desktop\SideProj\Prophecy\Prophecy-Smart-Contract\node_modules\hardhat\src\internal\core\runtime-environment.ts:129:14)
    at SimpleTaskDefinition.action (C:\Users\harri\Desktop\SideProj\Prophecy\Prophecy-Smart-Contract\node_modules\hardhat-deploy\src\index.ts:568:32)       
    at Environment._runTaskDefinition (C:\Users\harri\Desktop\SideProj\Prophecy\Prophecy-Smart-Contract\node_modules\hardhat\src\internal\core\runtime-environment.ts:217:14)
    at Environment.run (C:\Users\harri\Desktop\SideProj\Prophecy\Prophecy-Smart-Contract\node_modules\hardhat\src\internal\core\runtime-environment.ts:129:14)

How much Rinkeby ETH is required to deploy to the test net?

Hi Patrick, thank you very much for the tutorial video and this codebase. The video was very informative.

I tried to deploy to the Rinkeby testnet, and I got 7.5 ETH from faucet but I keep getting insufficient funds. I can only get 7.5 ETH per day, how much ETH do I generally need to deploy to Rinkeby?

Nonce has already been used error

I have successfully deployed the SVG onto rinkeby previously and when I try to the same command I am receiving the following error.

transaction {transaction_number} still pending... It used a gas pricing config of (gasPrice: 1500000015 wei) ,              current gas price is 1000000026 wei
              new baseFee is 9

I am prompted to increase gas but when I do I get the following error

nonce has already been used (error={"name":"ProviderError","code":-32000,"_isProviderError":true}, method="sendTransaction", transaction=undefined, code=NONCE_EXPIRED, version=providers/5.5.3) {"reason":"nonce has already been used","code":"NONCE_EXPIRED","error":{"name":"ProviderError","code":-32000,"_isProviderError":true},"method":"sendTransaction"} Error: nonce has already been used (error={"name":"ProviderError","code":-32000,"_isProviderError":true}, method="sendTransaction", transaction=undefined, code=NONCE_EXPIRED, version=providers/5.5.3)

Is it something to do with Alchemy?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.