mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
40 lines
830 B
Solidity
40 lines
830 B
Solidity
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();
|
|
emit Finalized();
|
|
|
|
isFinalized = true;
|
|
}
|
|
|
|
// end token minting on finalization
|
|
// override this with custom logic if needed
|
|
function finalization() internal {
|
|
token.finishMinting();
|
|
}
|
|
|
|
|
|
|
|
}
|