Replies: 1 comment
-
Hi @dizzy222,
That said, this specific error can be fixed by simply changing your hardhat configuration like this: // ...
etherscan: {
apiKey: {
// Ethereum
rinkeby: process.env.BLOCK_EXPLORER_API_KEY ?? '',
mainnet: process.env.BLOCK_EXPLORER_API_KEY ?? '',
// Polygon
polygon: process.env.BLOCK_EXPLORER_API_KEY ?? '',
polygonMumbai: process.env.BLOCK_EXPLORER_API_KEY ?? '',
},
},
// ... |
Beta Was this translation helpful? Give feedback.
-
I am getting this error when trying to deploy the smart contract via truffle. Any ideas?
hardhat.config.ts:128:7 - error TS2322: Type 'string | undefined' is not assignable to type 'string'.
Type 'undefined' is not assignable to type 'string'.
128 rinkeby: process.env.BLOCK_EXPLORER_API_KEY,
~~~~~~~
hardhat.config.ts:129:7 - error TS2322: Type 'string | undefined' is not assignable to type 'string'.
Type 'undefined' is not assignable to type 'string'.
129 mainnet: process.env.BLOCK_EXPLORER_API_KEY,
~~~~~~~
hardhat.config.ts:132:7 - error TS2322: Type 'string | undefined' is not assignable to type 'string'.
Type 'undefined' is not assignable to type 'string'.
132 polygon: process.env.BLOCK_EXPLORER_API_KEY,
~~~~~~~
hardhat.config.ts:133:7 - error TS2322: Type 'string | undefined' is not assignable to type 'string'.
Type 'undefined' is not assignable to type 'string'.
133 polygonMumbai: process.env.BLOCK_EXPLORER_API_KEY,
~~~~~~~~~~~~~
error Command failed with exit code 1.
Beta Was this translation helpful? Give feedback.
All reactions