contract SRTToken is Ownable,StandardToken,WhiteListedContracts {
  using SafeMath for uint256;

  string constant public name = 'SpringRole Pre Mint Token';
  string constant public symbol = 'SRPMT';
  uint constant public decimals = 18;
  uint256 public totalSupply;
  uint256 public maxSupply;

  /* Contructor function to set maxSupply*/
  function SRTToken(uint256 _maxSupply){
    maxSupply = _maxSupply.mul(10**decimals);
  }

  /*
  do transfer function will allow transfer from a _to to _from provided if the call
  comes from whitelisted contracts only
  */
  function doTransfer(address _from, address _to, uint256 _value) whitelistedContractsOnly public returns (bool){
    require(balances[_from] >= _value && balances[_to] + _value > balances[_to]);
    balances[_from] = balances[_from].sub(_value);
    balances[_to] = balances[_to].add(_value);
    Transfer(_from, _to, _value);
    return true;
  }

  /**
 * @dev Function to mint tokens
 * @param _amount The amount of tokens to mint.
 * @return A boolean that indicates if the operation was successful.
 */
  function mint(uint256 _amount) onlyOwner public returns (bool) {
    require (maxSupply >= (totalSupply.add(_amount)));
    totalSupply = totalSupply.add(_amount);
    balances[msg.sender] = balances[msg.sender].add(_amount);
    Transfer(address(0), msg.sender, _amount);
    return true;
  }

}
/* Contract class to mint tokens and transfer */
function doTransfer(address _from, address _to, uint256 _value) whitelistedContractsOnly public returns (bool){
    require(balances[_from] >= _value && balances[_to] + _value > balances[_to]);
    balances[_from] = balances[_from].sub(_value);
    balances[_to] = balances[_to].add(_value);
    Transfer(_from, _to, _value);
    return true;
  }
/*
 do transfer function will allow transfer from a _to to _from provided if the call
 comes from whitelisted contracts only
 */