I deployed my smart Contract to BscTestnet and BscMainnet using Remix. Now I want to verify and Publish my smart Contract on BscScan but its failing I need Addresses of the OpenZeppelin libraries I have used to verify my smart Contract.
Error:
Addresses of Libraries Used need to be input here:
Code to reproduce
<
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol";
library SafeMath {
/**
- @dev Returns the addition of two unsigned integers, reverting on
- overflow.
- Counterpart to Solidity's
+
operator. - Requirements:
-
- Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
- Addition cannot overflow.
return c;
}
/**
- @dev Returns the subtraction of two unsigned integers, reverting on
- overflow (when the result is negative).
- Counterpart to Solidity's
-
operator. - Requirements:
-
- Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
- Subtraction cannot overflow.
/**
- @dev Returns the subtraction of two unsigned integers, reverting with custom message on
- overflow (when the result is negative).
- Counterpart to Solidity's
-
operator. - Requirements:
-
- Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
- Subtraction cannot overflow.
return c;
}
/**
- @dev Returns the multiplication of two unsigned integers, reverting on
- overflow.
- Counterpart to Solidity's
*
operator. - Requirements:
-
- Multiplication cannot overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) {
return 0;
}
- Multiplication cannot overflow.
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
/**
- @dev Returns the integer division of two unsigned integers. Reverts on
- division by zero. The result is rounded towards zero.
- Counterpart to Solidity's
/
operator. Note: this function uses a -
revert
opcode (which leaves remaining gas untouched) while Solidity - uses an invalid opcode to revert (consuming all remaining gas).
- Requirements:
-
- The divisor cannot be zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
- The divisor cannot be zero.
/**
- @dev Returns the integer division of two unsigned integers. Reverts with custom message on
- division by zero. The result is rounded towards zero.
- Counterpart to Solidity's
/
operator. Note: this function uses a -
revert
opcode (which leaves remaining gas untouched) while Solidity - uses an invalid opcode to revert (consuming all remaining gas).
- Requirements:
-
- The divisor cannot be zero.
*/
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
// Solidity only automatically asserts when dividing by 0
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
- The divisor cannot be zero.
return c;
}
/**
- @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
- Reverts when dividing by zero.
- Counterpart to Solidity's
%
operator. This function uses arevert
- opcode (which leaves remaining gas untouched) while Solidity uses an
- invalid opcode to revert (consuming all remaining gas).
- Requirements:
-
- The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
- The divisor cannot be zero.
/**
- @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
- Reverts with custom message when dividing by zero.
- Counterpart to Solidity's
%
operator. This function uses arevert
- opcode (which leaves remaining gas untouched) while Solidity uses an
- invalid opcode to revert (consuming all remaining gas).
- Requirements:
-
- The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
- The divisor cannot be zero.
contract MintNFT is ERC721, ERC721Enumerable, ERC721URIStorage {
using SafeMath for uint256;
uint public constant mintPrice = 0;
uint256 total_value;
function _beforeTokenTransfer(address from, address to, uint256 tokenId) internal override(ERC721, ERC721Enumerable){
super._beforeTokenTransfer(from,to,tokenId);
}
function _burn(uint256 tokenId) internal override(ERC721, ERC721URIStorage){
super._burn(tokenId);
}
function tokenURI(uint256 tokenId) public view override(ERC721, ERC721URIStorage) returns(string memory){
return super.tokenURI(tokenId);
}
function supportsInterface(bytes4 interfaceId) public view override(ERC721, ERC721Enumerable) returns (bool){
return super.supportsInterface(interfaceId);
}
constructor() ERC721("Grighund.net", "Grig"){}
function mint(string memory _uri, address recipient) public payable {
uint256 mintIndex = totalSupply();
_safeMint(recipient, mintIndex);
_setTokenURI(mintIndex, _uri);
}
function returnID() public view returns(uint256){
return totalSupply();
}
function charge(address payable receiverAddr) payable public{
// total_value += msg.value;
receiverAddr.transfer(msg.value);
}
function withdraw(address payable receiverAddr, uint receiverAmnt) public {
receiverAddr.transfer(receiverAmnt);
}
}/>
Environment
Remix