contract DssSpell {
    DSPauseAbstract public pause =
        DSPauseAbstract(0xbE286431454714F511008713973d3B053A2d38f3);
    address         public action;
    bytes32         public tag;
    uint256         public eta;
    bytes           public sig;
    uint256         public expiration;
    bool            public done;

    address constant ETHUSDv1 = 0x729D19f657BD0614b4985Cf1D82531c67569197B;

    // Provides a descriptive tag for bot consumption
    // This should be modified weekly to provide a summary of the actions
    // Hash: seth keccak -- "$(wget https://raw.githubusercontent.com/makerdao/community/9ba21e7f4106b184124a2f94a7ab2591c3446c64/governance/votes/Executive%20vote%20-%20September%2025%2C%202020.md -q -O - 2>/dev/null)"
    string constant public description =
        "2020-09-25 MakerDAO Executive Spell | Hash: 0x86cac34c2d63bd581cc36f7688f57c6005a6de0382903fe30179953d025c3450";

    constructor() public {
        sig = abi.encodeWithSignature("execute()");
        action = address(new SpellAction());
        bytes32 _tag;
        address _action = action;
        assembly { _tag := extcodehash(_action) }
        tag = _tag;
        expiration = now + 30 days;
    }

    // modifier officeHours {
    //     uint day = (now / 1 days + 3) % 7;
    //     require(day < 5, "Can only be cast on a weekday");
    //     uint hour = now / 1 hours % 24;
    //     require(hour >= 14 && hour < 21, "Outside office hours");
    //     _;
    // }

    function schedule() public {
        require(now <= expiration, "This contract has expired");
        require(eta == 0, "This spell has already been scheduled");
        eta = now + DSPauseAbstract(pause).delay();
        pause.plot(action, tag, sig, eta);

        // Set the ownership of the medianizer v1 to the pause proxy and remove the direct
        // access from the chief (this way it will need to pass via governance delay) and
        // can be executed during cast (coded in the SpellAction)
        MedianizerV1Abstract(ETHUSDv1).setOwner(pause.proxy());
        MedianizerV1Abstract(ETHUSDv1).setAuthority(address(0));
    }

    function cast() public /*officeHours*/ {
        require(!done, "spell-already-cast");
        done = true;
        pause.exec(action, tag, sig, eta);
    }
}
function schedule() public {
    require(now <= expiration, "This contract has expired");
    require(eta == 0, "This spell has already been scheduled");
    eta = now + DSPauseAbstract(pause).delay();
    pause.plot(action, tag, sig, eta);

    // Set the ownership of the medianizer v1 to the pause proxy and remove the direct
    // access from the chief (this way it will need to pass via governance delay) and
    // can be executed during cast (coded in the SpellAction)
    MedianizerV1Abstract(ETHUSDv1).setOwner(pause.proxy());
    MedianizerV1Abstract(ETHUSDv1).setAuthority(address(0));
}

// modifier officeHours {
//     uint day = (now / 1 days + 3) % 7;
//     require(day < 5, "Can only be cast on a weekday");
//     uint hour = now / 1 hours % 24;
//     require(hour >= 14 && hour < 21, "Outside office hours");
//     _;
// }