From af7820b5c21763bc198cb09f7fa3df168781a8db Mon Sep 17 00:00:00 2001 From: YaStaer <124512503+YaStaer@users.noreply.github.com> Date: Mon, 6 Mar 2023 18:24:25 +0300 Subject: [PATCH] Update CallistoNFT_my.sol --- CallistoNFT_my.sol | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/CallistoNFT_my.sol b/CallistoNFT_my.sol index f4197ea..b586a39 100644 --- a/CallistoNFT_my.sol +++ b/CallistoNFT_my.sol @@ -666,31 +666,31 @@ abstract contract EnumerableNFT is CallistoNFT, IEnumerableNFT { contract NFT is EnumerableNFT, Ownable { using Strings for uint256; - uint256 public cost = 0.05 ether; uint256 public maxSupply = 1000; - uint256 public fees = 1000; bool public paused = false; constructor( string memory _name, - string memory _symbol - ) CallistoNFT(_name, _symbol, fees) {} + string memory _symbol, + uint256 _fees + ) CallistoNFT(_name, _symbol, _fees) {} - // public function mint(string memory tURI) public payable onlyOwner { uint256 supply = totalSupply(); require(!paused, "Mint NFT is paused"); - require(supply <= maxSupply); - - //require(msg.sender == owner(), "Mint NFT only owner"); + require(supply < maxSupply); _safeMint(msg.sender, supply + 1, tURI); } - function tokenURI(uint256 tURI) public view returns (string memory){ - return _tokenURI[tURI]; + function tokenURI(uint256 tokenId) public view returns (string memory){ + return _tokenURI[tokenId]; + } + + function setTokenURI(uint256 tokenId, string memory tURI) public onlyOwner { + _tokenURI[tokenId] = tURI; } function walletOfOwner(address _owner) @@ -706,8 +706,6 @@ contract NFT is EnumerableNFT, Ownable { return tokenIds; } - //only owner - function pause(bool _state) public onlyOwner { paused = _state; }