简体   繁体   中英

Can't verify ERC20/BEP20 token on BSCScan

I deployed an ERC20/BEP20 token on binance smart chain using truffle and openzepplin . Now I want to verify this smart contract but I have some issues.

$ truffle run verify MyToken --network bsc

Verifying MyToken
Unable to process the standard-input-json you uploaded
Failed to verify 1 contract(s): MyToken

Let's try another way:

$ npx truffle-flattener ./contracts/MyToken.sol > ./contracts/token/FlatMyToken.sol

After copy/paste the output code into the bscscan I receive this error: 
ParserError: Multiple SPDX license identifiers found in source file. Use "AND" or "OR" to combine multiple licenses. Please see https://spdx.org for more information.
--> myc

Using the second method, when I delete the relevant lines, the bytecode changes!

These methods do not work for me.

I would recommend using https://github.com/hjubb/solt

Run:

solt write ./contracts/MyToken.sol

Then, once you've gotten the solc-input-MyToken.json file, you can upload it to BscScan directly.

The first method doesn't work because there's some weird issue with truffle verification, in that it doesn't submit valid JSON. The second method doesn't work because of the different SPDX identifiers. I have no idea why removing the spdx identifiers results in different bytecode, however.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM