From 91861d6354f0eb31ee7316428aee43c55111f503 Mon Sep 17 00:00:00 2001 From: Charlie Date: Sat, 6 Apr 2024 15:19:59 +0800 Subject: [PATCH] docs(readme.md): Update etherscan API URL and add diamond contract usage --- README.md | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index a2cc1280..04d68220 100644 --- a/README.md +++ b/README.md @@ -415,13 +415,16 @@ Alternatively, you can change the mainnet etherscan api key env var name to some ... verify: { etherscan: { - apiUrl: 'http://mynetwork.xyz' + apiUrl: 'https://api-testnet.ftmscan.com', + apiKey: process.env.ETHERSCAN_API_KEY_FANTOM } } } } } ``` +NOTE: some projects use `apiUrl` like `https://api-testnet.ftmscan.com/api`, but we should remove `/api` path here, just fill in `https://api-testnet.ftmscan.com` + `--license `: SPDX license (useful if SPDX is not listed in the sources), need to be supported by etherscan: https://etherscan.io/contract-license-types @@ -1312,6 +1315,24 @@ diamond.deploy('ADiamondContract', { }); ``` +### use diamond contract for your scripts + +set external typechain in `hardhat.config.ts`, this make sure typechain knows this abi and generate typechain files for the diamond contract +```ts +const config: HardhatUserConfig = { + typechain: { + externalArtifacts: ['deployments/localhost/ADiamondContract.json'] + }, + ... +``` + +in your scripts + +```ts +const ADiamondContract = await ethers.getContract('ADiamondContract') +// do your stuff +``` + ### more... There are more options, to be described later...