CallProxy

Description:

Smart contract deployed on Ethereum.

Blockchain: Ethereum

Source Code: View Code On The Blockchain

Solidity Source Code:

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

/// @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 {
        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())
        }
    }
}

Tags:
addr:0x9db8f85b3668e73e599976a6a9a209ba4c0fce34|verified:true|block:23383193|tx:0x1d5f340481af4af9e775764102c10f4c799a555fe71fbd2fda592ef6890423e7|first_check:1758117120

Submitted on: 2025-09-17 15:52:02

Comments

Log in to comment.

No comments yet.