APE Price: $0.74 (+0.80%)

Contract

0xeFa6Ac3F931620fD0449eC8c619f2A14A0A78E99

Overview

APE Balance

Apechain LogoApechain LogoApechain Logo0 APE

APE Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To

There are no matching entries

Please try again later

Parent Transaction Hash Block From To
View All Internal Transactions

Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
CallExecutor

Compiler Version
v0.8.23+commit.f704f362

Optimization Enabled:
Yes with 10000 runs

Other Settings:
shanghai EvmVersion
File 1 of 2 : CallExecutor.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.23;

import {ICallExecutor} from 'interfaces/intent/ICallExecutor.sol';

/**
 * @title CallExecutor
 * @notice Contract that executes calls to external contracts
 */
contract CallExecutor is ICallExecutor {
  /**
   * @inheritdoc ICallExecutor
   * @dev The main difference between this and a solidity low-level call is
   * that we limit the number of bytes that the callee can cause to be
   * copied to caller memory. This prevents stupid things like malicious
   * contracts returning 10,000,000 bytes causing a local OOG when copying
   * to memory.
   */
  function excessivelySafeCall(
    address _target,
    uint256 _gas,
    uint256 _value,
    uint16 _maxCopy,
    bytes memory _calldata
  ) external returns (bool _success, bytes memory _returnData) {
    // set up for assembly call
    uint256 _toCopy;
    _returnData = new bytes(_maxCopy);
    // dispatch message to recipient
    // by assembly calling "handle" function
    // we call via assembly to avoid memcopying a very large returndata
    // returned by a malicious contract
    assembly {
      _success :=
        call(
          _gas, // gas
          _target, // recipient
          _value, // ether value
          add(_calldata, 0x20), // inloc
          mload(_calldata), // inlen
          0, // outloc
          0 // outlen
        )
      // limit our copy to 256 bytes
      _toCopy := returndatasize()
      if gt(_toCopy, _maxCopy) { _toCopy := _maxCopy }
      // Store the length of the copied bytes
      mstore(_returnData, _toCopy)
      // copy the bytes from returndata[0:_toCopy]
      returndatacopy(add(_returnData, 0x20), 0, _toCopy)
    }
    return (_success, _returnData);
  }
}

File 2 of 2 : ICallExecutor.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.23;

/**
 * @title ICallExecutor
 * @notice Interface for the CallExecutor contract, executes calls to external contracts
 */
interface ICallExecutor {
  /**
   * @notice Safely call a target contract, use when you _really_ really _really_ don't trust the called
   * contract. This prevents the called contract from causing reversion of the caller in as many ways as we can.
   * @param _target The address to call
   * @param _gas The amount of gas to forward to the remote contract
   * @param _value The value in wei to send to the remote contract
   * @param _maxCopy The maximum number of bytes of returndata to copy to memory
   * @param _calldata The data to send to the remote contract
   * @return _success Whether the call was successful
   * @return _returnData Returndata as `.call()`. Returndata is capped to `_maxCopy` bytes.
   */
  function excessivelySafeCall(
    address _target,
    uint256 _gas,
    uint256 _value,
    uint16 _maxCopy,
    bytes memory _calldata
  ) external returns (bool _success, bytes memory _returnData);
}

