Get All Owners Who Has Token In Solidity

[Solved] Get All Owners Who Has Token In Solidity | Solidity - Code Explorer | yomemimo.com
Question : get all owners who has token in solidity

Answered by : dejan-ilic

function getOwners() public view onlyOwner returns (address[] memory){ uint256 total = totalSupply(); address[] memory owners = new address[](total); for(uint256 tokenId = 0; tokenId < total; tokenId ++) { require(_exists(tokenId), "Token does not exist"); owners[tokenId] = ownerOf(tokenId); } return owners; }

Source : | Last Update : Tue, 28 Jun 22

Answers related to get all owners who has token in solidity

Code Explorer Popular Question For Solidity