96cad7de9c
* tests: reorganize testing packages * gitignore and minor changes
22 lines
633 B
Solidity
22 lines
633 B
Solidity
pragma solidity ^0.4.24;
|
|
|
|
import "./Initializable.sol";
|
|
|
|
|
|
contract Petrifiable is Initializable {
|
|
// Use block UINT256_MAX (which should be never) as the initializable date
|
|
uint256 internal constant PETRIFIED_BLOCK = uint256(-1);
|
|
|
|
function isPetrified() public view returns (bool) {
|
|
return getInitializationBlock() == PETRIFIED_BLOCK;
|
|
}
|
|
|
|
/**
|
|
* @dev Function to be called by top level contract to prevent being initialized.
|
|
* Useful for freezing base contracts when they're used behind proxies.
|
|
*/
|
|
function petrify() internal onlyInit {
|
|
initializedAt(PETRIFIED_BLOCK);
|
|
}
|
|
}
|