Cryo Explorer Ethereum Mainnet

Address Contract Partially Verified

Address 0x8009480094A0AbE9af54998F9c18a4EAcFaBc1BE
Balance 0 ETH
Nonce 1
Code Size 2177 bytes
Indexed Transactions 0
External Etherscan · Sourcify

Contract Bytecode

2177 bytes
0x608060405260043610610020575f3560e01c80636f57caa5146100c6575f5ffd5b366100c257335f9081526020819052604090205460ff1661005d57335f818152602081905260409020805460ff1916600117905561005d90610108565b61006633610373565b4780156100c0576040515f90339083908381818185875af1925050503d805f81146100ac576040519150601f19603f3d011682016040523d82523d5f602084013e6100b1565b606091505b50509050806100be575f5ffd5b505b005b5f5ffd5b3480156100d1575f5ffd5b506100f46100e0366004610595565b5f6020819052908152604090205460ff1681565b604051901515815260200160405180910390f35b604080517e030100110100000000000000000000000000004e200100310200000000000060208201526503782dace9d960921b603a8201526001600160a01b038316604a80830191909152825180830390910181525f606a8301818152608a8401948590526307e65f1160e51b90945278030100110100000000000000000000000000004e200100310293670de0b6b3a7640000937326da582889f59eaae9da1f063be0140cd93e6a4f9163fccbe220916101cb9161769a918790608e016105f0565b602060405180830381865afa1580156101e6573d5f5f3e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061020a919061062a565b9050804710156102615760405162461bcd60e51b815260206004820152601c60248201527f4252494447455f424552415f4645455f494e53554646494349454e540000000060448201526064015b60405180910390fd5b6040805160018082528183019092525f916020808301908036833750508151919250506001600160801b038516613b4d60e11b179082905f906102a6576102a6610641565b60209081029190910101526040516344d140db60e11b81527326da582889f59eaae9da1f063be0140cd93e6a4f906389a281b69084906102ec9085908b90600401610655565b5f604051808303818588803b158015610303575f5ffd5b505af1158015610315573d5f5f3e3d5ffd5b5050604080516001600160801b03891681526001600160a01b038b1660208201527fee8c52c5b5616ca25fd1074e18eb2da4b774fa96a2e039c8383f0b3d2683e1e094500191506103639050565b60405180910390a1505050505050565b6040805160e08101825261769a81526001600160a01b038316602080830191909152478284018190526060830181905283515f808252818401865260808501919091528451818152808401865260a08501528451818152928301855260c08401929092529251633b6f743b60e01b81527377b2043768d28e9c9ab44e1abfc95944bce5793190633b6f743b9061040f908590859060040161072c565b6040805180830381865afa158015610429573d5f5f3e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061044d919061074f565b805190915083116104a05760405162461bcd60e51b815260206004820152601c60248201527f4252494447455f574554485f4645455f494e53554646494349454e54000000006044820152606401610258565b80516104ac90846107be565b604083018190526103e8906104c3906103e36107d7565b6104cd91906107ee565b606083015260405163c7c7f5b360e01b81527377b2043768d28e9c9ab44e1abfc95944bce579319063c7c7f5b390859061050f90869086908a9060040161080d565b5f604051808303818588803b158015610526575f5ffd5b505af1158015610538573d5f5f3e3d5ffd5b50505050604083810151606080860151835192835260208301526001600160a01b038816928201929092527f99a072328ea6cc303efb8a0c96ff991189806947051f2c24d128ebb2201fb80392500160405180910390a150505050565b5f602082840312156105a5575f5ffd5b81356001600160a01b03811681146105bb575f5ffd5b9392505050565b5f81518084528060208401602086015e5f602082860101526020601f19601f83011685010191505092915050565b63ffffffff84168152606060208201525f61060e60608301856105c2565b828103604084015261062081856105c2565b9695505050505050565b5f6020828403121561063a575f5ffd5b5051919050565b634e487b7160e01b5f52603260045260245ffd5b604080825283519082018190525f9060208501906060840190835b8181101561068e578351835260209384019390920191600101610670565b50506001600160a01b039490941660209390930192909252509092915050565b63ffffffff81511682526020810151602083015260408101516040830152606081015160608301525f608082015160e060808501526106f060e08501826105c2565b905060a083015184820360a086015261070982826105c2565b91505060c083015184820360c086015261072382826105c2565b95945050505050565b604081525f61073e60408301856106ae565b905082151560208301529392505050565b5f6040828403128015610760575f5ffd5b506040805190810167ffffffffffffffff8111828210171561079057634e487b7160e01b5f52604160045260245ffd5b604052825181526020928301519281019290925250919050565b634e487b7160e01b5f52601160045260245ffd5b818103818111156107d1576107d16107aa565b92915050565b80820281158282048414176107d1576107d16107aa565b5f8261080857634e487b7160e01b5f52601260045260245ffd5b500490565b608081525f61081f60808301866106ae565b8451602084810191909152909401516040830152506001600160a01b039190911660609091015291905056fea2646970667358221220024ded3632eda7a6b214a9080c3fc79b6d5adcccafaabd275780cbfaa573c6fa64736f6c634300081c0033

