contract HoardToken is ExtendedStandardToken {

    // Token description fields
    string public constant name = "Hoard Token";
    string public constant symbol = "HRD";
    uint256 public constant decimals = 18;  // 18 decimal places, the same as ETH

    // contract supervision variables
    address public creator;
    address public hoard;
    address public migrationMaster;


    // MODIFIERS

    modifier onlyCreator {
        require(msg.sender == creator);
        _;
    }

    modifier onlyHoard {
        require(msg.sender == hoard);
        _;
    }

    modifier onlyMigrationMaster {
        require(msg.sender == migrationMaster);
        _;
    }

    // CONSTRUCTION

    /// @param _hoard Hoard multisig contract
    /// @param _migrationMaster migration master
    constructor (address _hoard, address _migrationMaster) public {
        require(_hoard != address(0));
        require(_migrationMaster != address(0));

        creator = msg.sender;
        hoard = _hoard;
        migrationMaster = _migrationMaster;
    }


    // BASE CLASS IMPLEMENTATION

    /// @notice ExtendedStandardToken is StandardToken
    function transfer               (address _to, uint256 _value) public
        returns (bool) 
    {
        return super.transfer(_to, _value);
    }


    /// @notice ExtendedStandardToken is StandardToken
    function transferFrom           (address _from, address _to, uint256 _value) public 
        returns (bool)
    {
        return super.transferFrom(_from, _to, _value);
    }


    /// @notice ExtendedStandardToken is Migratable
    function migrate                (uint256 _value) public migrationAgentSet {
        super.migrate(_value);    
    }

    /// @notice ExtendedStandardToken
    function setMigrationAgent      (address _address) public onlyMigrationMaster migrationAgentNotSet {
        require(_address != address(0));

        super.setMigrationAgent(_address);
    }

    /// @notice ExtendedStandardToken is Mintable
    function mintTokens             (address _recipient, uint256 _amount) public onlyCreator {
        super.mintTokens(_recipient, _amount);
    }

    // CONTROL LOGIC

    /// @dev changes Hoard multisig address to another one
    function changeHoardAddress     (address _address) onlyHoard external { hoard = _address; }

    /// @dev changes migration master address to another one
    function changeMigrationMaster  (address _address) onlyHoard external { migrationMaster = _address; }

}
/// @title Hoard Token (HRD) - crowdfunding code for Hoard token
/// @author Hoard Team
/// @notice Based on MLN implementation - https://github.com/melonproject/melon/blob/master/contracts/tokens/MelonToken.sol
/// @notice Based on GNT implementation - https://github.com/golemfactory/golem-crowdfunding/blob/master/contracts/Token.sol
function changeMigrationMaster  (address _address) onlyHoard external { migrationMaster = _address; }

/// @dev changes migration master address to another one