You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
40 lines
917 B
40 lines
917 B
pragma solidity ^0.4.11;
|
|
|
|
import '../math/SafeMath.sol';
|
|
import '../ownership/Ownable.sol';
|
|
import './Crowdsale.sol';
|
|
|
|
/**
|
|
* @title FinalizableCrowdsale
|
|
* @dev Extension of Crowsdale where an owner can do extra work
|
|
* after finishing.
|
|
*/
|
|
contract FinalizableCrowdsale is Crowdsale, Ownable {
|
|
using SafeMath for uint256;
|
|
|
|
bool public isFinalized = false;
|
|
|
|
event Finalized();
|
|
|
|
/**
|
|
* @dev Must be called after crowdsale ends, to do some extra finalization
|
|
* work. Calls the contract's finalization function.
|
|
*/
|
|
function finalize() onlyOwner {
|
|
require(!isFinalized);
|
|
require(hasEnded());
|
|
|
|
finalization();
|
|
Finalized();
|
|
|
|
isFinalized = true;
|
|
}
|
|
|
|
/**
|
|
* @dev Can be overriden to add finalization logic. The overriding function
|
|
* should call super.finalization() to ensure the chain of finalization is
|
|
* executed entirely.
|
|
*/
|
|
function finalization() internal {
|
|
}
|
|
}
|
|
|