Skip to content

Commit acc8e63

Browse files
author
Yash Agrawal
committed
feat(contracts): add tokenIdCounter to SBTTokens
1 parent c1d505a commit acc8e63

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

contracts/SBT.sol

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ contract SBT is ISBT, ERC721EnumerableUpgradeable {
1313

1414
/// @dev EOA with rights to allow(add)/disallow(remove) minter.
1515
address private _minterUpdater;
16+
/// @dev The counter to mint new NFTs and track supply.
17+
uint256 private _tokenIdCounter;
1618

1719
/// @dev EOA with minting rights.
1820
mapping(address => bool) private _minters;
@@ -96,6 +98,13 @@ contract SBT is ISBT, ERC721EnumerableUpgradeable {
9698
return currentId;
9799
}
98100

101+
/**
102+
* @dev See {IERC721Enumerable-totalSupply}.
103+
*/
104+
function totalSupply() public view override returns (uint256) {
105+
return _tokenIdCounter;
106+
}
107+
99108
function _tokenURI(uint256 tokenId) private view returns (string memory) {
100109
require(tokenId < currentIndex(), "Token not found");
101110

0 commit comments

Comments
 (0)