Extension of Crowdsale contract that adds a funding goal, and the possibility of users getting a refund if goal is not met. WARNING: note that if you allow tokens to be traded before the goal is met, then an attack is possible in which the attacker purchases tokens from the crowdsale and when they sees that the goal is unlikely to be met, they sell their tokens (possibly at a discount). The attacker will be refunded when the crowdsale is finalized, and the users that purchased from them will be left with worthless tokens. There are many possible ways to avoid this, like making the the crowdsale inherit from PostDeliveryCrowdsale, or imposing restrictions on token trading until the crowdsale is finalized. This is being discussed in https://github.com/OpenZeppelin/openzeppelin-solidity/issues/877 This contract will be updated when we agree on a general solution for this problem.
function _finalization() internal
Escrow finalization task, called when finalize() is called.
function _forwardFunds() internal
Overrides Crowdsale fund forwarding, sending funds to escrow.
function claimRefund(address beneficiary) public
Investors can claim refunds here if crowdsale is unsuccessful.
beneficiary- Whose refund will be claimed.
function (uint256 goal) internal
Constructor, creates RefundEscrow.
goal- Funding goal
function goal() public view returns (uint256)
- minimum amount of funds to be raised in wei.
function goalReached() public view returns (bool)
Checks whether funding goal was reached.
- Whether funding goal was reached