Goerli Testnet

Contract

0xf30b40411c4d76228092E7eCdc1593c996b13D22
Source Code

Overview

ETH Balance

0 ETH

Multi Chain

Multichain Addresses

N/A
Transaction Hash
Method
Block
From
To
Value
0x60e0604092512562023-06-27 20:14:3689 days 22 hrs ago1687896876IN
 Create: Challenger1of2
0 ETH0.000134290.30044887

Advanced mode:
Parent Txn Hash Block From To Value
View All Internal Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
Challenger1of2

Compiler Version
v0.8.15+commit.e14f2714

Optimization Enabled:
Yes with 999999 runs

Other Settings:
default evmVersion

Contract Source Code (Solidity Standard Json-Input format)

File 1 of 2 : Challenger1of2.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.15;

import { Address } from "@openzeppelin/contracts/utils/Address.sol";

/**
 * @title Challenger1of2
 * @dev This contract serves the role of the Challenger, defined in L2OutputOracle.sol:
 * https://github.com/ethereum-optimism/optimism/blob/3580bf1b41d80fcb2b895d5610836bfad27fc989/packages/contracts-bedrock/contracts/L1/L2OutputOracle.sol
 * It enforces a simple 1 of 2 design, where neither party can remove the other's
 * permissions to execute a Challenger call.
 */
contract Challenger1of2 {
    using Address for address;

    /*//////////////////////////////////////////////////////////////
                            CONSTANTS
    //////////////////////////////////////////////////////////////*/
    /**
     * @dev The address of Optimism's signer (likely a multisig)
     */
    address public immutable OP_SIGNER;

    /**
     * @dev The address of counter party's signer (likely a multisig)
     */
    address public immutable OTHER_SIGNER;

    /**
     * @dev The address of the L2OutputOracleProxy contract.
     */
    address public immutable L2_OUTPUT_ORACLE_PROXY;

    /*//////////////////////////////////////////////////////////////
                            EVENTS
    //////////////////////////////////////////////////////////////*/
    /**
     * @dev Emitted when a Challenger call is made by a signer.
     * @param _caller The signer making the call.
     * @param _data The data of the call being made.
     * @param _result The result of the call being made.
     */
    event ChallengerCallExecuted(
        address indexed _caller,
        bytes _data,
        bytes _result
    );

    /*//////////////////////////////////////////////////////////////
                            Constructor
    //////////////////////////////////////////////////////////////*/
    /**
     * @dev Constructor to set the values of the constants.
     * @param _opSigner Address of Optimism signer.
     * @param _otherSigner Address of counter party signer.
     * @param _l2OutputOracleProxy Address of the L2OutputOracleProxy contract.
     */
    constructor(address _opSigner, address _otherSigner, address _l2OutputOracleProxy) {
        require(_opSigner != address(0), "Challenger1of2: opSigner cannot be zero address");
        require(_otherSigner != address(0), "Challenger1of2: otherSigner cannot be zero address");
        require(
            _l2OutputOracleProxy.isContract(),
            "Challenger1of2: l2OutputOracleProxy must be a contract"
        );

        OP_SIGNER = _opSigner;
        OTHER_SIGNER = _otherSigner;
        L2_OUTPUT_ORACLE_PROXY = _l2OutputOracleProxy;
    }

    /*//////////////////////////////////////////////////////////////
                        External Functions
    //////////////////////////////////////////////////////////////*/
    /**
     * @dev Executes a call as the Challenger (must be called by 
     * Optimism or counter party signer).
     * @param _data Data for function call.
     */
    function execute(bytes memory _data) external {
        require(
            msg.sender == OTHER_SIGNER || msg.sender == OP_SIGNER,
            "Challenger1of2: must be an approved signer to execute"
        );

        bytes memory result = Address.functionCall(
            L2_OUTPUT_ORACLE_PROXY,
            _data,
            "Challenger1of2: failed to execute"
        );

        emit ChallengerCallExecuted(msg.sender, _data, result);
    }
}

File 2 of 2 : Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (utils/Address.sol)

