Cryo Explorer Ethereum Mainnet

Address Contract Partially Verified

Address 0x613d088F2e5a2ED91635016483dAFa3cd47a8964
Balance 0 ETH
Nonce 1
Code Size 1707 bytes
Last Active
Indexed Transactions 10 (24,151,14824,323,492)
Gas Used (indexed) 1,364,446
External Etherscan · Sourcify

Contract Bytecode

1707 bytes
0x608060405234801561000f575f80fd5b5060043610610085575f3560e01c8063aaccf5ae11610058578063aaccf5ae14610131578063aee4e56314610158578063b3de85841461017f578063e615040014610192575f80fd5b80632189b347146100895780633eaf5d9f146100c357806360057d37146100cb578063a1870a841461010a575b5f80fd5b6100b07f05cd48fccbfd8aa2773fe22c217e808319ffcc1c5a6a463f7d8fa2da4821819681565b6040519081526020015b60405180910390f35b6100b06101a5565b6100f27f000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb4881565b6040516001600160a01b0390911681526020016100ba565b6100f27f000000000000000000000000f6080d9fbeebcd44d89affbfd42f098cbff9281681565b6100f27f000000000000000000000000c662c410c0ecf747543f5ba90660f6abebd9c8c481565b6100f27f000000000000000000000000440d64d67913fa36e593b55e3a0ea9216d6c2d0181565b6100b061018d366004610584565b610324565b6100b06101a0366004610584565b610342565b5f80805b5f5481101561031e575f8082815481106101c5576101c561059b565b905f5260205f20015490505f6101da82610342565b90506101e681856105af565b93505f5b8181101561031357604080517f000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb486001600160a01b039081166024830152604482018690527f000000000000000000000000440d64d67913fa36e593b55e3a0ea9216d6c2d01811660648084019190915283518084039091018152608490920183526020820180516001600160e01b0316631a4ca37b60e21b179052915190915f917f000000000000000000000000f6080d9fbeebcd44d89affbfd42f098cbff92816909116906102bb9084906105d4565b5f604051808303815f865af19150503d805f81146102f4576040519150601f19603f3d011682016040523d82523d5f602084013e6102f9565b606091505b5050905080610309575050610313565b50506001016101ea565b5050506001016101a9565b50919050565b5f8181548110610332575f80fd5b5f91825260209091200154905081565b5f8061034d836103df565b60405163a46efaf360e01b8152600481018290529091507f000000000000000000000000c662c410c0ecf747543f5ba90660f6abebd9c8c46001600160a01b03169063a46efaf3906024015b602060405180830381865afa1580156103b4573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906103d89190610600565b9392505050565b60408051600580825260c082019092525f918291906020820160a0803683370190505090505f815f815181106104175761041761059b565b6020026020010181815250507f000000000000000000000000440d64d67913fa36e593b55e3a0ea9216d6c2d016001600160a01b0316816001815181106104605761046061059b565b6020026020010181815250507f000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb486001600160a01b0316816002815181106104a9576104a961059b565b60200260200101818152505082816003815181106104c9576104c961059b565b6020026020010181815250505f816004815181106104e9576104e961059b565b60209081029190910101526040516307b14bbf60e31b81526001600160a01b037f000000000000000000000000c662c410c0ecf747543f5ba90660f6abebd9c8c41690633d8a5df890610399907f05cd48fccbfd8aa2773fe22c217e808319ffcc1c5a6a463f7d8fa2da48218196907f000000000000000000000000f6080d9fbeebcd44d89affbfd42f098cbff92816908690600401610617565b5f60208284031215610594575f80fd5b5035919050565b634e487b7160e01b5f52603260045260245ffd5b808201808211156105ce57634e487b7160e01b5f52601160045260245ffd5b92915050565b5f82515f5b818110156105f357602081860181015185830152016105d9565b505f920191825250919050565b5f60208284031215610610575f80fd5b5051919050565b8381526001600160a01b03831660208083019190915260606040830181905283519083018190525f91848101916080850190845b818110156106675784518352938301939183019160010161064b565b50909897505050505050505056fea26469706673582212200e70aa3781ea53efa743966b35c6531cbd45cbd2a952a7e08a44b9b3cf70464d64736f6c63430008180033

Verified Source Code Partial Match

Compiler: v0.8.24+commit.e11b9ed9 EVM: cancun Optimization: Yes (200 runs)
BatchWithdraw.sol 93 lines
/*
  Copyright 2019-2025 StarkWare Industries Ltd.

  Licensed under the Apache License, Version 2.0 (the "License").
  You may not use this file except in compliance with the License.
  You may obtain a copy of the License at

  https://www.starkware.co/open-source-license/

  Unless required by applicable law or agreed to in writing,
  software distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions
  and limitations under the License.
*/
// SPDX-License-Identifier: Apache-2.0.
pragma solidity 0.8.24;

import "starkware/starknet/solidity/IStarknetMessaging.sol";

