contract Powered is IPowered {
    /* storage */

    address private _powerSwitch;

    /* modifiers */

    modifier onlyOnline() {
        require(isOnline(), "Powered: is not online");
        _;
    }

    modifier onlyOffline() {
       require(isOffline(), "Powered: is not offline");
        _;
    }

    modifier notShutdown() {
        require(!isShutdown(), "Powered: is shutdown");
        _;
    }

    modifier onlyShutdown() {
        require(isShutdown(), "Powered: is not shutdown");
        _;
    }

    /* initializer */

    function _setPowerSwitch(address powerSwitch) internal {
        _powerSwitch = powerSwitch;
    }

    /* getter functions */

    function isOnline() public view override returns (bool status) {
        return IPowerSwitch(_powerSwitch).isOnline();
    }

    function isOffline() public view override returns (bool status) {
        return IPowerSwitch(_powerSwitch).isOffline();
    }

    function isShutdown() public view override returns (bool status) {
        return IPowerSwitch(_powerSwitch).isShutdown();
    }

    function getPowerSwitch() public view override returns (address powerSwitch) {
        return _powerSwitch;
    }

    function getPowerController() public view override returns (address controller) {
        return IPowerSwitch(_powerSwitch).getPowerController();
    }
}
/// @title Powered
/// @notice Helper for calling external PowerSwitch
function isOnline() public view override returns (bool status) {
    return IPowerSwitch(_powerSwitch).isOnline();
}

/* getter functions */