2018-03-30 05:31:08 +00:00
|
|
|
pragma solidity ^0.4.21;
|
2018-03-11 15:12:50 +00:00
|
|
|
|
|
|
|
import "./InstanceStorage.sol";
|
|
|
|
import "./DelegatedCall.sol";
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @title Instance
|
|
|
|
* @author Ricardo Guilherme Schmidt (Status Research & Development GmbH)
|
|
|
|
* @dev Contract that forward everything through delegatecall to defined kernel
|
|
|
|
*/
|
|
|
|
contract Instance is InstanceStorage, DelegatedCall {
|
|
|
|
|
2018-05-13 05:47:51 +00:00
|
|
|
constructor(address _kernel) public {
|
2018-03-11 15:12:50 +00:00
|
|
|
kernel = _kernel;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @dev delegatecall everything (but declared functions) to `_target()`
|
|
|
|
* @notice Verify `kernel()` code to predict behavior
|
|
|
|
*/
|
|
|
|
function () external delegated {
|
|
|
|
//all goes to kernel
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @dev returns kernel if kernel that is configured
|
|
|
|
* @return kernel address
|
|
|
|
*/
|
|
|
|
function targetDelegatedCall()
|
|
|
|
internal
|
2018-03-30 05:31:08 +00:00
|
|
|
view
|
2018-03-11 15:12:50 +00:00
|
|
|
returns(address)
|
|
|
|
{
|
|
|
|
return kernel;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|