interface ITokenWithdraw {
    function withdraw(
        address token,
        uint256 amount,
        address recipient
    ) external;
}

contract BatchWithdraw {
    IStarknetMessaging public immutable sn_core;
    address public immutable l1_bridge;
    uint256 public immutable l2_bridge;
    address public immutable l1_token;
    address public immutable l1_recipient;
    uint256[] public batch_sizes;

    constructor(
        address _sn_core,
        address _l1_bridge,
        uint256 _l2_bridge,
        address token,
        address recipient,
        uint256[] memory sizes
    ) {
        sn_core = IStarknetMessaging(_sn_core);
        l1_bridge = _l1_bridge;
        l2_bridge = _l2_bridge;
        l1_token = token;
        l1_recipient = recipient;
        for (uint256 i = 0; i < sizes.length; i++) {
            require(sizes[i] < 2**128, "AMOUNT_TOO_BIG");
            batch_sizes.push(sizes[i]);
        }
    }

    function withdrawMsgHash(uint256 amount) internal view returns (bytes32) {
        uint256[] memory payload = new uint256[](5);
        payload[0] = 0; //TRANSFER_FROM_STARKNET
        payload[1] = uint256(uint160(l1_recipient));
        payload[2] = uint256(uint160(l1_token));
        payload[3] = amount;
        payload[4] = 0;
        return sn_core.l2ToL1MsgHash(l2_bridge, l1_bridge, payload);
    }

    function pendingWithdrawals(uint256 amount) public view returns (uint256) {
        bytes32 msgHash = withdrawMsgHash(amount);
        return sn_core.l2ToL1Messages(msgHash);
    }

    function tick() external returns (uint256) {
        uint256 totalPending = 0;
        for (uint256 i = 0; i < batch_sizes.length; i++) {
            uint256 _amount = batch_sizes[i];
            uint256 _count = pendingWithdrawals(_amount);
            totalPending += _count;
            for (uint256 j = 0; j < _count; j++) {
                bytes memory _calldata = abi.encodeWithSelector(
                    ITokenWithdraw(l1_bridge).withdraw.selector,
                    l1_token,
                    _amount,
                    l1_recipient
                );

                (bool success, ) = l1_bridge.call(_calldata);
                if (!success) {
                    break;
                }
            }
        }
        return totalPending;
    }
}
IStarknetMessaging.sol 107 lines
/*
  Copyright 2019-2025 StarkWare Industries Ltd.

  Licensed under the Apache License, Version 2.0 (the "License").
  You may not use this file except in compliance with the License.
  You may obtain a copy of the License at

  https://www.starkware.co/open-source-license/

  Unless required by applicable law or agreed to in writing,
  software distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions
  and limitations under the License.
*/
// SPDX-License-Identifier: Apache-2.0.
pragma solidity >=0.6.0 <0.9.0;

import "starkware/starknet/solidity/IStarknetMessagingEvents.sol";

interface IStarknetMessaging is IStarknetMessagingEvents {
    /**
      Returns the max fee (in Wei) that StarkNet will accept per single message.
    */
    function getMaxL1MsgFee() external pure returns (uint256);

    /**
      Returns `msg_fee + 1` if there is a pending message associated with the given 'msgHash',
      otherwise, returns 0.
    */
    function l1ToL2Messages(bytes32 msgHash) external view returns (uint256);

    /**
      Returns number of consumable messages with hash of `msgHash`.
    */
    function l2ToL1Messages(bytes32 msgHash) external view returns (uint256);

    /**
      Returns the hash of an L1 -> L2 message.
    */
    function l1ToL2MsgHash(
        address fromAddress,
        uint256 toAddress,
        uint256 selector,
        uint256[] calldata payload,
        uint256 nonce
    ) external pure returns (bytes32);

    /**
      Returns the hash of an L2 -> L1 message.
    */
    function l2ToL1MsgHash(
        uint256 fromAddress,
        address toAddress,
        uint256[] calldata payload
    ) external pure returns (bytes32);

    /**
      Sends a message to an L2 contract.
      This function is payable, the payed amount is the message fee.

      Returns the hash of the message and the nonce of the message.
    */
    function sendMessageToL2(
        uint256 toAddress,
        uint256 selector,
        uint256[] calldata payload
    ) external payable returns (bytes32, uint256);

    /**
      Consumes a message that was sent from an L2 contract.

      Returns the hash of the message.
    */
    function consumeMessageFromL2(uint256 fromAddress, uint256[] calldata payload)
        external
        returns (bytes32);

    /**
      Starts the cancellation of an L1 to L2 message.
      A message can be canceled messageCancellationDelay() seconds after this function is called.

      Note: This function may only be called for a message that is currently pending and the caller
      must be the sender of the that message.
    */
    function startL1ToL2MessageCancellation(
        uint256 toAddress,
        uint256 selector,
        uint256[] calldata payload,
        uint256 nonce
    ) external returns (bytes32);

