Asking for help correcting a Smart Contract in order to verify it

Hello All,

I am in process of cloning an existing smart contract and make it my own.
I can deploy it successfully and write to the contract through remix.
However, I permanently fail to successfully verify my own adjusted contract on chain.

It either fails to verify on " Error! Unable to generate Contract ByteCode and ABI (Expected library(ies) but one or more was not provided)".
Or I can get it verified, but it is then verified as contract name “IterableMapping” and I cannot read nor write to the contract on chain.
Any help on finding and correcting my mistake would be highly appreciated indeed.

Many thanks for any assist in advanced.

what is an address on chain of that verified contract that it worked?

Hello @cryptokid,

I cloned it from the working contract at 0x9a05D1FF699ea187Dc8523E333eD63503f0d82db

I mean an example in this case where you were able to verify it

maybe you have to choose some settings when you verify it, like the type of the EVM or the version for solidity

Oh, I misunderstood you.

This is the verified one:

it could be that you deployed this “IterableMapping” in that particular case, in Remix you can choose what contract to deploy

this “IterableMapping” is included in the main contract and you could deploy this one by mistake instead of the main contract

Hmm, I don’t think so.
Remix clearly stated “contracts/BabySushi.sol”
What I noticed after was that there was no “pragma solidity ^0.6.12;” before “contract BABYSUSHI is ERC20, Ownable {”, and the last “pragma solidity ^0.6.2;” was before “library IterableMapping {”.
And I see that the reason why it was detected as contract “IterableMapping”, and not as “BABYSUSHI”.
Since I changed/adjusted that I fail to verify the contract with:

**Compiler debug log:**
Error! Unable to generate Contract ByteCode and ABI **(Expected library(ies) but one or more was not provided)**
Found the following ContractName(s) in source code : **BABYSUSHI**, **BABYSUSHIDividendTracker**, **Context**, **DividendPayingToken**, **DividendPayingTokenInterface**, **DividendPayingTokenOptionalInterface**, **ERC20**, **IERC20**, **IERC20Metadata**, **IUniswapV2Factory**, **IUniswapV2Pair**, **IUniswapV2Router01**, **IUniswapV2Router02**, **IterableMapping**, **Ownable**, **SafeMath**, **SafeMathInt**, **SafeMathUint**
But we were unable to locate a matching bytecode (err_code_2)

what version of solidity was used in remix to compile that contract?
you should select the same version when you verify the contract

0.6.12, as the same used for verification

There may be something helpful in this thread for this issue.