{"sources":{"src/Kicker.sol":{"content":"// SPDX-FileCopyrightText: © 2025 Dai Foundation <www.daifoundation.org>\n// SPDX-License-Identifier: AGPL-3.0-or-later\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program.  If not, see <https://www.gnu.org/licenses/>.\n\npragma solidity ^0.8.21;\n\ninterface VatLike {\n    function dai(address) external view returns (uint256);\n    function sin(address) external view returns (uint256);\n    function hope(address) external;\n    function suck(address, address, uint256) external;\n}\n\ninterface SplitterLike {\n    function vat() external view returns (VatLike);\n    function kick(uint256, uint256) external returns (uint256);\n}\n\ncontract Kicker {\n    // --- storage variables ---\n\n    mapping(address usr => uint256 allowed) public wards;\n    uint256 public kbump; // Fixed lot size [rad]\n    int256  public khump; // Flap threshold [rad]\n\n    // --- immutables ---\n\n    VatLike      public immutable vat;\n    address      public immutable vow;\n    SplitterLike public immutable splitter;\n\n    // --- constructor ---\n\n    constructor(address vow_, address splitter_) {\n        vow = vow_;\n        splitter = SplitterLike(splitter_);\n        vat = splitter.vat();\n        vat.hope(splitter_);\n\n        wards[msg.sender] = 1;\n        emit Rely(msg.sender);\n    }\n\n    // --- events ---\n\n    event Rely(address indexed usr);\n    event Deny(address indexed usr);\n    event File(bytes32 indexed what, uint256 data);\n    event File(bytes32 indexed what, int256 data);\n\n    // --- modifiers ---\n\n    modifier auth {\n        require(wards[msg.sender] == 1, \"Kicker/not-authorized\");\n        _;\n    }\n\n    // --- internals ---\n\n    function _toInt256(uint256 x) internal pure returns (int256 y) {\n        require(x <= uint256(type(int256).max), \"Kicker/overflow\");\n        y = int256(x);\n    }\n\n    // --- administration ---\n\n    function rely(address usr) external auth {\n        wards[usr] = 1;\n        emit Rely(usr);\n    }\n\n    function deny(address usr) external auth {\n        wards[usr] = 0;\n        emit Deny(usr);\n    }\n\n    function file(bytes32 what, uint256 data) external auth {\n        if (what == \"kbump\") {\n            kbump = data;\n        } else revert(\"Kicker/file-unrecognized-param\");\n        emit File(what, data);\n    }\n\n    function file(bytes32 what, int256 data) external auth {\n        if (what == \"khump\") {\n            khump = data;\n        } else revert(\"Kicker/file-unrecognized-param\");\n        emit File(what, data);\n    }\n\n    // --- execution ---\n\n    function flap() external returns (uint256 id) {\n        require(_toInt256(vat.dai(vow)) >= _toInt256(vat.sin(vow)) + _toInt256(kbump) + khump, \"Kicker/flap-threshold-not-reached\");\n        vat.suck(vow, address(this), kbump);\n        id = splitter.kick(kbump, 0);\n    }\n}\n"}},"matchId":"18982686","creationMatch":"match","runtimeMatch":"match","verifiedAt":"2026-02-16T12:41:21Z","match":"match","chainId":"1","address":"0xD889477102e8C4A857b78Fcc2f134535176Ec1Fc"}