contract GatherStandardTrophies is ERC721, ERC721Metadata {

    // Address of contract deployer/trophy minter
    address public creator;

     /**
     * @dev Modifier limiting certain functions to creator address
     */
    modifier onlyCreator() {
        require(creator == msg.sender);
        _;
    }

    /**
     * @dev Constructor function
     */
    constructor (string memory name, string memory symbol) public ERC721Metadata(name, symbol) {
        name = _name;
        symbol = _symbol;
        creator = msg.sender;
    }

    /**
     * @dev Mints six standard trophies at conclusion of gathering
     * @param winners Array containing six addresses of trophy winners 
     * @param uri String containing ordered list of all trophies' URI info, in 59 character length chunks pointing to ipfs URL
     */
    function mintStandardTrophies(address[] memory winners, string memory uri) public onlyCreator {
        mintSchmoozerTrophy((winners[0]), _substring(uri,59,0));
        mintCupidTrophy((winners[1]), _substring(uri,59,59));
        mintMVPTrophy((winners[2]), _substring(uri,59,118));
        mintHumanRouterTrophy((winners[3]), _substring(uri,59,177));
        mintOracleTrophy((winners[4]), _substring(uri,59,236));
        mintKevinBaconTrophy((winners[5]), _substring(uri,59,295));
    }

    /**
     * @dev Public function that mints Schmoozer trophy at conclusion of gathering to gatherNode with most connections made
     * @param winner Address of trophy winner 
     * @param uri String containing IPFS link to URI info
     */
    function mintSchmoozerTrophy(address winner, string memory uri) public onlyCreator {
        _mint(winner, 1);
        _tokenNames[1] = "Schmoozer Trophy";
        _tokenURIs[1] = uri;
    }

    /**
     * @dev Public function that mints Cupid trophy at conclusion of gathering to gatherNode with most matches made
     * @param winner Address of trophy winner 
     * @param uri String containing IPFS link to URI info
     */
    function mintCupidTrophy(address winner, string memory uri) public onlyCreator  {
        _mint(winner, 2);
        _tokenNames[2] = "Cupid Trophy";
        _tokenURIs[2] = uri;
    } 
    
    /**
     * @dev Public function that mints  MVP trophy at conclusion of gathering to gatherNode with most total points
     * @param winner Address of trophy winner 
     * @param uri String containing IPFS link to URI info
     */ 
    function mintMVPTrophy(address winner, string memory uri) public onlyCreator {
        _mint(winner, 3);
        _tokenNames[3] = "MVP Trophy";
        _tokenURIs[3] = uri;
    } 

    /**
     * @dev Public function that mints Human Router trophy at conclusion of gathering to gatherNode with most recommendations made
     * @param winner Address of trophy winner 
     * @param uri String containing IPFS link to URI info
     */
    function mintHumanRouterTrophy(address winner, string memory uri) public onlyCreator {
        _mint(winner, 4);
        _tokenNames[4] = "Human Router Trophy";
        _tokenURIs[4] = uri;
    }
    
    /**
     * @dev Public function that mints Oracle trophy at conclusion of gathering to gatherNode with most supermatches 
     * @param winner Address of trophy winner 
     * @param uri String containing IPFS link to URI info
     */
    function mintOracleTrophy(address winner, string memory uri) public onlyCreator {
        _mint(winner, 5);
        _tokenNames[5] = "Oracle Trophy";
        _tokenURIs[5] = uri;
    } 


    /**
     * @dev Public function that mints Kevin Bacon trophy at conclusion of gathering 
     * to gatherNode with fewest average degrees of separation from all other gatherNodes
     * @param winner Address of trophy winner 
     * @param uri String containing IPFS link to URI info
     */
    function mintKevinBaconTrophy(address winner, string memory uri) public onlyCreator {
        _mint(winner, 6);
        _tokenNames[6] = "Kevin Bacon Trophy";
        _tokenURIs[6] = uri;
    }   

}
/**
 * @title Gather Standard Trophies - Gathering-based Non-Fungible ERC721 Tokens 
 * @author Victor Rortvedt (@vrortvedt)
 * This implementation includes all the required and some optional functionality of the ERC721 standard
 * @dev see https://github.com/ethereum/EIPs/blob/master/EIPS/eip-721.md
 */
function mintOracleTrophy(address winner, string memory uri) public onlyCreator {
    _mint(winner, 5);
    _tokenNames[5] = "Oracle Trophy";
    _tokenURIs[5] = uri;
} 

/**
 * @dev Public function that mints Oracle trophy at conclusion of gathering to gatherNode with most supermatches 
 * @param winner Address of trophy winner 
 * @param uri String containing IPFS link to URI info
 */