* Update to ganache-cli v6.1.0 and truffle v4.1.0 * Update to stable version of ganache-cli * fix: update event emission warning - Fix event emission warnings for solidity 4.21 after truffle has been updated to use this version * fix pr review comments * update to truffle v4.1.5 * update package-lock * add additional emit keywords * update solidity-coverage to 0.4.15 * update to solium 1.1.6 * fix MerkleProof coverage analysis by testing through wrapper * change version pragma to ^0.4.21 * fix solium linting errors
43 lines
961 B
Solidity
43 lines
961 B
Solidity
pragma solidity ^0.4.21;
|
|
|
|
import "../../math/SafeMath.sol";
|
|
import "../../ownership/Ownable.sol";
|
|
import "../validation/TimedCrowdsale.sol";
|
|
|
|
|
|
/**
|
|
* @title FinalizableCrowdsale
|
|
* @dev Extension of Crowdsale where an owner can do extra work
|
|
* after finishing.
|
|
*/
|
|
contract FinalizableCrowdsale is TimedCrowdsale, 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 public {
|
|
require(!isFinalized);
|
|
require(hasClosed());
|
|
|
|
finalization();
|
|
emit Finalized();
|
|
|
|
isFinalized = true;
|
|
}
|
|
|
|
/**
|
|
* @dev Can be overridden to add finalization logic. The overriding function
|
|
* should call super.finalization() to ensure the chain of finalization is
|
|
* executed entirely.
|
|
*/
|
|
function finalization() internal {
|
|
}
|
|
|
|
}
|