    /**
      Cancels an L1 to L2 message, this function should be called at least
      messageCancellationDelay() seconds after the call to startL1ToL2MessageCancellation().
      A message may only be cancelled by its sender.
      If the message is missing, the call will revert.

      Note that the message fee is not refunded.
    */
    function cancelL1ToL2Message(
        uint256 toAddress,
        uint256 selector,
        uint256[] calldata payload,
        uint256 nonce
    ) external returns (bytes32);
}
IStarknetMessagingEvents.sol 66 lines
/*
  Copyright 2019-2025 StarkWare Industries Ltd.

  Licensed under the Apache License, Version 2.0 (the "License").
  You may not use this file except in compliance with the License.
  You may obtain a copy of the License at

  https://www.starkware.co/open-source-license/

  Unless required by applicable law or agreed to in writing,
  software distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions
  and limitations under the License.
*/
// SPDX-License-Identifier: Apache-2.0.
pragma solidity >=0.6.0 <0.9.0;

interface IStarknetMessagingEvents {
    // This event needs to be compatible with the one defined in Output.sol.
    event LogMessageToL1(uint256 indexed fromAddress, address indexed toAddress, uint256[] payload);

    // An event that is raised when a message is sent from L1 to L2.
    event LogMessageToL2(
        address indexed fromAddress,
        uint256 indexed toAddress,
        uint256 indexed selector,
        uint256[] payload,
        uint256 nonce,
        uint256 fee
    );

    // An event that is raised when a message from L2 to L1 is consumed.
    event ConsumedMessageToL1(
        uint256 indexed fromAddress,
        address indexed toAddress,
        uint256[] payload
    );

    // An event that is raised when a message from L1 to L2 is consumed.
    event ConsumedMessageToL2(
        address indexed fromAddress,
        uint256 indexed toAddress,
        uint256 indexed selector,
        uint256[] payload,
        uint256 nonce
    );

    // An event that is raised when a message from L1 to L2 Cancellation is started.
    event MessageToL2CancellationStarted(
        address indexed fromAddress,
        uint256 indexed toAddress,
        uint256 indexed selector,
        uint256[] payload,
        uint256 nonce
    );

    // An event that is raised when a message from L1 to L2 is canceled.
    event MessageToL2Canceled(
        address indexed fromAddress,
        uint256 indexed toAddress,
        uint256 indexed selector,
        uint256[] payload,
        uint256 nonce
    );
}

Read Contract

batch_sizes 0xb3de8584 → uint256
l1_bridge 0xa1870a84 → address
l1_recipient 0xaee4e563 → address
l1_token 0x60057d37 → address
l2_bridge 0x2189b347 → uint256
pendingWithdrawals 0xe6150400 → uint256
sn_core 0xaaccf5ae → address

Write Contract 1 functions

These functions modify contract state and require a wallet transaction to execute.

tick 0x3eaf5d9f
No parameters
returns: uint256

Top Interactions

AddressTxnsSentReceived
0x785f2378...Dd2c 10 10

Recent Transactions

CSV
|
Hash Method Block Age From/To Value Txn Fee Type
0xfe7cfe35...46e61b 0x3eaf5d9f 24,323,492 IN 0x785f2378...Dd2c 0 ETH 0.000013182443 ETH EIP-1559
0x02dff1fb...9def6c 0x3eaf5d9f 24,290,128 IN 0x785f2378...Dd2c 0 ETH 0.000076300393 ETH EIP-1559
0x85120d95...70e824 0x3eaf5d9f 24,286,122 IN 0x785f2378...Dd2c 0 ETH 0.000005891764 ETH EIP-1559
0xaa5dca4f...5744a5 0x3eaf5d9f 24,286,025 IN 0x785f2378...Dd2c 0 ETH 0.000011081532 ETH EIP-1559
0x75c4305f...f9526a 0x3eaf5d9f 24,177,497 IN 0x785f2378...Dd2c 0 ETH 0.000014064011 ETH EIP-1559
0xe9747f75...e8977d 0x3eaf5d9f 24,172,112 IN 0x785f2378...Dd2c 0 ETH 0.000008355961 ETH EIP-1559
0x54e02e8d...f01f29 0x3eaf5d9f 24,171,113 IN 0x785f2378...Dd2c 0 ETH 0.000012081984 ETH EIP-1559
0xda890dcb...36597f 0x3eaf5d9f 24,162,755 IN 0x785f2378...Dd2c 0 ETH 0.000008998153 ETH EIP-1559
0xb832d3c6...c923a9 0x3eaf5d9f 24,158,531 IN 0x785f2378...Dd2c 0 ETH 0.000004142326 ETH EIP-1559
0x8e79f1fe...bdef7a 0x3eaf5d9f 24,151,148 IN 0x785f2378...Dd2c 0 ETH 0.000004502750 ETH EIP-1559