I am trying to insert the .sol file in the contract displayed in Robsten net. Buy I need the address of librarys and contracts. Is my first contract in this tecnology.
//Contract based on https://docs.openzeppelin.com/contracts/3.x/erc721
// SPDX-License-Identifier: MIT
// In memory of my dear dog Estrella. Rest in peace 2021 - April
pragma solidity ^0.7.3;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
contract NFT is ERC721, Ownable {
using Counters for Counters.Counter;
Counters.Counter private _tokenIds;
constructor() public ERC721("NFT", "NFT") {}
function mintNFT(address recipient, string memory tokenURI)
public onlyOwner
returns (uint256)
{
_tokenIds.increment();
uint256 newItemId = _tokenIds.current();
_mint(recipient, newItemId);
_setTokenURI(newItemId, tokenURI);
return newItemId;
}
}
Hi there. No library addresses are needed in this case. For verifying the contract I would recommend deploying using Hardhat and verifying using the hardhat-etherscan plugin. Do not deploy to mainnet until you have successfully verified the contract on a testnet.
Hello It has been done with Hardhat. But when uploading the contract to the network, robsten asks you for the separate files. And I don’t think I have to upload the JSON and Javascript Scripts there, right?
If you deployed with hardhat then just use the hardhat-etherscan plugin! You don’t need to interact with the Etherscan site. Please take a look at the documentation for the plugin: https://hardhat.org/plugins/nomiclabs-hardhat-etherscan.html
Hi, how can I verify contract using Hardhat on Cronos net?
I found that it's difficult to use hardhat-etherscan plugin for contract verify in cronos network.