Browse Source

Improved documentation for _preValidatePurchase method in Crowdsale (#1101)

* Improved documentation for _preValidatePurchase in Crowdsale

* Added newline at EOF
Doug Crescenzi 7 years ago
parent
commit
23074676c4
1 changed files with 4 additions and 1 deletions
  1. 4 1
      contracts/crowdsale/Crowdsale.sol

+ 4 - 1
contracts/crowdsale/Crowdsale.sol

@@ -110,7 +110,10 @@ contract Crowdsale {
   // -----------------------------------------
 
   /**
-   * @dev Validation of an incoming purchase. Use require statements to revert state when conditions are not met. Use super to concatenate validations.
+   * @dev Validation of an incoming purchase. Use require statements to revert state when conditions are not met. Use `super` in contracts that inherit from Crowdsale to extend their validations.
+   * Example from CappedCrowdsale.sol's _preValidatePurchase method: 
+   *   super._preValidatePurchase(_beneficiary, _weiAmount);
+   *   require(weiRaised.add(_weiAmount) <= cap);
    * @param _beneficiary Address performing the token purchase
    * @param _weiAmount Value in wei involved in the purchase
    */