Skip to content

Latest commit

 

History

History
232 lines (190 loc) · 7.28 KB

IndividuallyCappedCrowdsale.md

File metadata and controls

232 lines (190 loc) · 7.28 KB

IndividuallyCappedCrowdsale (IndividuallyCappedCrowdsale.sol)

View Source: contracts/crowdsale/validation/IndividuallyCappedCrowdsale.sol

↗ Extends: Crowdsale, CapperRole ↘ Derived Contracts: IndividuallyCappedCrowdsaleImpl

IndividuallyCappedCrowdsale

Crowdsale with per-beneficiary caps.

Contract Members

Constants & Variables

mapping(address => uint256) private _contributions;
mapping(address => uint256) private _caps;

Functions

setCap

Sets a specific beneficiary's maximum contribution.

function setCap(address beneficiary, uint256 cap) external undefined onlyCapper 

Arguments

Name Type Description
beneficiary address Address to be capped
cap uint256 Wei limit for individual contribution

getCap

Returns the cap of a specific beneficiary.

function getCap(address beneficiary) public
returns(uint256)

Returns

Current cap for individual beneficiary

Arguments

Name Type Description
beneficiary address Address whose cap is to be checked

getContribution

Returns the amount contributed so far by a specific beneficiary.

function getContribution(address beneficiary) public
returns(uint256)

Returns

Beneficiary contribution so far

Arguments

Name Type Description
beneficiary address Address of contributor

_preValidatePurchase

⤾ overrides Crowdsale._preValidatePurchase

Extend parent behavior requiring purchase to respect the beneficiary's funding cap.

function _preValidatePurchase(address beneficiary, uint256 weiAmount) internal

Arguments

Name Type Description
beneficiary address Token purchaser
weiAmount uint256 Amount of wei contributed

_updatePurchasingState

⤾ overrides Crowdsale._updatePurchasingState

Extend parent behavior to update beneficiary contributions

function _updatePurchasingState(address beneficiary, uint256 weiAmount) internal undefined

Arguments

Name Type Description
beneficiary address Token purchaser
weiAmount uint256 Amount of wei contributed

Contracts