Skip to content

Commit 08774c9

Browse files
authored
Merge pull request #297 from windingtree/crowdsale-paused-issues
LifCrowdsale: Disallow some methods when paused
2 parents 29a7007 + 55333ac commit 08774c9

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

contracts/LifCrowdsale.sol

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ contract LifCrowdsale is Ownable, Pausable {
213213
214214
@param beneficiary Address to which Lif should be sent
215215
*/
216-
function buyTokens(address beneficiary) public payable validPurchase {
216+
function buyTokens(address beneficiary) public payable whenNotPaused validPurchase {
217217
require(beneficiary != address(0));
218218
assert(weiPerUSDinTGE > 0);
219219

@@ -376,7 +376,7 @@ contract LifCrowdsale is Ownable, Pausable {
376376
@dev Allows a TGE contributor to claim their contributed eth in case the
377377
TGE has finished without reaching the minCapUSD
378378
*/
379-
function claimEth() public hasEnded {
379+
function claimEth() public whenNotPaused hasEnded {
380380
require(isFinalized);
381381
require(!funded());
382382

@@ -394,7 +394,7 @@ contract LifCrowdsale is Ownable, Pausable {
394394
Mechanism in case the soft cap was exceeded. It also unpauses the token to
395395
enable transfers. It can be called only once, after `end2Timestamp`
396396
*/
397-
function finalize() public hasEnded {
397+
function finalize() public whenNotPaused hasEnded {
398398
require(!isFinalized);
399399

400400
// foward founds and unpause token only if minCap is reached

test/commands.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -423,6 +423,7 @@ async function runClaimEthCommand(command, state) {
423423

424424
let shouldThrow = !state.crowdsaleFinalized ||
425425
state.crowdsaleFunded ||
426+
state.crowdsalePaused ||
426427
(purchases.length == 0) ||
427428
hasZeroAddress ||
428429
state.claimedEth[command.fromAccount] > 0;

0 commit comments

Comments
 (0)