{"file_path":"src/SubProxy.sol","creation_status":"success","source_code":"// SPDX-FileCopyrightText: © 2023 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/>.\npragma solidity =0.8.19;\n\n/**\n * @title SubProxy: the SubDAO-level `PauseProxy`.\n * @dev This proxy uses `delegatecall` to execute calls from context isolated from the main governance contract.\n * Contracts that must be controlled by SubDAO governance must authorize the `SubProxy` contract instead of the\n * governance contract itself.\n * @author @amusingaxl\n */\ncontract SubProxy {\n    /// @notice Addresses with owner access on this contract. `wards[usr]`\n    mapping(address => uint256) public wards;\n\n    /**\n     * @notice `usr` was granted owner access.\n     * @param usr The user address.\n     */\n    event Rely(address indexed usr);\n    /**\n     * @notice `usr` owner access was revoked.\n     * @param usr The user address.\n     */\n    event Deny(address indexed usr);\n\n    modifier auth() {\n        require(wards[msg.sender] == 1, \"SubProxy/not-authorized\");\n        _;\n    }\n\n    constructor() {\n        wards[msg.sender] = 1;\n        emit Rely(msg.sender);\n    }\n\n    /**\n     * @notice Grants `usr` admin access to this contract.\n     * @param usr The user address.\n     */\n    function rely(address usr) external auth {\n        wards[usr] = 1;\n        emit Rely(usr);\n    }\n\n    /**\n     * @notice Revokes `usr` admin access from this contract.\n     * @param usr The user address.\n     */\n    function deny(address usr) external auth {\n        wards[usr] = 0;\n        emit Deny(usr);\n    }\n\n    /**\n     * @notice Executes a calldata-encoded call `args` in the context of `target`.\n     * @param target The target contract.\n     * @param args The calldata-encoded call.\n     * @return out The result of the execution.\n     */\n    function exec(address target, bytes calldata args) external payable auth returns (bytes memory out) {\n        bool ok;\n        (ok, out) = target.delegatecall(args);\n        require(ok, \"SubProxy/delegatecall-error\");\n    }\n}\n","deployed_bytecode":"0x60806040526004361061003f5760003560e01c806365fae35e146100445780639c52a7f11461006d578063be6002c214610096578063bf353dbb146100c6575b600080fd5b34801561005057600080fd5b5061006b600480360381019061006691906104d6565b610103565b005b34801561007957600080fd5b50610094600480360381019061008f91906104d6565b61020e565b005b6100b060048036038101906100ab9190610568565b610319565b6040516100bd9190610658565b60405180910390f35b3480156100d257600080fd5b506100ed60048036038101906100e891906104d6565b610456565b6040516100fa9190610693565b60405180910390f35b60016000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414610184576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161017b9061070b565b60405180910390fd5b60016000808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508073ffffffffffffffffffffffffffffffffffffffff167fdd0e34038ac38b2a1ce960229778ac48a8719bc900b6c4f8d0475c6e8b385a6060405160405180910390a250565b60016000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541461028f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016102869061070b565b60405180910390fd5b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508073ffffffffffffffffffffffffffffffffffffffff167f184450df2e323acec0ed3b5c7531b81f9b4cdef7914dfd4c0a4317416bb5251b60405160405180910390a250565b606060016000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541461039c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103939061070b565b60405180910390fd5b60008473ffffffffffffffffffffffffffffffffffffffff1684846040516103c592919061076a565b600060405180830381855af49150503d8060008114610400576040519150601f19603f3d011682016040523d82523d6000602084013e610405565b606091505b5080935081925050508061044e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610445906107cf565b60405180910390fd5b509392505050565b60006020528060005260406000206000915090505481565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006104a382610478565b9050919050565b6104b381610498565b81146104be57600080fd5b50565b6000813590506104d0816104aa565b92915050565b6000602082840312156104ec576104eb61046e565b5b60006104fa848285016104c1565b91505092915050565b600080fd5b600080fd5b600080fd5b60008083601f84011261052857610527610503565b5b8235905067ffffffffffffffff81111561054557610544610508565b5b6020830191508360018202830111156105615761056061050d565b5b9250929050565b6000806000604084860312156105815761058061046e565b5b600061058f868287016104c1565b935050602084013567ffffffffffffffff8111156105b0576105af610473565b5b6105bc86828701610512565b92509250509250925092565b600081519050919050565b600082825260208201905092915050565b60005b838110156106025780820151818401526020810190506105e7565b60008484015250505050565b6000601f19601f8301169050919050565b600061062a826105c8565b61063481856105d3565b93506106448185602086016105e4565b61064d8161060e565b840191505092915050565b60006020820190508181036000830152610672818461061f565b905092915050565b6000819050919050565b61068d8161067a565b82525050565b60006020820190506106a86000830184610684565b92915050565b600082825260208201905092915050565b7f53756250726f78792f6e6f742d617574686f72697a6564000000000000000000600082015250565b60006106f56017836106ae565b9150610700826106bf565b602082019050919050565b60006020820190508181036000830152610724816106e8565b9050919050565b600081905092915050565b82818337600083830152505050565b6000610751838561072b565b935061075e838584610736565b82840190509392505050565b6000610777828486610745565b91508190509392505050565b7f53756250726f78792f64656c656761746563616c6c2d6572726f720000000000600082015250565b60006107b9601b836106ae565b91506107c482610783565b602082019050919050565b600060208201905081810360008301526107e8816107ac565b905091905056fea2646970667358221220c9e0eee4a76255d9e2c7df45862d6555ca1f2fe09c071262011969e3f0d8fbf164736f6c63430008130033","optimization_enabled":false,"verified_twin_address_hash":null,"is_verified":true,"compiler_settings":{"evmVersion":"paris","libraries":{},"metadata":{"bytecodeHash":"ipfs"},"optimizer":{"enabled":false,"runs":200},"remappings":[":ds-test/=lib/forge-std/lib/ds-test/src/",":dss-interfaces/=lib/dss-test/lib/dss-interfaces/src/",":dss-test/=lib/dss-test/src/",":forge-std/=lib/forge-std/src/"]},"optimization_runs":null,"sourcify_repo_url":"https://repo.sourcify.dev/contracts/full_match/1/0x3300f198988e4C9C63F75dF86De36421f06af8c4/","decoded_constructor_args":null,"compiler_version":"0.8.19+commit.7dd6d404","is_verified_via_verifier_alliance":false,"verified_at":"2024-05-14T16:13:52.148418Z","implementations":[],"proxy_type":null,"external_libraries":[],"creation_bytecode":"0x608060405234801561001057600080fd5b5060016000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055503373ffffffffffffffffffffffffffffffffffffffff167fdd0e34038ac38b2a1ce960229778ac48a8719bc900b6c4f8d0475c6e8b385a6060405160405180910390a2610825806100a76000396000f3fe60806040526004361061003f5760003560e01c806365fae35e146100445780639c52a7f11461006d578063be6002c214610096578063bf353dbb146100c6575b600080fd5b34801561005057600080fd5b5061006b600480360381019061006691906104d6565b610103565b005b34801561007957600080fd5b50610094600480360381019061008f91906104d6565b61020e565b005b6100b060048036038101906100ab9190610568565b610319565b6040516100bd9190610658565b60405180910390f35b3480156100d257600080fd5b506100ed60048036038101906100e891906104d6565b610456565b6040516100fa9190610693565b60405180910390f35b60016000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414610184576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161017b9061070b565b60405180910390fd5b60016000808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508073ffffffffffffffffffffffffffffffffffffffff167fdd0e34038ac38b2a1ce960229778ac48a8719bc900b6c4f8d0475c6e8b385a6060405160405180910390a250565b60016000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541461028f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016102869061070b565b60405180910390fd5b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508073ffffffffffffffffffffffffffffffffffffffff167f184450df2e323acec0ed3b5c7531b81f9b4cdef7914dfd4c0a4317416bb5251b60405160405180910390a250565b606060016000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541461039c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103939061070b565b60405180910390fd5b60008473ffffffffffffffffffffffffffffffffffffffff1684846040516103c592919061076a565b600060405180830381855af49150503d8060008114610400576040519150601f19603f3d011682016040523d82523d6000602084013e610405565b606091505b5080935081925050508061044e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610445906107cf565b60405180910390fd5b509392505050565b60006020528060005260406000206000915090505481565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006104a382610478565b9050919050565b6104b381610498565b81146104be57600080fd5b50565b6000813590506104d0816104aa565b92915050565b6000602082840312156104ec576104eb61046e565b5b60006104fa848285016104c1565b91505092915050565b600080fd5b600080fd5b600080fd5b60008083601f84011261052857610527610503565b5b8235905067ffffffffffffffff81111561054557610544610508565b5b6020830191508360018202830111156105615761056061050d565b5b9250929050565b6000806000604084860312156105815761058061046e565b5b600061058f868287016104c1565b935050602084013567ffffffffffffffff8111156105b0576105af610473565b5b6105bc86828701610512565b92509250509250925092565b600081519050919050565b600082825260208201905092915050565b60005b838110156106025780820151818401526020810190506105e7565b60008484015250505050565b6000601f19601f8301169050919050565b600061062a826105c8565b61063481856105d3565b93506106448185602086016105e4565b61064d8161060e565b840191505092915050565b60006020820190508181036000830152610672818461061f565b905092915050565b6000819050919050565b61068d8161067a565b82525050565b60006020820190506106a86000830184610684565b92915050565b600082825260208201905092915050565b7f53756250726f78792f6e6f742d617574686f72697a6564000000000000000000600082015250565b60006106f56017836106ae565b9150610700826106bf565b602082019050919050565b60006020820190508181036000830152610724816106e8565b9050919050565b600081905092915050565b82818337600083830152505050565b6000610751838561072b565b935061075e838584610736565b82840190509392505050565b6000610777828486610745565b91508190509392505050565b7f53756250726f78792f64656c656761746563616c6c2d6572726f720000000000600082015250565b60006107b9601b836106ae565b91506107c482610783565b602082019050919050565b600060208201905081810360008301526107e8816107ac565b905091905056fea2646970667358221220c9e0eee4a76255d9e2c7df45862d6555ca1f2fe09c071262011969e3f0d8fbf164736f6c63430008130033","name":"SubProxy","is_blueprint":false,"license_type":"none","is_fully_verified":true,"is_verified_via_eth_bytecode_db":true,"language":"solidity","evm_version":"paris","can_be_visualized_via_sol2uml":true,"is_verified_via_sourcify":true,"additional_sources":[],"certified":false,"conflicting_implementations":null,"abi":[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"usr","type":"address"}],"name":"Deny","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"usr","type":"address"}],"name":"Rely","type":"event"},{"inputs":[{"internalType":"address","name":"usr","type":"address"}],"name":"deny","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"target","type":"address"},{"internalType":"bytes","name":"args","type":"bytes"}],"name":"exec","outputs":[{"internalType":"bytes","name":"out","type":"bytes"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"usr","type":"address"}],"name":"rely","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"wards","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"}],"is_changed_bytecode":false,"is_partially_verified":false,"constructor_args":null}