2018-05-13 05:47:51 +00:00
|
|
|
pragma solidity ^0.4.23;
|
2018-02-28 04:36:48 +00:00
|
|
|
|
|
|
|
import "./Instance.sol";
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @title UpdatableInstance
|
|
|
|
* @author Ricardo Guilherme Schmidt (Status Research & Development GmbH)
|
|
|
|
* @dev Contract that can be updated by a call from itself.
|
|
|
|
*/
|
|
|
|
contract UpdatableInstance is Instance {
|
|
|
|
|
2018-02-28 15:47:59 +00:00
|
|
|
event InstanceUpdated(address oldKernel, address newKernel);
|
|
|
|
|
2018-05-13 05:47:51 +00:00
|
|
|
constructor(address _kernel)
|
2018-02-28 04:36:48 +00:00
|
|
|
Instance(_kernel)
|
|
|
|
public
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
function updateUpdatableInstance(address _kernel) external {
|
|
|
|
require(msg.sender == address(this));
|
2018-05-13 09:17:39 +00:00
|
|
|
emit InstanceUpdated(kernel, _kernel);
|
2018-02-28 04:36:48 +00:00
|
|
|
kernel = _kernel;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|