I am trying to verify my deployed contract from truffle and getting "Etherscan has no support for network testnet with id 97" error. So I am working with Bscscan and I deployed my contract on bsc testnet.
How can I solve this problem?
My truffle-config.js
const HDWalletProvider = require('truffle-hdwallet-provider');
const fs = require('fs');
const mnemonic = fs.readFileSync(".secret").toString().trim();
const BSCSCANAPIKEY = fs.readFileSync("apikey").toString().trim();
module.exports = {
networks: {
development: {
host: "127.0.0.1", // Localhost (default: none)
port: 8545, // Standard BSC port (default: none)
network_id: "*", // Any network (default: none)
},
testnet: {
provider: () => new HDWalletProvider(mnemonic, `https://data-seed-prebsc-1-s1.binance.org:8545`),
network_id: 97,
confirmations: 1,
timeoutBlocks: 200,
skipDryRun: true
},
bsc: {
provider: () => new HDWalletProvider(mnemonic, `https://bsc-dataseed1.binance.org`),
network_id: 56,
confirmations: 10,
timeoutBlocks: 200,
skipDryRun: true
},
},
// Set default mocha options here, use special reporters etc.
mocha: {
// timeout: 100000
},
// Configure your compilers
compilers: {
solc: {
version: "0.6.12"
}
},
plugins: [
'truffle-plugin-verify'
],
api_keys: {
bscscan: BSCSCANAPIKEY
},
}
Result:
> truffle run verify MyToken@{address}--network testnet
Etherscan has no support for network testnet with id 97
question from:https://stackoverflow.com/questions/66062761/truffle-contract-verify-not-working-on-bsc-testnet