-
Notifications
You must be signed in to change notification settings - Fork 12.4k
Feature/crowdsale refactor #744
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
49b16cf
fc7af3c
d54f799
f48c150
3f5680b
a8a14df
469a999
90f0973
3ffe518
a5aaf94
8a3cfb9
6343246
2c22337
8c8fed1
962b5bc
bbb2dfa
3fdb6da
53ec3cc
2be5806
b814a05
dd05925
120d277
e677e33
5873f8e
2fe239c
bf5e9dd
cd0ba80
0487d25
c4a2f9c
3ef55bc
c1a41ae
b455000
a841691
3d4d41a
8b6b342
1a2a5ec
1680a18
344bec6
7d4035a
bcd0464
51c0954
cd15b41
e716a22
7134f0d
f56116e
2a6dd9f
8e8e8cc
fa055a6
56e83b9
1bf30f9
a70e3ed
5f4fc83
47ce79f
5dab495
dd338f1
8376baa
8ad6a10
107fdc4
530d85d
9fe61b8
de8e88f
6c38f46
33839c1
df03099
c6def0e
c177f01
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11,25 +11,25 @@ import "../../math/SafeMath.sol"; | |
| contract PostDeliveryCrowdsale is TimedCrowdsale { | ||
| using SafeMath for uint256; | ||
|
|
||
| mapping(address => uint256) public promises; | ||
| mapping(address => uint256) public balances; | ||
|
|
||
| /** | ||
| * @dev Overrides parent by storing balances instead of issuing tokens right away. | ||
| * @param _beneficiary Token purchaser | ||
| * @param _tokenAmount Amount of tokens purchased | ||
| */ | ||
| function _processPurchase(address _beneficiary, uint256 _tokenAmount) internal { | ||
| promises[_beneficiary] = promises[_beneficiary].add(_tokenAmount); | ||
| balances[_beneficiary] = balances[_beneficiary].add(_tokenAmount); | ||
| } | ||
|
|
||
| /** | ||
| * @dev Withdraw tokens only after crowdsale ends. | ||
| */ | ||
| function withdrawTokens() public { | ||
| require(hasExpired()); | ||
| uint256 amount = promises[msg.sender]; | ||
| uint256 amount = balances[msg.sender]; | ||
| require(amount > 0); | ||
| promises[msg.sender] = 0; | ||
| balances[msg.sender] = 0; | ||
| _emitTokens(msg.sender, amount); | ||
|
||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -33,10 +33,10 @@ contract SampleCrowdsaleToken is MintableToken { | |
| */ | ||
| contract SampleCrowdsale is CappedCrowdsale, RefundableCrowdsale, MintedCrowdsale { | ||
|
|
||
| function SampleCrowdsale(uint256 _startTime, uint256 _endTime, uint256 _rate, address _wallet, uint256 _cap, MintableToken _token, uint256 _goal, RefundVault _vault) public | ||
| function SampleCrowdsale(uint256 _startTime, uint256 _endTime, uint256 _rate, address _wallet, uint256 _cap, MintableToken _token, uint256 _goal) public | ||
| CappedCrowdsale(_cap) | ||
| FinalizableCrowdsale() | ||
| RefundableCrowdsale(_goal, _vault) | ||
| RefundableCrowdsale(_goal) | ||
| TimedCrowdsale(_startTime, _endTime) | ||
| Crowdsale(_rate, _wallet, _token) | ||
|
||
| { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing doc