{"file_path":"src/dao/Core.sol","creation_status":"success","source_code":"// SPDX-License-Identifier: MIT\npragma solidity 0.8.28;\n\nimport { IAuthHook } from '../interfaces/IAuthHook.sol';\nimport { Address } from '@openzeppelin/contracts/utils/Address.sol';\nimport { ReentrancyGuard } from \"@openzeppelin/contracts/utils/ReentrancyGuard.sol\";\n\n/**\n    @title Core\n    @author Resupply Finance (code inspired by Prisma Finance)\n    @notice Single source of truth for system-wide values and contract ownership.\n            Ownership of this contract should be the DAO via `Voting`.\n            Other ownable contracts inherit their ownership from this contract\n            using `Ownable`.\n */\ncontract Core is ReentrancyGuard {\n    using Address for address;\n\n    address public voter;\n\n    /// @notice The start time of the first epoch. To be referenced by other system contracts.\n    uint256 public immutable startTime;\n    \n    /// @notice Length of an epoch in seconds. To be referenced by other system contracts.\n    uint256 public immutable epochLength;\n\n    // permission for callers to execute arbitrary calls via this contract's `execute` function\n    mapping(address caller => mapping(address target => mapping(bytes4 selector => OperatorAuth auth))) public operatorPermissions;\n\n    event VoterSet(address indexed newVoter);\n    event OperatorExecuted(address indexed caller, address indexed target, bytes data);\n    event OperatorSet(address indexed caller, address indexed target, bool authorized, bytes4 selector, IAuthHook authHook);\n\n    struct OperatorAuth {\n        bool authorized;\n        IAuthHook hook;\n    }\n\n    modifier onlyCore() {\n        require(msg.sender == address(this), \"!core\");\n        _;\n    }\n\n    constructor(address _voter, uint256 _epochLength) {\n        require(_epochLength > 0, \"Epoch length must be greater than 0\");\n        require(_epochLength <= 100 days, \"Epoch length must be less than 100 days\");\n        startTime = (block.timestamp / _epochLength) * _epochLength;\n        epochLength = _epochLength;\n        voter = _voter;\n        emit VoterSet(_voter);\n    }\n\n    /**\n        @notice Execute an arbitrary function call using this contract\n        @dev Callable via the voter, or any operator with explicit permission.       \n     */\n    function execute(address target, bytes calldata data) external nonReentrant returns (bytes memory) {\n        if (msg.sender == voter) return target.functionCall(data);\n        bytes4 selector = bytes4(data[:4]);\n        OperatorAuth memory auth = operatorPermissions[msg.sender][address(0)][selector];\n        if (!auth.authorized) {\n            auth = operatorPermissions[msg.sender][target][selector];\n        }\n        require(auth.authorized, \"!authorized\");\n        if (auth.hook != IAuthHook(address(0))) require(auth.hook.preHook(msg.sender, target, data), \"Auth PreHook Failed\");\n        bytes memory result = target.functionCall(data);\n        if (auth.hook != IAuthHook(address(0))) require(auth.hook.postHook(result, msg.sender, target, data), \"Auth PostHook Failed\");\n        emit OperatorExecuted(msg.sender, target, data);\n        return result;\n    }\n\n    /**\n        @notice Grant or revoke permission for `caller` to call one or more\n                functions on `target` via this contract.\n        @param caller The address to grant or revoke permission for\n        @param target The address which the caller is being granted permission to call (0x0 for global)\n        @param selector The 4 bytes selector to grant or revoke permission for\n        @param authorized Whether to grant or revoke permission\n        @param authHook The hook to use for the permission\n        @dev Setting `target` to the zero address allows for global authorization of\n             `caller` to use `selector` on any target.\n     */\n    function setOperatorPermissions(\n        address caller,\n        address target,\n        bytes4 selector,\n        bool authorized,\n        IAuthHook authHook\n    ) onlyCore external {\n        operatorPermissions[caller][target][selector] = OperatorAuth(authorized, authHook);\n        emit OperatorSet(caller, target, authorized, selector, authHook);\n    }\n\n    function setVoter(address newVoter) external onlyCore {\n        voter = newVoter;\n        emit VoterSet(newVoter);\n    }\n}","deployed_bytecode":"0x60806040526004361015610011575f80fd5b5f3560e01c80631cff79cd1461030357806346c96aac146102db5780634bc2a6571461027257806357d775f8146102385780635fc140c21461012257806378e97925146100e85763a9b09e0414610066575f80fd5b346100e45760603660031901126100e45761007f6103a2565b6100876103b8565b61008f6103f2565b6001600160a01b039283165f90815260026020908152604080832094861683529381528382206001600160e01b0319909316825291825282902054825160ff82161515815260089190911c9093169083015290f35b5f80fd5b346100e4575f3660031901126100e45760206040517f0000000000000000000000000000000000000000000000000000000067d220008152f35b346100e45760a03660031901126100e45761013b6103a2565b6101436103b8565b9061014c6103f2565b91606435928315158094036100e4576084356001600160a01b03811692908390036100e4577fea1c80a55152994df103f78d348a42089784a75528faa5b2c312d7cf8b886d6d926060926101a13033146108a5565b6040516101ad81610409565b87815260208082018481526001600160a01b039889165f81815260028452604080822098909b168082529784528a81206001600160e01b03199096168082529584528a90209351845492516001600160a81b031990931660ff911515919091161760089290921b610100600160a81b03169190911790925587519889528801919091529486015293a3005b346100e4575f3660031901126100e45760206040517f0000000000000000000000000000000000000000000000000000000000093a808152f35b346100e45760203660031901126100e45761028b6103a2565b6102963033146108a5565b600180546001600160a01b0319166001600160a01b039290921691821790557f5bb4a0f5a67f7c49cfc7820adfab4690a3752cf969544ddd8445b970d3643e895f80a2005b346100e4575f3660031901126100e4576001546040516001600160a01b039091168152602090f35b346100e45760403660031901126100e45761031c6103a2565b60243567ffffffffffffffff81116100e457366023820112156100e457806004013567ffffffffffffffff81116100e45736602482840101116100e45760025f54146103935761038f9260246103779360025f5501906104e5565b60015f556040519182916020835260208301906103ce565b0390f35b633ee5aeb560e01b5f5260045ffd5b600435906001600160a01b03821682036100e457565b602435906001600160a01b03821682036100e457565b805180835260209291819084018484015e5f828201840152601f01601f1916010190565b604435906001600160e01b0319821682036100e457565b6040810190811067ffffffffffffffff82111761042557604052565b634e487b7160e01b5f52604160045260245ffd5b90601f8019910116810190811067ffffffffffffffff82111761042557604052565b67ffffffffffffffff811161042557601f01601f191660200190565b9291926104838261045b565b916104916040519384610439565b8294818452818301116100e4578281602093845f960137010152565b908160209103126100e4575180151581036100e45790565b908060209392818452848401375f828201840152601f01601f1916010190565b9160018060a01b0360015416331461085157806004116100e45763ffffffff60e01b823516335f52600260205260405f205f805260205260405f20815f5260205260405f20906040519161053883610409565b5460ff8116158015845260089190911c6001600160a01b031660208401526107fa575b508051156107c75760200180519093906001600160a01b03168061070f575b506105c45f8061058b368688610477565b60208151910182865af13d15610707573d906105a68261045b565b916105b46040519384610439565b82523d5f602084013e5b836108d9565b93516001600160a01b031680610620575b5061061a7f5e3a972e07d6d642599af6cd261298ed0094480c2ed57edcb55d616f8666943c916040519182916020835260018060a01b031695339560208401916104c5565b0390a390565b602060405180926309c2b73760e41b825260806004830152815f8161067361064b608483018d6103ce565b3360248401526001600160a01b038a1660448401528281036003190160648401528a8c6104c5565b03925af19081156106fc575f916106cd575b5015610691575f6105d5565b60405162461bcd60e51b8152602060048201526014602482015273105d5d1a08141bdcdd121bdbdac811985a5b195960621b6044820152606490fd5b6106ef915060203d6020116106f5575b6106e78183610439565b8101906104ad565b5f610685565b503d6106dd565b6040513d5f823e3d90fd5b6060906105be565b604051633329cc1760e11b81523360048201526001600160a01b038316602482015260606044820152906020908290815f8161074f606482018a8c6104c5565b03925af19081156106fc575f916107a8575b501561076d575f61057a565b60405162461bcd60e51b8152602060048201526013602482015272105d5d1a08141c99521bdbdac811985a5b1959606a1b6044820152606490fd5b6107c1915060203d6020116106f5576106e78183610439565b5f610761565b60405162461bcd60e51b815260206004820152600b60248201526a08585d5d1a1bdc9a5e995960aa1b6044820152606490fd5b9050335f52600260205260405f2060018060a01b0385165f5260205260405f20905f5260205260405f206040519061083182610409565b5460ff81161515825260081c6001600160a01b031660208201525f61055b565b5f61086361089a949382933691610477565b60208151910182855af13d1561089d573d9161087e8361045b565b9261088c6040519485610439565b83523d5f602085013e6108d9565b90565b6060916108d9565b156108ac57565b60405162461bcd60e51b815260206004820152600560248201526421636f726560d81b6044820152606490fd5b906108fd57508051156108ee57805190602001fd5b63d6bda27560e01b5f5260045ffd5b8151158061092e575b61090e575090565b639996b31560e01b5f9081526001600160a01b0391909116600452602490fd5b50803b1561090656fea164736f6c634300081c000a","optimization_enabled":true,"verified_twin_address_hash":null,"is_verified":true,"compiler_settings":{"evmVersion":"cancun","libraries":{},"metadata":{"bytecodeHash":"none"},"optimizer":{"enabled":true,"runs":200},"remappings":[":@axelar-network/=node_modules/@axelar-network/",":@chainlink/=node_modules/@chainlink/",":@eth-optimism/=node_modules/@eth-optimism/",":@layerzerolabs/=node_modules/@layerzerolabs/",":@mean-finance/=node_modules/@mean-finance/",":@openzeppelin/=node_modules/@openzeppelin/",":@rari-capital/=node_modules/@rari-capital/",":@uniswap/=node_modules/@uniswap/",":base64-sol/=node_modules/base64-sol/",":ds-test/=node_modules/ds-test/src/",":forge-std/=node_modules/forge-std/src/",":frax-standard-solidity/=node_modules/frax-standard-solidity/",":frax-std/=node_modules/frax-standard-solidity/src/",":hardhat-deploy/=node_modules/hardhat-deploy/",":hardhat/=node_modules/hardhat/",":solidity-bytes-utils/=node_modules/solidity-bytes-utils/",":solidity-stringutils/=lib/surl/lib/solidity-stringutils/",":surl/=lib/surl/"],"viaIR":true},"optimization_runs":200,"sourcify_repo_url":"https://repo.sourcify.dev/contracts/partial_match/1/0xc07e000044F95655c11fda4cD37F70A94d7e0a7d/","decoded_constructor_args":[["0xFE11a5009f2121622271e7dd0FD470264e076af6",{"internalType":"address","name":"_voter","type":"address"}],["604800",{"internalType":"uint256","name":"_epochLength","type":"uint256"}]],"compiler_version":"0.8.28+commit.7893614a","is_verified_via_verifier_alliance":false,"verified_at":"2025-05-31T19:23:01.306456Z","implementations":[],"proxy_type":null,"external_libraries":[],"creation_bytecode":"0x60c03461019557601f610af238819003918201601f19168301916001600160401b038311848410176101995780849260409485528339810103126101955780516001600160a01b0381169190829003610195576020015160015f558015610144576283d60081116100ef57804204818102908082048314901517156100db5760805260a052600180546001600160a01b03191682179055604051907f5bb4a0f5a67f7c49cfc7820adfab4690a3752cf969544ddd8445b970d3643e895f80a261094490816101ae82396080518160ff015260a0518161024f0152f35b634e487b7160e01b5f52601160045260245ffd5b60405162461bcd60e51b815260206004820152602760248201527f45706f6368206c656e677468206d757374206265206c657373207468616e20316044820152663030206461797360c81b6064820152608490fd5b60405162461bcd60e51b815260206004820152602360248201527f45706f6368206c656e677468206d75737420626520677265617465722074686160448201526206e20360ec1b6064820152608490fd5b5f80fd5b634e487b7160e01b5f52604160045260245ffdfe60806040526004361015610011575f80fd5b5f3560e01c80631cff79cd1461030357806346c96aac146102db5780634bc2a6571461027257806357d775f8146102385780635fc140c21461012257806378e97925146100e85763a9b09e0414610066575f80fd5b346100e45760603660031901126100e45761007f6103a2565b6100876103b8565b61008f6103f2565b6001600160a01b039283165f90815260026020908152604080832094861683529381528382206001600160e01b0319909316825291825282902054825160ff82161515815260089190911c9093169083015290f35b5f80fd5b346100e4575f3660031901126100e45760206040517f00000000000000000000000000000000000000000000000000000000000000008152f35b346100e45760a03660031901126100e45761013b6103a2565b6101436103b8565b9061014c6103f2565b91606435928315158094036100e4576084356001600160a01b03811692908390036100e4577fea1c80a55152994df103f78d348a42089784a75528faa5b2c312d7cf8b886d6d926060926101a13033146108a5565b6040516101ad81610409565b87815260208082018481526001600160a01b039889165f81815260028452604080822098909b168082529784528a81206001600160e01b03199096168082529584528a90209351845492516001600160a81b031990931660ff911515919091161760089290921b610100600160a81b03169190911790925587519889528801919091529486015293a3005b346100e4575f3660031901126100e45760206040517f00000000000000000000000000000000000000000000000000000000000000008152f35b346100e45760203660031901126100e45761028b6103a2565b6102963033146108a5565b600180546001600160a01b0319166001600160a01b039290921691821790557f5bb4a0f5a67f7c49cfc7820adfab4690a3752cf969544ddd8445b970d3643e895f80a2005b346100e4575f3660031901126100e4576001546040516001600160a01b039091168152602090f35b346100e45760403660031901126100e45761031c6103a2565b60243567ffffffffffffffff81116100e457366023820112156100e457806004013567ffffffffffffffff81116100e45736602482840101116100e45760025f54146103935761038f9260246103779360025f5501906104e5565b60015f556040519182916020835260208301906103ce565b0390f35b633ee5aeb560e01b5f5260045ffd5b600435906001600160a01b03821682036100e457565b602435906001600160a01b03821682036100e457565b805180835260209291819084018484015e5f828201840152601f01601f1916010190565b604435906001600160e01b0319821682036100e457565b6040810190811067ffffffffffffffff82111761042557604052565b634e487b7160e01b5f52604160045260245ffd5b90601f8019910116810190811067ffffffffffffffff82111761042557604052565b67ffffffffffffffff811161042557601f01601f191660200190565b9291926104838261045b565b916104916040519384610439565b8294818452818301116100e4578281602093845f960137010152565b908160209103126100e4575180151581036100e45790565b908060209392818452848401375f828201840152601f01601f1916010190565b9160018060a01b0360015416331461085157806004116100e45763ffffffff60e01b823516335f52600260205260405f205f805260205260405f20815f5260205260405f20906040519161053883610409565b5460ff8116158015845260089190911c6001600160a01b031660208401526107fa575b508051156107c75760200180519093906001600160a01b03168061070f575b506105c45f8061058b368688610477565b60208151910182865af13d15610707573d906105a68261045b565b916105b46040519384610439565b82523d5f602084013e5b836108d9565b93516001600160a01b031680610620575b5061061a7f5e3a972e07d6d642599af6cd261298ed0094480c2ed57edcb55d616f8666943c916040519182916020835260018060a01b031695339560208401916104c5565b0390a390565b602060405180926309c2b73760e41b825260806004830152815f8161067361064b608483018d6103ce565b3360248401526001600160a01b038a1660448401528281036003190160648401528a8c6104c5565b03925af19081156106fc575f916106cd575b5015610691575f6105d5565b60405162461bcd60e51b8152602060048201526014602482015273105d5d1a08141bdcdd121bdbdac811985a5b195960621b6044820152606490fd5b6106ef915060203d6020116106f5575b6106e78183610439565b8101906104ad565b5f610685565b503d6106dd565b6040513d5f823e3d90fd5b6060906105be565b604051633329cc1760e11b81523360048201526001600160a01b038316602482015260606044820152906020908290815f8161074f606482018a8c6104c5565b03925af19081156106fc575f916107a8575b501561076d575f61057a565b60405162461bcd60e51b8152602060048201526013602482015272105d5d1a08141c99521bdbdac811985a5b1959606a1b6044820152606490fd5b6107c1915060203d6020116106f5576106e78183610439565b5f610761565b60405162461bcd60e51b815260206004820152600b60248201526a08585d5d1a1bdc9a5e995960aa1b6044820152606490fd5b9050335f52600260205260405f2060018060a01b0385165f5260205260405f20905f5260205260405f206040519061083182610409565b5460ff81161515825260081c6001600160a01b031660208201525f61055b565b5f61086361089a949382933691610477565b60208151910182855af13d1561089d573d9161087e8361045b565b9261088c6040519485610439565b83523d5f602085013e6108d9565b90565b6060916108d9565b156108ac57565b60405162461bcd60e51b815260206004820152600560248201526421636f726560d81b6044820152606490fd5b906108fd57508051156108ee57805190602001fd5b63d6bda27560e01b5f5260045ffd5b8151158061092e575b61090e575090565b639996b31560e01b5f9081526001600160a01b0391909116600452602490fd5b50803b1561090656fea164736f6c634300081c000a000000000000000000000000fe11a5009f2121622271e7dd0fd470264e076af60000000000000000000000000000000000000000000000000000000000093a80","name":"Core","is_blueprint":false,"license_type":"none","is_fully_verified":false,"is_verified_via_eth_bytecode_db":true,"language":"solidity","evm_version":"cancun","can_be_visualized_via_sol2uml":true,"is_verified_via_sourcify":true,"additional_sources":[{"file_path":"node_modules/@openzeppelin/contracts/utils/Address.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/Address.sol)\n\npragma solidity ^0.8.20;\n\nimport {Errors} from \"./Errors.sol\";\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary Address {\n    /**\n     * @dev There's no code at `target` (it is not a contract).\n     */\n    error AddressEmptyCode(address target);\n\n    /**\n     * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n     * `recipient`, forwarding all available gas and reverting on errors.\n     *\n     * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n     * of certain opcodes, possibly making contracts go over the 2300 gas limit\n     * imposed by `transfer`, making them unable to receive funds via\n     * `transfer`. {sendValue} removes this limitation.\n     *\n     * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n     *\n     * IMPORTANT: because control is transferred to `recipient`, care must be\n     * taken to not create reentrancy vulnerabilities. Consider using\n     * {ReentrancyGuard} or the\n     * https://solidity.readthedocs.io/en/v0.8.20/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n     */\n    function sendValue(address payable recipient, uint256 amount) internal {\n        if (address(this).balance < amount) {\n            revert Errors.InsufficientBalance(address(this).balance, amount);\n        }\n\n        (bool success, ) = recipient.call{value: amount}(\"\");\n        if (!success) {\n            revert Errors.FailedCall();\n        }\n    }\n\n    /**\n     * @dev Performs a Solidity function call using a low level `call`. A\n     * plain `call` is an unsafe replacement for a function call: use this\n     * function instead.\n     *\n     * If `target` reverts with a revert reason or custom error, it is bubbled\n     * up by this function (like regular Solidity function calls). However, if\n     * the call reverted with no returned reason, this function reverts with a\n     * {Errors.FailedCall} error.\n     *\n     * Returns the raw returned data. To convert to the expected return value,\n     * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n     *\n     * Requirements:\n     *\n     * - `target` must be a contract.\n     * - calling `target` with `data` must not revert.\n     */\n    function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n        return functionCallWithValue(target, data, 0);\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n     * but also transferring `value` wei to `target`.\n     *\n     * Requirements:\n     *\n     * - the calling contract must have an ETH balance of at least `value`.\n     * - the called Solidity function must be `payable`.\n     */\n    function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {\n        if (address(this).balance < value) {\n            revert Errors.InsufficientBalance(address(this).balance, value);\n        }\n        (bool success, bytes memory returndata) = target.call{value: value}(data);\n        return verifyCallResultFromTarget(target, success, returndata);\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n     * but performing a static call.\n     */\n    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\n        (bool success, bytes memory returndata) = target.staticcall(data);\n        return verifyCallResultFromTarget(target, success, returndata);\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n     * but performing a delegate call.\n     */\n    function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\n        (bool success, bytes memory returndata) = target.delegatecall(data);\n        return verifyCallResultFromTarget(target, success, returndata);\n    }\n\n    /**\n     * @dev Tool to verify that a low level call to smart-contract was successful, and reverts if the target\n     * was not a contract or bubbling up the revert reason (falling back to {Errors.FailedCall}) in case\n     * of an unsuccessful call.\n     */\n    function verifyCallResultFromTarget(\n        address target,\n        bool success,\n        bytes memory returndata\n    ) internal view returns (bytes memory) {\n        if (!success) {\n            _revert(returndata);\n        } else {\n            // only check if target is a contract if the call was successful and the return data is empty\n            // otherwise we already know that it was a contract\n            if (returndata.length == 0 && target.code.length == 0) {\n                revert AddressEmptyCode(target);\n            }\n            return returndata;\n        }\n    }\n\n    /**\n     * @dev Tool to verify that a low level call was successful, and reverts if it wasn't, either by bubbling the\n     * revert reason or with a default {Errors.FailedCall} error.\n     */\n    function verifyCallResult(bool success, bytes memory returndata) internal pure returns (bytes memory) {\n        if (!success) {\n            _revert(returndata);\n        } else {\n            return returndata;\n        }\n    }\n\n    /**\n     * @dev Reverts with returndata if present. Otherwise reverts with {Errors.FailedCall}.\n     */\n    function _revert(bytes memory returndata) private pure {\n        // Look for revert reason and bubble it up if present\n        if (returndata.length > 0) {\n            // The easiest way to bubble the revert reason is using memory via assembly\n            assembly (\"memory-safe\") {\n                let returndata_size := mload(returndata)\n                revert(add(32, returndata), returndata_size)\n            }\n        } else {\n            revert Errors.FailedCall();\n        }\n    }\n}\n"},{"file_path":"node_modules/@openzeppelin/contracts/utils/Errors.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/Errors.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Collection of common custom errors used in multiple contracts\n *\n * IMPORTANT: Backwards compatibility is not guaranteed in future versions of the library.\n * It is recommended to avoid relying on the error API for critical functionality.\n *\n * _Available since v5.1._\n */\nlibrary Errors {\n    /**\n     * @dev The ETH balance of the account is not enough to perform the operation.\n     */\n    error InsufficientBalance(uint256 balance, uint256 needed);\n\n    /**\n     * @dev A call to an address target failed. The target may have reverted.\n     */\n    error FailedCall();\n\n    /**\n     * @dev The deployment failed.\n     */\n    error FailedDeployment();\n\n    /**\n     * @dev A necessary precompile is missing.\n     */\n    error MissingPrecompile(address);\n}\n"},{"file_path":"node_modules/@openzeppelin/contracts/utils/ReentrancyGuard.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/ReentrancyGuard.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Contract module that helps prevent reentrant calls to a function.\n *\n * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier\n * available, which can be applied to functions to make sure there are no nested\n * (reentrant) calls to them.\n *\n * Note that because there is a single `nonReentrant` guard, functions marked as\n * `nonReentrant` may not call one another. This can be worked around by making\n * those functions `private`, and then adding `external` `nonReentrant` entry\n * points to them.\n *\n * TIP: If EIP-1153 (transient storage) is available on the chain you're deploying at,\n * consider using {ReentrancyGuardTransient} instead.\n *\n * TIP: If you would like to learn more about reentrancy and alternative ways\n * to protect against it, check out our blog post\n * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].\n */\nabstract contract ReentrancyGuard {\n    // Booleans are more expensive than uint256 or any type that takes up a full\n    // word because each write operation emits an extra SLOAD to first read the\n    // slot's contents, replace the bits taken up by the boolean, and then write\n    // back. This is the compiler's defense against contract upgrades and\n    // pointer aliasing, and it cannot be disabled.\n\n    // The values being non-zero value makes deployment a bit more expensive,\n    // but in exchange the refund on every call to nonReentrant will be lower in\n    // amount. Since refunds are capped to a percentage of the total\n    // transaction's gas, it is best to keep them low in cases like this one, to\n    // increase the likelihood of the full refund coming into effect.\n    uint256 private constant NOT_ENTERED = 1;\n    uint256 private constant ENTERED = 2;\n\n    uint256 private _status;\n\n    /**\n     * @dev Unauthorized reentrant call.\n     */\n    error ReentrancyGuardReentrantCall();\n\n    constructor() {\n        _status = NOT_ENTERED;\n    }\n\n    /**\n     * @dev Prevents a contract from calling itself, directly or indirectly.\n     * Calling a `nonReentrant` function from another `nonReentrant`\n     * function is not supported. It is possible to prevent this from happening\n     * by making the `nonReentrant` function external, and making it call a\n     * `private` function that does the actual work.\n     */\n    modifier nonReentrant() {\n        _nonReentrantBefore();\n        _;\n        _nonReentrantAfter();\n    }\n\n    function _nonReentrantBefore() private {\n        // On the first call to nonReentrant, _status will be NOT_ENTERED\n        if (_status == ENTERED) {\n            revert ReentrancyGuardReentrantCall();\n        }\n\n        // Any calls to nonReentrant after this point will fail\n        _status = ENTERED;\n    }\n\n    function _nonReentrantAfter() private {\n        // By storing the original value once again, a refund is triggered (see\n        // https://eips.ethereum.org/EIPS/eip-2200)\n        _status = NOT_ENTERED;\n    }\n\n    /**\n     * @dev Returns true if the reentrancy guard is currently set to \"entered\", which indicates there is a\n     * `nonReentrant` function in the call stack.\n     */\n    function _reentrancyGuardEntered() internal view returns (bool) {\n        return _status == ENTERED;\n    }\n}\n"},{"file_path":"src/interfaces/IAuthHook.sol","source_code":"// SPDX-License-Identifier: MIT\npragma solidity 0.8.28;\n\ninterface IAuthHook {\n    function preHook(address operator, address target, bytes calldata data) external returns (bool);\n    function postHook(bytes memory result, address operator, address target, bytes calldata data) external returns (bool);\n}\n"}],"certified":false,"conflicting_implementations":null,"abi":[{"inputs":[{"internalType":"address","name":"_voter","type":"address"},{"internalType":"uint256","name":"_epochLength","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"address","name":"target","type":"address"}],"name":"AddressEmptyCode","type":"error"},{"inputs":[],"name":"FailedCall","type":"error"},{"inputs":[{"internalType":"uint256","name":"balance","type":"uint256"},{"internalType":"uint256","name":"needed","type":"uint256"}],"name":"InsufficientBalance","type":"error"},{"inputs":[],"name":"ReentrancyGuardReentrantCall","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"caller","type":"address"},{"indexed":true,"internalType":"address","name":"target","type":"address"},{"indexed":false,"internalType":"bytes","name":"data","type":"bytes"}],"name":"OperatorExecuted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"caller","type":"address"},{"indexed":true,"internalType":"address","name":"target","type":"address"},{"indexed":false,"internalType":"bool","name":"authorized","type":"bool"},{"indexed":false,"internalType":"bytes4","name":"selector","type":"bytes4"},{"indexed":false,"internalType":"contract IAuthHook","name":"authHook","type":"address"}],"name":"OperatorSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"newVoter","type":"address"}],"name":"VoterSet","type":"event"},{"inputs":[],"name":"epochLength","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"target","type":"address"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"execute","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"caller","type":"address"},{"internalType":"address","name":"target","type":"address"},{"internalType":"bytes4","name":"selector","type":"bytes4"}],"name":"operatorPermissions","outputs":[{"internalType":"bool","name":"authorized","type":"bool"},{"internalType":"contract IAuthHook","name":"hook","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"caller","type":"address"},{"internalType":"address","name":"target","type":"address"},{"internalType":"bytes4","name":"selector","type":"bytes4"},{"internalType":"bool","name":"authorized","type":"bool"},{"internalType":"contract IAuthHook","name":"authHook","type":"address"}],"name":"setOperatorPermissions","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newVoter","type":"address"}],"name":"setVoter","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"startTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"voter","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"}],"is_changed_bytecode":false,"is_partially_verified":true,"constructor_args":"0x000000000000000000000000fe11a5009f2121622271e7dd0fd470264e076af60000000000000000000000000000000000000000000000000000000000093a80"}