contract IndividualCappedCrowdsale is Crowdsale {
  using SafeMath for uint256;

  uint public constant GAS_LIMIT_IN_WEI = 50000000000 wei;

  // The maximum wei amount a user can spend during this sale
  uint256 public capPerAddress;

  mapping(address=>uint) public participated;

  function IndividualCappedCrowdsale(uint256 _capPerAddress) {
    // require(capPerAddress > 0);
    capPerAddress = _capPerAddress;
  }

  /**
    * @dev overriding CappedCrowdsale#validPurchase to add an individual cap
    * @return true if investors can buy at the moment
    */
  function validPurchase() internal returns (bool) {
    require(tx.gasprice <= GAS_LIMIT_IN_WEI);
    participated[msg.sender] = participated[msg.sender].add(msg.value);
    return super.validPurchase() && participated[msg.sender] <= capPerAddress;
  }
}
/**
 * @title IndividualCappedCrowdsale
 * @dev Extension of Crowdsale with an individual cap
 */
function validPurchase() internal returns (bool) {
    require(tx.gasprice <= GAS_LIMIT_IN_WEI);
    participated[msg.sender] = participated[msg.sender].add(msg.value);
    return super.validPurchase() && participated[msg.sender] <= capPerAddress;
  }
/**
 * @dev overriding CappedCrowdsale#validPurchase to add an individual cap
 * @return true if investors can buy at the moment
 */