Error! Unable to generate Contract ByteCode and ABI
Found the following ContractName(s) in source code : Context , ERC20 , IERC20 , IERC20Metadata , IUniswapV2Factory , IUniswapV2Router02 , Ownable , SafeMath , TST
But we were unable to locate a matching bytecode (err_code_2)
This is the error I get ...
Deployed CA is 0xbe5da4e946e4d75edee2d80a794d3f3e443af79d. And the code used is ...
You have to flatten the code. You can use remix feature
Could you share your contract codebase?
Then I will verify your contract to help you.
Hi. Can you help me verify this contract? I couldnt seem to find the righr version of the openzeppline contracts that were used.
I have been trying to verify NFT contract that was deployed on June 28th 2022. The developer who deployed the contract is no longer in contact but I have the source code for it. I tried to verify it using Remix, Hardhat and manually through etherscan but it is failing. I think the openzeppelin contracts that were used during deployment were old version as the contract was deployed an year back almost. I do not know exactly what version of OpenZeppelin contracts were used but I know the compiler …
I can help you to verify your contract.
Please share your contract codebase.
// SPDX-License-Identifier: MIT
pragma solidity >=0.7.0 <0.9.0;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
contract ElonGoat is ERC721, Ownable, ReentrancyGuard {
using Strings for uint256;
string baseURI;
string public baseExtension = ".json";
uint256 totalSupply;
uint256 currentSupply;
uint256 NFTCost;
constructor(string memory uri) ERC721("EGT", "EGT") {
totalSupply = 628;
currentSupply = 0;
NFTCost = 0.085 ether;
setBaseURI(uri);
}
function _baseURI() internal view virtual override returns (string memory) {
return baseURI;
}
function mint(uint256 amount) public payable {
require(msg.sender != address(0), "ERC721Mint: INVALID_ADDRESS.");
require(
totalSupply >= currentSupply + amount,
"NOT ENOUGH NFTS AVAILABLE TO MINT."
);
if (msg.sender != owner()) {
require(
msg.value >= NFTCost * amount,
"PLEASE SEND THE REQUIRED ETHER AMOUNT."
);
}
for (uint256 i = 0; i < amount; i++) {
_safeMint(msg.sender, currentSupply + 1);
currentSupply++;
}
}
function getTotalSupply() public view returns (uint256 supply) {
return totalSupply;
}
function getCurrentSupply() public view returns (uint256 supply) {
return currentSupply;
}
function tokenURI(
uint256 tokenId
) public view virtual override returns (string memory) {
require(
_exists(tokenId),
"ERC721Metadata: URI query for nonexistent token"
);
string memory currentBaseURI = _baseURI();
return
bytes(currentBaseURI).length > 0
? string(
abi.encodePacked(
currentBaseURI,
tokenId.toString(),
baseExtension
)
)
: "";
}
function setBaseURI(string memory _newBaseURI) public onlyOwner {
baseURI = _newBaseURI;
}
function setNFTCost(uint256 newNFTCost) public onlyOwner nonReentrant {
NFTCost = newNFTCost;
}
function getBaseURI() public view returns (string memory) {
return baseURI;
}
function getNFTCost() public view returns (uint256) {
return NFTCost;
}
function setBaseExtension(
string memory _newBaseExtension
) public onlyOwner {
baseExtension = _newBaseExtension;
}
function adminIncreaseMaxSupply(
uint16 newMaxSupply
) external onlyOwner nonReentrant {
totalSupply = newMaxSupply;
}
function withdraw() public payable onlyOwner {
(bool success, ) = payable(msg.sender).call{
value: address(this).balance
}("");
require(success);
}
}
The Contract Address 0x12cc1751DEcA32b43a090F73A74Aa998f977E275 page allows users to view the source code, transactions, balances, and analytics for the contract address. Users can also interact and make transactions to the contract directly on...
Please check this url.
I have verified your contract.
Actually I wanted to verify an already deployed contract. That is where I am facing the issue as the deployed byte code and the generated ones dont match. Even here the goerli byte code is different than the one on the etherscan. Anyway to get the deployed contract verified on etherscan?