Skip to content
Verified contractExactMIT

SqueekGuardian

Address0xed215894fbd2c71cd100534872c724ffbd5f798a
Balance

0 ETH

 

Transactions

1

 

Compiler

solc 0.8.36

 

Same code

Only this contract

 

Details

Compiler
solc 0.8.36+commit.8a079791
Language
solidity
Optimization
Yes, 200 runs
EVM version
cancun
Via IR
yes
License
MIT
Match
Exactcreation code: yes, runtime code: yes
Verified on Sourcify
Created in block
26,327,950
Creation transaction
0xaee8d97595…3f05822abf

src/SqueekGuardian.sol

// SPDX-License-Identifier: MIT
pragma solidity 0.8.36;

/// @notice Minimal role executor fronting a Safe: the Guardian, Treasury and Pot slots of the core are each one
///         of these, so the protocol actors are contracts while a 1-of-1 Safe keeps the keys.
/// @dev Surface matches the Sepolia deployments (`safe()`, `role()`, `execute(address,uint256,bytes)`).
contract SqueekGuardian {
    error InvalidSafe();
    error UnauthorizedSafe();

    event Executed(address indexed target, uint256 value, bytes payload);

    address public immutable safe;
    bytes32 public immutable role;

    /// @param safe_ Safe allowed to act through this executor.
    /// @param role_ Label of the slot this executor fills (keccak256 of "guardian", "treasury" or "pot").
    constructor(address safe_, bytes32 role_) {
        if (safe_ == address(0) || safe_.code.length == 0) revert InvalidSafe();
        safe = safe_;
        role = role_;
    }

    /// @notice Forwards one call from the Safe, bubbling the revert reason.
    function execute(address target, uint256 value, bytes calldata payload)
        external
        payable
        returns (bytes memory result)
    {
        if (msg.sender != safe) revert UnauthorizedSafe();
        bool ok;
        (ok, result) = target.call{ value: value }(payload);
        if (!ok) {
            // SAFETY: bubble the callee's revert data unchanged.
            assembly ("memory-safe") {
                revert(add(result, 0x20), mload(result))
            }
        }
        emit Executed(target, value, payload);
    }

    receive() external payable { }
}
Compiler settingsShow
{
  "viaIR": true,
  "metadata": {
    "appendCBOR": true,
    "bytecodeHash": "ipfs",
    "useLiteralContent": false
  },
  "optimizer": {
    "runs": 200,
    "enabled": true
  },
  "viaSSACFG": false,
  "evmVersion": "cancun",
  "remappings": [
    "@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/",
    "@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/",
    "@uniswap/v3-core/=lib/v3-core/",
    "forge-std/=lib/forge-std/src/",
    "ds-test/=lib/openzeppelin-contracts/lib/forge-std/lib/ds-test/src/",
    "erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/",
    "halmos-cheatcodes/=lib/openzeppelin-contracts/lib/halmos-cheatcodes/src/",
    "openzeppelin-contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/",
    "openzeppelin-contracts/=lib/openzeppelin-contracts/",
    "v3-core/=lib/v3-core/contracts/"
  ],
  "experimental": false
}

Source code and metadata: Sourcify.

The source code belongs to the authors of the contract.