solidity/test/compilationTests/zeppelin/crowdsale/FinalizableCrowdsale.sol

40 lines
825 B
Solidity
Raw Normal View History

2017-07-05 10:28:15 +00:00
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. By default, it will end token minting.
*/
contract FinalizableCrowdsale is Crowdsale, Ownable {
using SafeMath for uint256;
bool public isFinalized = false;
event Finalized();
// should be called after crowdsale ends, to do
// some extra finalization work
function finalize() onlyOwner {
require(!isFinalized);
require(hasEnded());
finalization();
Finalized();
isFinalized = true;
}
// end token minting on finalization
// override this with custom logic if needed
function finalization() internal {
token.finishMinting();
}
}