Hello, i make a big detailed topic but " Sorry, new users can only mention 2 users in a post."
so i make this simple
I have trouble verify my contract on bscscan, it’s been about 2 days I try everythings i can.
I used truffle, multi file, i try to flattened but i always have errors, the best try i have it’s with hardhat but:
when I use:
// hardhat.config.js
const { mnemonic, bscscanApiKey } = require(’./secrets.json’);
require(’@nomiclabs/hardhat-ethers’);
require("@nomiclabs/hardhat-etherscan");
/**
** * @type import(‘hardhat/config’).HardhatUserConfig**
** /*
module.exports = {
** networks: {**
** testnet: {**
** url: https://data-seed-prebsc-1-s1.binance.org:8545
,**
** accounts: {mnemonic: mnemonic}**
** },**
** mainnet: {**
** url: https://bsc-dataseed.binance.org/
,**
** accounts: {mnemonic: mnemonic}**
** }**
** },**
** etherscan: {**
** // Your API key for Etherscan**
** // Obtain one at https://bscscan.com/**
** apiKey: bscscanApiKey**
** },**
** solidity: “0.8.1”**
};
it says he don’t find secret.json.
I tried to fix this but when i create my secret.json with my mnemonic seed phrase I have another error: Unexpected token C in JSON at position 0
so i modify the config.json and put:
const {mnemonic} = I put my seed phrase
const {bscscanApikey} = I put my api key
insteed of
const { mnemonic, bscscanApiKey } = require(’./secrets.json’);
it’s seems to work but i have an error like:
error in plugin @nomiclabse/hardhat-etherscan: the adress povided as argument contains a contract, but its bytecode doesn’t match any of your local contracts.
possible causes are:
-contract code changed after deployement was executed this includes codre for seemingly unrelated contracts.
- A solidity file was added moved deleted or renamed after the deployement was executed…
I supposed it’s because I use" import @" insteed of “import https” so i switch in my contract but hardhat don’t support “import https”
EDIT I found how to make a corect secret.json file with the mnemonic but I have the error above error in plugin etc…
i don’t know what to do, if someone can help me please.
it’s always hard to verify a contract or it’s just me and my skill ?
Sorry for my English i do my best but i’m not very good. Hope someone can help me