contract Oracle is Ownable, ExampleOracleSimple, IOracle {
    address debase;
    address public debasePolicy;
    uint256 constant SCALE = 10**18;
    address constant uniFactory = 0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f;

    constructor(
        address debase_,
        address DAI_,
        address debasePolicy_
    ) public ExampleOracleSimple(uniFactory, debase_, DAI_) {
        debase = debase_;
        debasePolicy = debasePolicy_;
    }

    /**
     * @notice Function that must be called before the very first rebase of debase protocol to get an accurate price.
     */
    function updateBeforeRebase() public onlyOwner {
        update();
    }

    /**
     * @notice Get a price data sample from the oralce. Can only be called by the debase policy.
     * @return The price and if the price if valid
     */
    function getData() external override returns (uint256, bool) {
        require(
            msg.sender == debasePolicy,
            "Only debase policy can get data from oracle"
        );
        update();
        uint256 price = consult(debase, SCALE); // will return 1 BASED in DAI

        if (price == 0) {
            return (0, false);
        }

        return (price, true);
    }
}
function updateBeforeRebase() public onlyOwner {
    update();
}

/**
 * @notice Function that must be called before the very first rebase of debase protocol to get an accurate price.
 */