Obtenez tous les propriétaires qui ont un jeton dans la solidité

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;
    }
akileus