pragma solidity ^0.8.1;

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     * ====
     *
     * [IMPORTANT]
     * ====
     * You shouldn't rely on `isContract` to protect against flash loan attacks!
     *
     * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
     * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
     * constructor.
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize/address.code.length, which returns 0
        // for contracts in construction, since the code is only stored at the end
        // of the constructor execution.

        return account.code.length > 0;
    }

    /**
     * @dev Replacement for Solidity's `transfer`: sends `amount` wei to
     * `recipient`, forwarding all available gas and reverting on errors.
     *
     * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
     * of certain opcodes, possibly making contracts go over the 2300 gas limit
     * imposed by `transfer`, making them unable to receive funds via
     * `transfer`. {sendValue} removes this limitation.
     *
     * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
     *
     * IMPORTANT: because control is transferred to `recipient`, care must be
     * taken to not create reentrancy vulnerabilities. Consider using
     * {ReentrancyGuard} or the
     * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
     */
    function sendValue(address payable recipient, uint256 amount) internal {
        require(address(this).balance >= amount, "Address: insufficient balance");

        (bool success, ) = recipient.call{value: amount}("");
        require(success, "Address: unable to send value, recipient may have reverted");
    }

    /**
     * @dev Performs a Solidity function call using a low level `call`. A
     * plain `call` is an unsafe replacement for a function call: use this
     * function instead.
     *
     * If `target` reverts with a revert reason, it is bubbled up by this
     * function (like regular Solidity function calls).
     *
     * Returns the raw returned data. To convert to the expected return value,
     * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
     *
     * Requirements:
     *
     * - `target` must be a contract.
     * - calling `target` with `data` must not revert.
     *
     * _Available since v3.1._
     */
    function functionCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionCall(target, data, "Address: low-level call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
     * `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        return functionCallWithValue(target, data, 0, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but also transferring `value` wei to `target`.
     *
     * Requirements:
     *
     * - the calling contract must have an ETH balance of at least `value`.
     * - the called Solidity function must be `payable`.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(
        address target,
        bytes memory data,
        uint256 value
    ) internal returns (bytes memory) {
        return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
    }

    /**
     * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
     * with `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(
        address target,
        bytes memory data,
        uint256 value,
        string memory errorMessage
    ) internal returns (bytes memory) {
        require(address(this).balance >= value, "Address: insufficient balance for call");
        require(isContract(target), "Address: call to non-contract");

        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
        return functionStaticCall(target, data, "Address: low-level static call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        require(isContract(target), "Address: static call to non-contract");

        (bool success, bytes memory returndata) = target.staticcall(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionDelegateCall(target, data, "Address: low-level delegate call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        require(isContract(target), "Address: delegate call to non-contract");

        (bool success, bytes memory returndata) = target.delegatecall(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason using the provided one.
     *
     * _Available since v4.3._
     */
    function verifyCallResult(
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal pure returns (bytes memory) {
        if (success) {
            return returndata;
        } else {
            // Look for revert reason and bubble it up if present
            if (returndata.length > 0) {
                // The easiest way to bubble the revert reason is using memory via assembly
                /// @solidity memory-safe-assembly
                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}

Settings
{
  "remappings": [
    "@base-contracts/=lib/base-contracts/",
    "@eth-optimism-bedrock/=lib/optimism/packages/contracts-bedrock/",
    "@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/",
    "@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/",
    "@rari-capital/solmate/=lib/solmate/",
    "base-contracts/=lib/base-contracts/src/",
    "ds-test/=lib/forge-std/lib/ds-test/src/",
    "forge-std/=lib/forge-std/src/",
    "optimism/=lib/optimism/",
    "solmate/=lib/solmate/src/"
  ],
  "optimizer": {
    "enabled": true,
    "runs": 999999
  },
  "metadata": {
    "bytecodeHash": "ipfs"
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "evmVersion": "london",
  "libraries": {}
}

Contract ABI

[{"inputs":[{"internalType":"address","name":"_opSigner","type":"address"},{"internalType":"address","name":"_otherSigner","type":"address"},{"internalType":"address","name":"_l2OutputOracleProxy","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_caller","type":"address"},{"indexed":false,"internalType":"bytes","name":"_data","type":"bytes"},{"indexed":false,"internalType":"bytes","name":"_result","type":"bytes"}],"name":"ChallengerCallExecuted","type":"event"},{"inputs":[],"name":"L2_OUTPUT_ORACLE_PROXY","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"OP_SIGNER","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"OTHER_SIGNER","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"execute","outputs":[],"stateMutability":"nonpayable","type":"function"}]

60e060405234801561001057600080fd5b5060405161096038038061096083398101604081905261002f916101e9565b6001600160a01b0383166100a25760405162461bcd60e51b815260206004820152602f60248201527f4368616c6c656e676572316f66323a206f705369676e65722063616e6e6f742060448201526e6265207a65726f206164647265737360881b60648201526084015b60405180910390fd5b6001600160a01b0382166101135760405162461bcd60e51b815260206004820152603260248201527f4368616c6c656e676572316f66323a206f746865725369676e65722063616e6e6044820152716f74206265207a65726f206164647265737360701b6064820152608401610099565b61012f816001600160a01b03166101be60201b6102a91760201c565b6101a15760405162461bcd60e51b815260206004820152603660248201527f4368616c6c656e676572316f66323a206c324f75747075744f7261636c65507260448201527f6f7879206d757374206265206120636f6e7472616374000000000000000000006064820152608401610099565b6001600160a01b0392831660805290821660a0521660c05261022c565b6001600160a01b03163b151590565b80516001600160a01b03811681146101e457600080fd5b919050565b6000806000606084860312156101fe57600080fd5b610207846101cd565b9250610215602085016101cd565b9150610223604085016101cd565b90509250925092565b60805160a05160c0516106f361026d60003960008181606b015261021501526000818160bb015261011c01526000818160e2015261015b01526106f36000f3fe608060405234801561001057600080fd5b506004361061004c5760003560e01c806309c5eabe1461005157806340f2b79d14610066578063b822d6d9146100b6578063f7bc369b146100dd575b600080fd5b61006461005f3660046104f6565b610104565b005b61008d7f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b61008d7f000000000000000000000000000000000000000000000000000000000000000081565b61008d7f000000000000000000000000000000000000000000000000000000000000000081565b3373ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016148061017d57503373ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016145b61020e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603560248201527f4368616c6c656e676572316f66323a206d75737420626520616e20617070726f60448201527f766564207369676e657220746f2065786563757465000000000000000000000060648201526084015b60405180910390fd5b60006102537f00000000000000000000000000000000000000000000000000000000000000008360405180606001604052806021815260200161069d602191396102c5565b90503373ffffffffffffffffffffffffffffffffffffffff167fcb847280fc429a1fa2adb0778d17d774edd25630d2f18643b2261da6499b0b0f838360405161029d92919061063f565b60405180910390a25050565b73ffffffffffffffffffffffffffffffffffffffff163b151590565b60606102d484846000856102de565b90505b9392505050565b606082471015610370576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c00000000000000000000000000000000000000000000000000006064820152608401610205565b73ffffffffffffffffffffffffffffffffffffffff85163b6103ee576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610205565b6000808673ffffffffffffffffffffffffffffffffffffffff168587604051610417919061066d565b60006040518083038185875af1925050503d8060008114610454576040519150601f19603f3d011682016040523d82523d6000602084013e610459565b606091505b5091509150610469828286610474565b979650505050505050565b606083156104835750816102d7565b8251156104935782518084602001fd5b816040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016102059190610689565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60006020828403121561050857600080fd5b813567ffffffffffffffff8082111561052057600080fd5b818401915084601f83011261053457600080fd5b813581811115610546576105466104c7565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f0116810190838211818310171561058c5761058c6104c7565b816040528281528760208487010111156105a557600080fd5b826020860160208301376000928101602001929092525095945050505050565b60005b838110156105e05781810151838201526020016105c8565b838111156105ef576000848401525b50505050565b6000815180845261060d8160208601602086016105c5565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b60408152600061065260408301856105f5565b828103602084015261066481856105f5565b95945050505050565b6000825161067f8184602087016105c5565b9190910192915050565b6020815260006102d760208301846105f556fe4368616c6c656e676572316f66323a206661696c656420746f2065786563757465a26469706673582212203050fd4bff59df9dc9061449786283d671a5b5d9d504df4f5298a6dbe0605f4964736f6c634300080f00330000000000000000000000004c35ca57616e0d5fd808574772f632d8da4eadca0000000000000000000000004574d0a407c9ef275128df822cf13bf8aef28bd80000000000000000000000002a35891ff30313ccfa6ce88dcf3858bb075a2298

Deployed Bytecode

0x608060405234801561001057600080fd5b506004361061004c5760003560e01c806309c5eabe1461005157806340f2b79d14610066578063b822d6d9146100b6578063f7bc369b146100dd575b600080fd5b61006461005f3660046104f6565b610104565b005b61008d7f0000000000000000000000002a35891ff30313ccfa6ce88dcf3858bb075a229881565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b61008d7f0000000000000000000000004574d0a407c9ef275128df822cf13bf8aef28bd881565b61008d7f0000000000000000000000004c35ca57616e0d5fd808574772f632d8da4eadca81565b3373ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000004574d0a407c9ef275128df822cf13bf8aef28bd816148061017d57503373ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000004c35ca57616e0d5fd808574772f632d8da4eadca16145b61020e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603560248201527f4368616c6c656e676572316f66323a206d75737420626520616e20617070726f60448201527f766564207369676e657220746f2065786563757465000000000000000000000060648201526084015b60405180910390fd5b60006102537f0000000000000000000000002a35891ff30313ccfa6ce88dcf3858bb075a22988360405180606001604052806021815260200161069d602191396102c5565b90503373ffffffffffffffffffffffffffffffffffffffff167fcb847280fc429a1fa2adb0778d17d774edd25630d2f18643b2261da6499b0b0f838360405161029d92919061063f565b60405180910390a25050565b73ffffffffffffffffffffffffffffffffffffffff163b151590565b60606102d484846000856102de565b90505b9392505050565b606082471015610370576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c00000000000000000000000000000000000000000000000000006064820152608401610205565b73ffffffffffffffffffffffffffffffffffffffff85163b6103ee576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610205565b6000808673ffffffffffffffffffffffffffffffffffffffff168587604051610417919061066d565b60006040518083038185875af1925050503d8060008114610454576040519150601f19603f3d011682016040523d82523d6000602084013e610459565b606091505b5091509150610469828286610474565b979650505050505050565b606083156104835750816102d7565b8251156104935782518084602001fd5b816040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016102059190610689565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60006020828403121561050857600080fd5b813567ffffffffffffffff8082111561052057600080fd5b818401915084601f83011261053457600080fd5b813581811115610546576105466104c7565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f0116810190838211818310171561058c5761058c6104c7565b816040528281528760208487010111156105a557600080fd5b826020860160208301376000928101602001929092525095945050505050565b60005b838110156105e05781810151838201526020016105c8565b838111156105ef576000848401525b50505050565b6000815180845261060d8160208601602086016105c5565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b60408152600061065260408301856105f5565b828103602084015261066481856105f5565b95945050505050565b6000825161067f8184602087016105c5565b9190910192915050565b6020815260006102d760208301846105f556fe4368616c6c656e676572316f66323a206661696c656420746f2065786563757465a26469706673582212203050fd4bff59df9dc9061449786283d671a5b5d9d504df4f5298a6dbe0605f4964736f6c634300080f0033

Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)

0000000000000000000000004c35ca57616e0d5fd808574772f632d8da4eadca0000000000000000000000004574d0a407c9ef275128df822cf13bf8aef28bd80000000000000000000000002a35891ff30313ccfa6ce88dcf3858bb075a2298

-----Decoded View---------------
Arg [0] : _opSigner (address): 0x4C35Ca57616E0d5fD808574772f632D8dA4eadCa
Arg [1] : _otherSigner (address): 0x4574D0A407c9eF275128Df822CF13BF8aEF28BD8
Arg [2] : _l2OutputOracleProxy (address): 0x2A35891ff30313CcFa6CE88dcf3858bb075A2298

-----Encoded View---------------
3 Constructor Arguments found :
Arg [0] : 0000000000000000000000004c35ca57616e0d5fd808574772f632d8da4eadca
Arg [1] : 0000000000000000000000004574d0a407c9ef275128df822cf13bf8aef28bd8
Arg [2] : 0000000000000000000000002a35891ff30313ccfa6ce88dcf3858bb075a2298


Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

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

Validator Index Block Amount
View All Withdrawals

Txn Hash Block Value Eth2 PubKey Valid
View All Deposits
[ Download: CSV Export  ]

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.