topic-democracy/contracts/democracy/DelegationProxyKernel.sol

30 lines
917 B
Solidity
Raw Normal View History

2018-03-27 23:15:36 -03:00
pragma solidity ^0.4.21;
2017-11-28 01:33:25 -02:00
2018-03-27 23:15:36 -03:00
import "../deploy/InstanceStorage.sol";
import "./DelegationProxyView.sol";
2017-11-28 01:33:25 -02:00
/**
2018-03-27 23:15:36 -03:00
* @title DelegationProxyKernel
2017-11-28 01:33:25 -02:00
* @author Ricardo Guilherme Schmidt (Status Research & Development GmbH)
* @dev Creates a delegation proxy killable model for cheap redeploy and upgradability.
*/
2018-03-27 23:15:36 -03:00
contract DelegationProxyKernel is InstanceStorage, DelegationProxyView {
bool private ready = false; //TODO: abstract initialized flag
2017-11-28 01:33:25 -02:00
/**
* @notice Constructor of the model - only knows about watchdog that can trigger upgrade
*/
2018-03-27 23:15:36 -03:00
function DelegationProxyKernel() DelegationProxy(0x0) public {
ready = true;
2017-11-28 01:33:25 -02:00
}
/**
* @notice Creates a new DelegationProxy with `_parentProxy` as default delegation.
*/
2018-03-27 23:15:36 -03:00
function initializeDelegationProxy(address _parentProxy) public {
2017-11-28 01:33:25 -02:00
require(!ready);
ready = true;
parentProxy = _parentProxy;
}
}