sanamummer / Uniswap-v4

GNU General Public License v3.0
0 stars 2 forks source link

Query on customchains #1

Open grantbelford opened 6 months ago

grantbelford commented 6 months ago

Hello! When trying to run either command below %npx hardhat run scripts/deploy.js %npx hardhat run scripts/Swap-tokens.js

Returns msg "NomicLabsHardhatPluginError: Trying to verify a contract in network with chain id 80002, but plugin doesn't recognize it as a supported chain. You can manually add support for it (with instruction link).

May I clarify which file should be edited (hardhat.config.js?) and do the 3 required pieces of info (Network Chain ID, Verification Endpoint URL, Explorer URL) come from the earlier created testnet.json file? The testnet.json file contains testnetid, chainid (which is different than above chain id?), rpcUrl, faucetUrl, explorerUrl & verificationUrL). Looks like testnet.json "explorerUrL" = browserUrL & testnet.json "rpcUrL" = apiURL/Verification Endpoint URL. Not sure though which chainID to use, the one in the testnet.json file or the one in the above msg (80002).

Thanks!

sanamummer commented 6 months ago

@grantbelford When you create a testnet by running npm run createTestnet you will be asked about which network you are going to fork, Let us say it its Ethereum Mainnet, then the details regarding the network will be stored in the testnet.json file and hardhat config file fetches data from there.

grantbelford commented 6 months ago

Thank you Sana.

Yes for my exercise I did indeed choose Ethereum Mainnet & confirm that the testnet/testnet.json file was created successfully. But later on when I try to run either of 2 commands above I get a NomicLabsHardhatPluginError.

sanamummer commented 6 months ago

Kindly try it now, it should work. I have updated the hardhat config file. Thank you for pointing this out.

grantbelford commented 6 months ago

Thank you Sana.

btw I think the hardhat.config.js solidity compiler version stmt needs to be updated? In the js file I see solidity:compilers version 0.8.16 & think this is leading to a conflict with some of the SOL files (snippet below)

Error HH606: The project cannot be compiled, see reasons below. The Solidity version pragma statement in these files doesn't match any of the configured compilers in your config. Change the pragma or configure additional compiler versions in your hardhat config.

grantbelford commented 6 months ago

Yeah I updated hardhat.config.js file to solidity compiler version 0.8.21 & working like charm! Successfully ran %npx hardhat run scripts/Swap-tokens.js: "Successfully verified contract PoolSwapTest on Etherscan." Thank you Sana.