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:0xcd897a8c3cba0285b04be97ee3988631406b5e98|verified:true|block:23626183|tx:0x28ce3c5c38d989b93ecfb3adf9e862a737375d0b465426308a2d467076e6e90d|first_check:1761052770

Submitted on: 2025-10-21 15:19:32

Comments

Log in to comment.

No comments yet.