RSC_CallbackProxy

Description:

Smart contract deployed on Ethereum with Factory features.

Blockchain: Ethereum

Source Code: View Code On The Blockchain

Solidity Source Code:

{{
  "language": "Solidity",
  "sources": {
    "src/RSC_CallbackProxy.sol": {
      "content": "// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;

import {IRscCallbackProxy} from "./RSCInterfaces.sol";
import {Ownable} from "./utils/Ownable.sol";

contract RSC_CallbackProxy is IRscCallbackProxy, Ownable {
    event CallbackProcessed(bytes32 indexed msgId, bool success);

    mapping(bytes32 => bool) public seen;
    mapping(address => bool) public isTrustedRelayer;

    error NotTrustedRelayer();

    function setTrustedRelayer(address relayer, bool allowed) external onlyOwner {
        isTrustedRelayer[relayer] = allowed;
    }

    function remoteExec(bytes32 msgId, bytes calldata payload) external override {
        if (!isTrustedRelayer[msg.sender]) revert NotTrustedRelayer();
        require(!seen[msgId], "already-processed");
        seen[msgId] = true;
        // In a complete version, decode and execute target function(s) here.
        // (topic, eventSig, log) = abi.decode(payload, (address, bytes32, bytes));
        emit CallbackProcessed(msgId, true);
    }
}



"
    },
    "src/RSCInterfaces.sol": {
      "content": "// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;

interface IRscCallbackProxy {
    function remoteExec(bytes32 msgId, bytes calldata payload) external;
}

interface IRscSubscriptionRegistry {
    event Subscribed(address indexed topic, bytes32 indexed eventSig, bool wildcard);
    event Unsubscribed(address indexed topic, bytes32 indexed eventSig);
    function subscribe(address topic, bytes32 eventSig, bool wildcard) external;
    function unsubscribe(address topic, bytes32 eventSig) external;
    function subscribed(bytes32 key) external view returns (bool);
    function wildcard(bytes32 key) external view returns (bool);
}



"
    },
    "src/utils/Ownable.sol": {
      "content": "// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;

/// @title Minimal Ownable utility
abstract contract Ownable {
    error NotOwner();

    address public owner;

    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);

    constructor() {
        owner = msg.sender;
        emit OwnershipTransferred(address(0), msg.sender);
    }

    modifier onlyOwner() {
        if (msg.sender != owner) revert NotOwner();
        _;
    }

    function transferOwnership(address newOwner) external onlyOwner {
        require(newOwner != address(0), "Owner=zero");
        emit OwnershipTransferred(owner, newOwner);
        owner = newOwner;
    }
}


"
    }
  },
  "settings": {
    "remappings": [
      "forge-std/=lib/forge-std/src/",
      "reactive-lib/=lib/reactive-lib/src/"
    ],
    "optimizer": {
      "enabled": true,
      "runs": 200
    },
    "metadata": {
      "useLiteralContent": false,
      "bytecodeHash": "ipfs",
      "appendCBOR": true
    },
    "outputSelection": {
      "*": {
        "*": [
          "evm.bytecode",
          "evm.deployedBytecode",
          "devdoc",
          "userdoc",
          "metadata",
          "abi"
        ]
      }
    },
    "evmVersion": "cancun",
    "viaIR": true
  }
}}

Tags:
Factory|addr:0x8edcff48d8c74e43947ab92ef27e254a1d0b6090|verified:true|block:23452052|tx:0xfcf8c2be8092b6008228b1c4053f0e7eae6015d0686cd9839569dd1c048c3f24|first_check:1758966634

Submitted on: 2025-09-27 11:50:35

Comments

Log in to comment.

No comments yet.