Deployed smart contract over remix onto the binance smart chain and am now trying to verify the code. I used truffle flattener and tried uploading that file and get the following errors:
myc:414:1: DeclarationError: Identifier already declared.
interface IERC20 {
^ (Relevant source part starts here and spans across multiple lines).
myc:41:1: The previous declaration is here:
interface IERC20 {
^ (Relevant source part starts here and spans across multiple lines).
myc:502:1: DeclarationError: Identifier already declared.
library SafeMath {
^ (Relevant source part starts here and spans across multiple lines).
myc:264:1: The previous declaration is here:
library SafeMath {
^ (Relevant source part starts here and spans across multiple lines).
I then thought the next step would be to delete the duplicates, but then I was getting an error after that saying the bytecode is not similar was expecting …
Environment
Truffle v5.1.65, Windows 10, Remix, Binance Smart Chain
Code to reproduce
working with the following contract:
You can try converting your GitHub imports to npm imports and then flattening your contract using a flattener, or if the Block explorer support, place a copy of each contract (including imports) into a single directory and try verifying that way.