I have had some issues verifying my contract on BSCscan. I’m relatively new to this.
Here is my code followed by the error:
pragma solidity ^0.8.0;
import “https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC20/ERC20.sol ”;
contract CaribCoin is ERC20 {
constructor(uint256 initialSupply) public ERC20(“CaribCoin”, “CARIB”) {
_mint(msg.sender, initialSupply);
}
}
Warning: SPDX license identifier not provided in source file. Before publishing, consider adding a comment containing "SPDX-License-Identifier: " to each source file. Use “SPDX-License-Identifier: UNLICENSED” for non-open-source code.
ParserError: Source “(previous link posted above. Cannot post more than 2 links due to new account)” not found: File import callback not supported
→ myc:3:1:
|
3 | import “https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC20/ERC20.sol ”
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
My contract adress:
0x980e479b9ddce4ee9ab5a7335fc5af1b8b91e616
1 Like
Hi @Lemon_Juice welcome to the Open Zeppelin forums.
Please follow the tutorial at OpenZeppelin Upgrades: Step by Step Tutorial for Hardhat to get started.
Your verification problem is likely an environment issue.
Are you using Remix, Hardhat, or Truffle?
1 Like
I'm using Remix. I looked at this older threat where an identical issue to mine was resolved.
Im not sure what im doing wrong but i cant verify my contract on BSC scan.
This is my simple code and the error:
pragma solidity ^0.8.0;
// SPDX-License-Identifier: MIT
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC20/ERC20.sol";
contract RandCoin is ERC20 {
constructor(uint256 initialSupply) public ERC20 ("RandCoin", "RAND") {
_mint (msg.sender, initialSupply);
}
}
Compiler Warning(s):
ParserError: Source not found: File impo…
Despite this, I can't seem to fix the problem.
Skyge
May 16, 2021, 1:32am
4
Hi, welcome!
Sorry, I am not familiar with the BSC-Chain, maybe you should ask for help in their forum: Home | Binance Chain Forum
And they have a documentation about how to verify contracts, maybe you can have a look at it:
And your contract has been verified.
I have the same problem too… Anyone find out the solution yet?!!
At the previous tutorial: Create an ERC20 using Remix, without writing Solidity , we have learned how to deploy contracts with the Remix, and now in this tutorial, we will learn how to verify the deployed contracts by a single file.
Cause many people deploy contracts by the Remix, so in this part, we will use the plugin FLATTENER in the Remix to help us to package all contracts file into a single file to verify.
In short, all steps are:
Compile contract
Flatten contract
Copy the whole code to…
try this. It's written by the guy above you