From 85996dd5615f5bdd4ea2bbd0e08e817ccd9ed57d Mon Sep 17 00:00:00 2001 From: Jaz-3-0 Date: Mon, 3 Jun 2024 15:18:51 +0200 Subject: [PATCH] update init utility functions --- smart_contract/contracts/Token.sol | 32 ++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/smart_contract/contracts/Token.sol b/smart_contract/contracts/Token.sol index 30c84db..1003ea5 100644 --- a/smart_contract/contracts/Token.sol +++ b/smart_contract/contracts/Token.sol @@ -124,6 +124,38 @@ contract NFTMintDN404 is DN404, ERC20Permit, Ownable { return _symbol; } + // initialize tokenURI functionality - token metadata + function tokenURI(uint256 tokenId) public view override returns(string memory result) { + if (bytes(_baseURI).length != 0) { + result = string(abi.encodePacked(_baseURI, LibString.toString(tokenId)); + } + } + + // initialize allowlist mamagement functionality + function setAllowlist(bytes32 allowlistRoot_) public onlyOwner { + allowlistRoot = allowlistRoot_; + } + + // initialize utility functions + function nftTotalSupply() public view returns(uint256) { + return _totalNFTSupply; + } + + function nftBalanceOf(address owner) public view returns(uint256) { + return _balanceOfNFT(owner); + } + + function previewNextTokenId() public view returns(uint256) { + return _nextTokenId; + } + + function getURI() public view returns(string memory) { + return _baseURI; + } + + + +