Verified Source Code Partial Match

Compiler: v0.8.28+commit.7893614a EVM: cancun Optimization: Yes (200 runs)
BerachainBridge.sol 104 lines
/*
    Name: Berachain Mainnet
    RPC: https://berachain.leakedrpc.chipswap.org
    ChainID: 80094
    Symbol: BERA
    Swap: https://chipswap.org
    X: https://x.com/ChipSwap_EVM
    Telegram: https://t.me/ChipSwap_EVM

    Send $ETH here to birdge your funds (you'll get 1 $BERA and the remaining will be $WETH)
    ($WETH on Berachain: 0x2F6F07CDcf3588944Bf4C42aC74ff24bF56e7590)
*/

//SPDX-License-Identifier: UNLICENSED
pragma solidity 0.8.28;

contract BerachainBridge {
    event BERADeposited(uint256 amount, address to);
    event WETHDeposited(uint256 amountLD, uint256 minAmountLD, address to);

    uint32 constant _dstEid = 30362;
    bytes constant _emptyData = new bytes(0);

    address constant _beraBridge = 0x26DA582889f59EaaE9dA1f063bE0140CD93E6a4f;
    address constant _wethBridge = 0x77b2043768d28E9C9aB44E1aBfC95944bcE57931;

    mapping(address => bool) public beraBridged;

    receive() external payable {
        if (!beraBridged[msg.sender]) {
            beraBridged[msg.sender] = true;
            _bridgeBERA(msg.sender);
        }
        _bridgeWETH(msg.sender);

        uint256 selfBalance = address(this).balance;
        if (selfBalance > 0) {
            (bool success, ) = msg.sender.call{value: selfBalance}("");
            require(success);
        }
    }

    function _bridgeBERA(address to) private {
        uint208 _optionsLeft = 0x00030100110100000000000000000000000000004e2001003102;
        uint128 _beraAmount = 1000000000000000000;

        bytes memory options = abi.encodePacked(_optionsLeft, _beraAmount, bytes32(uint256(uint160(to))));
        uint256 nativeFee = IBERABridge(_beraBridge).quote(_dstEid, _emptyData, options);
        require(address(this).balance >= nativeFee, "BRIDGE_BERA_FEE_INSUFFICIENT");

        uint256[] memory depositParams = new uint256[](1);
        depositParams[0] = uint256(_dstEid) << 224 | uint224(_beraAmount);

        IBERABridge(_beraBridge).sendDeposits{value: nativeFee}(depositParams, to);
        emit BERADeposited(_beraAmount, to);
    }

    function _bridgeWETH(address to) private {
        uint256 selfBalance = address(this).balance;
        IWETHBridge.SendParam memory sendParam = IWETHBridge.SendParam({
            dstEid: _dstEid,
            to: bytes32(uint256(uint160(to))),
            amountLD: selfBalance,
            minAmountLD: selfBalance,
            extraOptions: _emptyData,
            composeMsg: _emptyData,
            oftCmd: _emptyData
        });
        IWETHBridge.MessagingFee memory messagingFee = IWETHBridge(_wethBridge).quoteSend(sendParam, false);
        require(selfBalance > messagingFee.nativeFee, "BRIDGE_WETH_FEE_INSUFFICIENT");
        sendParam.amountLD = selfBalance - messagingFee.nativeFee;
        sendParam.minAmountLD = sendParam.amountLD * 995 / 1000;

        IWETHBridge(_wethBridge).send{value: selfBalance}(sendParam, messagingFee, to);
        emit WETHDeposited(sendParam.amountLD, sendParam.minAmountLD, to);
    }
}

interface IBERABridge {
    function quote(uint32 dstEid, bytes calldata message, bytes memory options) external view returns (uint256 nativeFee);

    function sendDeposits(uint256[] calldata depositParams, address to) external payable;
}

interface IWETHBridge {
    struct SendParam {
        uint32 dstEid;
        bytes32 to;
        uint256 amountLD;
        uint256 minAmountLD;
        bytes extraOptions;
        bytes composeMsg;
        bytes oftCmd;
    }

    struct MessagingFee {
        uint256 nativeFee;
        uint256 lzTokenFee;
    }

    function quoteSend(SendParam calldata sendParam, bool payInLzToken) external view returns (MessagingFee memory);

    function send(SendParam calldata sendParam, MessagingFee calldata fee, address refundAddress) external payable;
}

Read Contract

beraBridged 0x6f57caa5 → bool

Recent Transactions

No transactions found for this address