hardhat.config.js 960 B

1234567891011121314151617181920212223242526272829
  1. require("@nomicfoundation/hardhat-toolbox");
  2. // The next line is part of the sample project, you don't need it in your
  3. // project. It imports a Hardhat task definition, that can be used for
  4. // testing the frontend.
  5. require("./tasks/faucet");
  6. //转到https://www.alchemyapi.io,注册,创建
  7. //在仪表板中安装一个新的应用程序,并用其键替换“KEY”
  8. const ALCHEMY_API_KEY = "1DMM5KirKK3HriaDHRxrTFjYNKko9Kwn";
  9. //用Goerli帐户私钥替换此私钥
  10. //要从Metamask导出私钥,请打开Metamask并
  11. //转到帐户详细信息>导出私钥
  12. //小心:切勿将真实以太币放入测试账户
  13. const GOERLI_PRIVATE_KEY = "511348790f6c17d7fbafdb7108307698542acef8ca01e7d263d8367cc412015a";
  14. /** @type import('hardhat/config').HardhatUserConfig */
  15. module.exports = {
  16. solidity: "0.8.9",
  17. networks: {
  18. goerli: {
  19. url: `https://eth-goerli.alchemyapi.io/v2/${ALCHEMY_API_KEY}`,
  20. accounts: [GOERLI_PRIVATE_KEY]
  21. }
  22. }
  23. };