Skip to content
Verified contractPartialBUSL-1.1

CallProxy

Address0xf3e54a1fda3d4351c8bd5065678c0f5ddd0d7bcb
Balance

0 ETH

 

Transactions

1,248

 

Compiler

solc 0.8.19

 

Same code

5 more contracts

 

Details

Compiler
solc 0.8.19+commit.7dd6d404
Language
solidity
Optimization
No
EVM version
paris
License
BUSL-1.1
Match
Partialcreation code: yes, runtime code: yes
Verified on Sourcify
Created in block
25,488,897
Creation transaction
0xc8eab4c716…4ebf49daee

src/CallProxy.sol

// SPDX-License-Identifier: BUSL-1.1
pragma solidity =0.8.19;

interface IRenounceRole {
    function renounceRole(bytes32 role, address account) external;
}

/// @notice a contract which acts as a forwarder that forwards the input from
/// any caller to a a target contract.
contract CallProxy {
    event TargetSet(address target);

    address immutable i_target;

    constructor(address target) {
        i_target = target;
        emit TargetSet(target);
    }

    fallback() external payable {
        require(
            msg.data.length < 4 ||
                bytes4(msg.data) != IRenounceRole.renounceRole.selector,
            "CallProxy: renounceRole is blocked"
        );
        address target = i_target;
        assembly {
            // This code destroys Solidity's memory layout.
            // That's fine, because we never return to Solidity anyways,
            // we either return or revert out of the callframe at the end.
            calldatacopy(0, 0, calldatasize())
            let success := call(gas(), target, callvalue(), 0, calldatasize(), 0, 0)
            returndatacopy(0, 0, returndatasize())
            if success { return(0, returndatasize()) }
            revert(0, returndatasize())
        }
    }
}
Compiler settingsShow
{
  "metadata": {
    "bytecodeHash": "ipfs"
  },
  "optimizer": {
    "runs": 200,
    "enabled": false
  },
  "evmVersion": "paris"
}

Source code and metadata: Sourcify.

The source code belongs to the authors of the contract.