visual-identity/contracts/democracy/DelegationProxyKernel.sol

30 lines
902 B
Solidity
Raw Normal View History

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