Contract 0x53163235746CeB81Da32293bb0932e1A599256B4

 
Txn Hash Method
Block
From
To
Value
0xcb125bf3419b11ba23488e96dadafee94f4d115c1329efff34317779f479eca50x608060409693152023-02-23 12:09:0835 days 6 hrs ago0x9086bcfcbaf22ee57d7b4ccfb1fca3786349a2b0 IN  Create: CrossChainAccount0 Ether0.0006300911
[ Download CSV Export 
Parent Txn Hash Block From To Value
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
CrossChainAccount

Compiler Version
v0.7.6+commit.7338295f

Optimization Enabled:
No with 200 runs

Other Settings:
default evmVersion, None license
/**
 *Submitted for verification at bobascan.com on 2023-02-23
*/

pragma solidity 0.7.6;

interface Messenger {
    function sendMessage(address _target, bytes memory _message, uint32 _gasLimit) external;

    function relayMessage(
        address _target,
        address _sender,
        bytes memory _message,
        uint256 _messageNonce
    ) external;

    function xDomainMessageSender() external view returns (address);
}

// L2 Contract which receives messages from a specific L1 address and transparently
// forwards them to the destination.
// 
// Any other L2 contract which uses this contract's address as a privileged position,
// can be considered to be owned by the `l1Owner`
contract CrossChainAccount {
    Messenger messenger;
    address l1Owner;

    constructor(Messenger _messenger, address _l1Owner) {
        messenger = _messenger;
        l1Owner = _l1Owner;
    }

    // `forward` `calls` the `target` with `data`, 
    // can only be called by the `messenger`
    // can only be called if `tx.l1MessageSender == l1Owner`
    function forward(address target, bytes memory data) external {
        // 1. The call MUST come from the L1 Messenger
        require(msg.sender == address(messenger), "Sender is not the messenger");
        // 2. The L1 Messenger's caller MUST be the L1 Owner
        require(messenger.xDomainMessageSender() == l1Owner, "L1Sender is not the L1Owner");
        // 3. Make the external call
        (bool success, bytes memory res) = target.call(data);
        require(success, string(abi.encode("XChain call failed:", res)));
    }
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"contract Messenger","name":"_messenger","type":"address"},{"internalType":"address","name":"_l1Owner","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"address","name":"target","type":"address"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"forward","outputs":[],"stateMutability":"nonpayable","type":"function"}]

608060405234801561001057600080fd5b5060405161066b38038061066b8339818101604052604081101561003357600080fd5b810190808051906020019092919080519060200190929190505050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555080600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550505061058b806100e06000396000f3fe608060405234801561001057600080fd5b506004361061002b5760003560e01c80636fadcf7214610030575b600080fd5b6101096004803603604081101561004657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019064010000000081111561008357600080fd5b82018360208201111561009557600080fd5b803590602001918460018302840111640100000000831117156100b757600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050919291929050505061010b565b005b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146101cc576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f53656e646572206973206e6f7420746865206d657373656e676572000000000081525060200191505060405180910390fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16636e296e456040518163ffffffff1660e01b815260040160206040518083038186803b15801561026b57600080fd5b505afa15801561027f573d6000803e3d6000fd5b505050506040513d602081101561029557600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff161461032f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f4c3153656e646572206973206e6f7420746865204c314f776e6572000000000081525060200191505060405180910390fd5b6000808373ffffffffffffffffffffffffffffffffffffffff16836040518082805190602001908083835b6020831061037d578051825260208201915060208101905060208303925061035a565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d80600081146103df576040519150601f19603f3d011682016040523d82523d6000602084013e6103e4565b606091505b50915091508181604051602001808060200180602001838103835260138152602001807f58436861696e2063616c6c206661696c65643a00000000000000000000000000815250602001838103825284818151815260200191508051906020019080838360005b8381101561046657808201518184015260208101905061044b565b50505050905090810190601f1680156104935780820380516001836020036101000a031916815260200191505b5093505050506040516020818303038152906040529061054e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156105135780820151818401526020810190506104f8565b50505050905090810190601f1680156105405780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050505056fea264697066735822122013e00612675d2926df640196dcbf092c4b66c09ba3c1e841ae1fa76f49cb552a64736f6c6343000706003300000000000000000000000042000000000000000000000000000000000000070000000000000000000000001a9c8182c09f50c8318d769245bea52c32be35bc

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

00000000000000000000000042000000000000000000000000000000000000070000000000000000000000001a9c8182c09f50c8318d769245bea52c32be35bc

-----Decoded View---------------
Arg [0] : _messenger (address): 0x4200000000000000000000000000000000000007
Arg [1] : _l1Owner (address): 0x1a9c8182c09f50c8318d769245bea52c32be35bc

-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 0000000000000000000000004200000000000000000000000000000000000007
Arg [1] : 0000000000000000000000001a9c8182c09f50c8318d769245bea52c32be35bc


Deployed ByteCode Sourcemap

648:918:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1023:540;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;1181:9;;;;;;;;;;1159:32;;:10;:32;;;1151:72;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1340:7;;;;;;;;;;;1304:43;;:9;;;;;;;;;;:30;;;:32;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:43;;;1296:83;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1429:12;1443:16;1463:6;:11;;1475:4;1463:17;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1428:52;;;;1499:7;1549:3;1515:38;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1491:64;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1023:540;;;;:::o

Swarm Source

ipfs://13e00612675d2926df640196dcbf092c4b66c09ba3c1e841ae1fa76f49cb552a
Block Transaction Difficulty Gas Used Reward
Block Uncle Number Difficulty Gas Used Reward
Loading
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.