【发布时间】:2022-11-11 01:30:16
【问题描述】:
我正在尝试从 truffle 验证我部署的合约,并收到“Etherscan 不支持链 ID 为 11155111 的网络 sepolia”错误。所以我正在与 Etherscan 合作,并将我的合同部署在 sepolia 测试网上。
我怎么解决这个问题?
我的松露-config.js
const apikeys = require("./chains/apikeys");
const keys = require("./keys.json");
module.exports = {
plugins: ["truffle-plugin-verify"],
api_keys:{
etherscan: "myApiEtherScan"
},
contracts_build_directory: "./public/contracts",
networks: {
development: {
host: "127.0.0.1",
port: 7545,
network_id: "*",
},
sepolia: {
provider: () =>
new HDWalletProvider(
keys.PRIVATE_KEY,
keys.INFURA_SEPOLIA_URL,
),
network_id: 11155111,
gas:5221975,
gasPrice:20000000000,
confirmations: 3,
timeoutBlocks:200,
skipDryRun: true
}
},
compilers: {
solc: {
version: "0.8.16",
settings: {
optimizer: {
enabled: true, // Default: false
runs: 1000 // Default: 200
}
}
}
},
};
【问题讨论】:
标签: solidity smartcontracts api-key truffle etherscan