Settings
{
  "remappings": [
    "ds-test/=../../node_modules/ds-test/src/",
    "forge-std/=../../node_modules/forge-std/src/",
    "isolmate/=../../node_modules/isolmate/src/",
    "@hyperlane/=../../node_modules/@hyperlane-xyz/core/contracts/",
    "@openzeppelin/=../../node_modules/@openzeppelin/",
    "@upgrades/=lib/openzeppelin-foundry-upgrades/src/",
    "xerc20/=lib/xerc20/solidity/contracts/",
    "contracts/=src/contracts/",
    "interfaces/=src/interfaces/",
    "utils/=script/utils/",
    "@eth-optimism/=../../node_modules/@eth-optimism/",
    "@hyperlane-xyz/=../../node_modules/@hyperlane-xyz/",
    "@layerzerolabs/=../../node_modules/@layerzerolabs/",
    "erc4626-tests/=lib/xerc20/lib/openzeppelin-contracts/lib/erc4626-tests/",
    "forge-gas-snapshot/=lib/xerc20/lib/permit2/lib/forge-gas-snapshot/src/",
    "fx-portal/=../../node_modules/fx-portal/",
    "openzeppelin-contracts/=lib/xerc20/lib/openzeppelin-contracts/",
    "openzeppelin-foundry-upgrades/=lib/openzeppelin-foundry-upgrades/src/",
    "openzeppelin/=lib/xerc20/lib/openzeppelin-contracts/contracts/",
    "permit2/=lib/xerc20/lib/permit2/",
    "prb-test/=lib/xerc20/lib/prb-test/src/",
    "prb/test/=lib/xerc20/lib/prb-test/src/",
    "solidity-stringutils/=lib/openzeppelin-foundry-upgrades/lib/solidity-stringutils/",
    "solmate/=lib/xerc20/lib/permit2/lib/solmate/"
  ],
  "optimizer": {
    "enabled": true,
    "runs": 10000
  },
  "metadata": {
    "useLiteralContent": false,
    "bytecodeHash": "ipfs",
    "appendCBOR": true
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "evmVersion": "shanghai",
  "viaIR": false,
  "libraries": {}
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"_target","type":"address"},{"internalType":"uint256","name":"_gas","type":"uint256"},{"internalType":"uint256","name":"_value","type":"uint256"},{"internalType":"uint16","name":"_maxCopy","type":"uint16"},{"internalType":"bytes","name":"_calldata","type":"bytes"}],"name":"excessivelySafeCall","outputs":[{"internalType":"bool","name":"_success","type":"bool"},{"internalType":"bytes","name":"_returnData","type":"bytes"}],"stateMutability":"nonpayable","type":"function"}]

608060405234801561000f575f80fd5b506102cb8061001d5f395ff3fe608060405234801561000f575f80fd5b5060043610610029575f3560e01c80636dc638371461002d575b5f80fd5b61004061003b366004610103565b610057565b60405161004e929190610221565b60405180910390f35b5f60605f8461ffff1667ffffffffffffffff811115610078576100786100d6565b6040519080825280601f01601f1916602001820160405280156100a2576020820181803683370190505b5091505f80855160208701898c8cf192503d9050848111156100c15750835b808252805f602084013e509550959350505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b5f805f805f60a08688031215610117575f80fd5b853573ffffffffffffffffffffffffffffffffffffffff8116811461013a575f80fd5b94506020860135935060408601359250606086013561ffff8116811461015e575f80fd5b9150608086013567ffffffffffffffff8082111561017a575f80fd5b818801915088601f83011261018d575f80fd5b81358181111561019f5761019f6100d6565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f011681019083821181831017156101e5576101e56100d6565b816040528281528b60208487010111156101fd575f80fd5b826020860160208301375f6020848301015280955050505050509295509295909350565b82151581525f60206040602084015283518060408501525f5b818110156102565785810183015185820160600152820161023a565b505f6060828601015260607fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f83011685010192505050939250505056fea26469706673582212202de6bb5b199abe93f35ae74997215715c49b649d9e662fbe3602e3b86b3411cf64736f6c63430008170033

Deployed Bytecode

0x608060405234801561000f575f80fd5b5060043610610029575f3560e01c80636dc638371461002d575b5f80fd5b61004061003b366004610103565b610057565b60405161004e929190610221565b60405180910390f35b5f60605f8461ffff1667ffffffffffffffff811115610078576100786100d6565b6040519080825280601f01601f1916602001820160405280156100a2576020820181803683370190505b5091505f80855160208701898c8cf192503d9050848111156100c15750835b808252805f602084013e509550959350505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b5f805f805f60a08688031215610117575f80fd5b853573ffffffffffffffffffffffffffffffffffffffff8116811461013a575f80fd5b94506020860135935060408601359250606086013561ffff8116811461015e575f80fd5b9150608086013567ffffffffffffffff8082111561017a575f80fd5b818801915088601f83011261018d575f80fd5b81358181111561019f5761019f6100d6565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f011681019083821181831017156101e5576101e56100d6565b816040528281528b60208487010111156101fd575f80fd5b826020860160208301375f6020848301015280955050505050509295509295909350565b82151581525f60206040602084015283518060408501525f5b818110156102565785810183015185820160600152820161023a565b505f6060828601015260607fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f83011685010192505050939250505056fea26469706673582212202de6bb5b199abe93f35ae74997215715c49b649d9e662fbe3602e3b86b3411cf64736f6c63430008170033

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits

A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.