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

40 lines
833 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
2018-07-04 17:20:51 +00:00
function finalize() public onlyOwner {
2017-07-05 10:28:15 +00:00
require(!isFinalized);
require(hasEnded());
finalization();
2018-06-27 08:35:38 +00:00
emit Finalized();
2017-07-05 10:28:15 +00:00
isFinalized = true;
}
// end token minting on finalization
// override this with custom logic if needed
function finalization() internal {
token.finishMinting();
}
}