Cryo Explorer Ethereum Mainnet

Address Contract Verified

Address 0xcB3358afef9Bd888D8bfed436C4Ef072600397cc
Balance 0 ETH
Nonce 1
Code Size 5236 bytes
Indexed Transactions 0
External Etherscan · Sourcify

Contract Bytecode

5236 bytes
0x6080604052600436106100aa575f3560e01c80639e281a98116100635780639e281a98146101bb578063ad5c4648146101e3578063d33355531461020d578063d9fb643a14610235578063e00bfe501461025f578063fd9f8a9514610289576100ab565b806316d929f4146100ad57806329a83bd9146100d75780632dcd62ac1461010157806338ffdeed1461012b5780633fd8635f146101675780638265b12114610191576100ab565b5b005b3480156100b8575f5ffd5b506100c16102b9565b6040516100ce9190610f7c565b60405180910390f35b3480156100e2575f5ffd5b506100eb6102d1565b6040516100f89190610fad565b60405180910390f35b34801561010c575f5ffd5b506101156103e7565b6040516101229190610fe6565b60405180910390f35b348015610136575f5ffd5b50610151600480360381019061014c919061102d565b6103ff565b60405161015e9190610fad565b60405180910390f35b348015610172575f5ffd5b5061017b61057c565b6040516101889190610fad565b60405180910390f35b34801561019c575f5ffd5b506101a5610603565b6040516101b2919061108b565b60405180910390f35b3480156101c6575f5ffd5b506101e160048036038101906101dc91906110df565b61061b565b005b3480156101ee575f5ffd5b506101f7610728565b604051610204919061113d565b60405180910390f35b348015610218575f5ffd5b50610233600480360381019061022e9190611156565b610740565b005b348015610240575f5ffd5b50610249610870565b60405161025691906111a1565b60405180910390f35b34801561026a575f5ffd5b50610273610888565b60405161028091906111da565b60405180910390f35b6102a3600480360381019061029e9190611156565b6108a0565b6040516102b09190610fad565b60405180910390f35b736c8550167bbd06d4610a6a443ecbed84bd1accd681565b5f7317144556fd3424edc8fc8a4c940b2d04936d17eb73ffffffffffffffffffffffffffffffffffffffff16631ea7ca896040518163ffffffff1660e01b8152600401602060405180830381865afa15801561032f573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906103539190611228565b15610360575f90506103e4565b7317144556fd3424edc8fc8a4c940b2d04936d17eb73ffffffffffffffffffffffffffffffffffffffff1663609c4c6c6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156103bd573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906103e19190611267565b90505b90565b73dd3f50f8a6cafbe9b31a427582963f465e745af881565b5f73c02aaa39b223fe8d0a0e5c4f27ead9083c756cc273ffffffffffffffffffffffffffffffffffffffff166323b872dd3330866040518463ffffffff1660e01b8152600401610451939291906112a1565b6020604051808303815f875af115801561046d573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906104919190611228565b5073c02aaa39b223fe8d0a0e5c4f27ead9083c756cc273ffffffffffffffffffffffffffffffffffffffff16632e1a7d4d846040518263ffffffff1660e01b81526004016104df9190610fad565b5f604051808303815f87803b1580156104f6575f5ffd5b505af1158015610508573d5f5f3e3d5ffd5b505050505f5f610518858561090f565b915091503373ffffffffffffffffffffffffffffffffffffffff167f74d1167aca1307348552608bcf93e1da68a1e25669b1bb18a5de3ca1ad463536868685600160405161056994939291906112e5565b60405180910390a2809250505092915050565b5f73dd3f50f8a6cafbe9b31a427582963f465e745af873ffffffffffffffffffffffffffffffffffffffff16631eddb6266040518163ffffffff1660e01b8152600401602060405180830381865afa1580156105da573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906105fe9190611267565b905090565b73ae78736cd615f374d3085123a210448e74fc639381565b732375022e90098b6a1bf1bda066f550022beb0bfa73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610694576040517f82b4290000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8173ffffffffffffffffffffffffffffffffffffffff1663a9059cbb732375022e90098b6a1bf1bda066f550022beb0bfa836040518363ffffffff1660e01b81526004016106e3929190611328565b6020604051808303815f875af11580156106ff573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906107239190611228565b505050565b73c02aaa39b223fe8d0a0e5c4f27ead9083c756cc281565b732375022e90098b6a1bf1bda066f550022beb0bfa73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146107b9576040517f82b4290000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f732375022e90098b6a1bf1bda066f550022beb0bfa73ffffffffffffffffffffffffffffffffffffffff16826040516107f29061137c565b5f6040518083038185875af1925050503d805f811461082c576040519150601f19603f3d011682016040523d82523d5f602084013e610831565b606091505b505090508061086c576040517fb12d13eb00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5050565b737f39c581f595b53c5cb19bd0b3f8da6c935e2ca081565b7317144556fd3424edc8fc8a4c940b2d04936d17eb81565b5f5f5f6108ad348561090f565b915091503373ffffffffffffffffffffffffffffffffffffffff167f74d1167aca1307348552608bcf93e1da68a1e25669b1bb18a5de3ca1ad4635363486855f6040516108fd94939291906112e5565b60405180910390a28092505050919050565b5f5f5f61091a6102d1565b90508085116109e1575f61092e8686610ae6565b9050736c8550167bbd06d4610a6a443ecbed84bd1accd673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33836040518363ffffffff1660e01b815260040161097f929190611328565b6020604051808303815f875af115801561099b573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906109bf9190611228565b50737f39c581f595b53c5cb19bd0b3f8da6c935e2ca081935093505050610adf565b6109e961057c565b8511610aad575f6109fa8686610cb8565b9050736c8550167bbd06d4610a6a443ecbed84bd1accd673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33836040518363ffffffff1660e01b8152600401610a4b929190611328565b6020604051808303815f875af1158015610a67573d5f5f3e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610a8b9190611228565b5073ae78736cd615f374d3085123a210448e74fc639381935093505050610adf565b6040517f3c0b6b7e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b9250929050565b5f5f7317144556fd3424edc8fc8a4c940b2d04936d17eb73ffffffffffffffffffffffffffffffffffffffff1663a1903eab855f6040518363ffffffff1660e01b8152600401610b369190611390565b60206040518083038185885af1158015610b52573d5f5f3e3d5ffd5b50505050506040513d601f19601f82011682018060405250810190610b779190611267565b90505f737f39c581f595b53c5cb19bd0b3f8da6c935e2ca073ffffffffffffffffffffffffffffffffffffffff1663ea598cb0836040518263ffffffff1660e01b8152600401610bc79190610fad565b6020604051808303815f875af1158015610be3573d5f5f3e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610c079190611267565b9050736c8550167bbd06d4610a6a443ecbed84bd1accd673ffffffffffffffffffffffffffffffffffffffff1663156e29f6737f39c581f595b53c5cb19bd0b3f8da6c935e2ca083876040518463ffffffff1660e01b8152600401610c6e939291906113a9565b6020604051808303815f875af1158015610c8a573d5f5f3e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610cae9190611267565b9250505092915050565b5f5f73ae78736cd615f374d3085123a210448e74fc639373ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401610d079190611390565b602060405180830381865afa158015610d22573d5f5f3e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610d469190611267565b905073dd3f50f8a6cafbe9b31a427582963f465e745af873ffffffffffffffffffffffffffffffffffffffff1663d0e30db0856040518263ffffffff1660e01b81526004015f604051808303818588803b158015610da2575f5ffd5b505af1158015610db4573d5f5f3e3d5ffd5b50505050505f8173ae78736cd615f374d3085123a210448e74fc639373ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401610e089190611390565b602060405180830381865afa158015610e23573d5f5f3e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610e479190611267565b610e51919061140b565b9050736c8550167bbd06d4610a6a443ecbed84bd1accd673ffffffffffffffffffffffffffffffffffffffff1663156e29f673ae78736cd615f374d3085123a210448e74fc639383876040518463ffffffff1660e01b8152600401610eb8939291906113a9565b6020604051808303815f875af1158015610ed4573d5f5f3e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610ef89190611267565b9250505092915050565b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f819050919050565b5f610f44610f3f610f3a84610f02565b610f21565b610f02565b9050919050565b5f610f5582610f2a565b9050919050565b5f610f6682610f4b565b9050919050565b610f7681610f5c565b82525050565b5f602082019050610f8f5f830184610f6d565b92915050565b5f819050919050565b610fa781610f95565b82525050565b5f602082019050610fc05f830184610f9e565b92915050565b5f610fd082610f4b565b9050919050565b610fe081610fc6565b82525050565b5f602082019050610ff95f830184610fd7565b92915050565b5f5ffd5b61100c81610f95565b8114611016575f5ffd5b50565b5f8135905061102781611003565b92915050565b5f5f6040838503121561104357611042610fff565b5b5f61105085828601611019565b925050602061106185828601611019565b9150509250929050565b5f61107582610f4b565b9050919050565b6110858161106b565b82525050565b5f60208201905061109e5f83018461107c565b92915050565b5f6110ae82610f02565b9050919050565b6110be816110a4565b81146110c8575f5ffd5b50565b5f813590506110d9816110b5565b92915050565b5f5f604083850312156110f5576110f4610fff565b5b5f611102858286016110cb565b925050602061111385828601611019565b9150509250929050565b5f61112782610f4b565b9050919050565b6111378161111d565b82525050565b5f6020820190506111505f83018461112e565b92915050565b5f6020828403121561116b5761116a610fff565b5b5f61117884828501611019565b91505092915050565b5f61118b82610f4b565b9050919050565b61119b81611181565b82525050565b5f6020820190506111b45f830184611192565b92915050565b5f6111c482610f4b565b9050919050565b6111d4816111ba565b82525050565b5f6020820190506111ed5f8301846111cb565b92915050565b5f8115159050919050565b611207816111f3565b8114611211575f5ffd5b50565b5f81519050611222816111fe565b92915050565b5f6020828403121561123d5761123c610fff565b5b5f61124a84828501611214565b91505092915050565b5f8151905061126181611003565b92915050565b5f6020828403121561127c5761127b610fff565b5b5f61128984828501611253565b91505092915050565b61129b816110a4565b82525050565b5f6060820190506112b45f830186611292565b6112c16020830185611292565b6112ce6040830184610f9e565b949350505050565b6112df816111f3565b82525050565b5f6080820190506112f85f830187610f9e565b6113056020830186610f9e565b6113126040830185611292565b61131f60608301846112d6565b95945050505050565b5f60408201905061133b5f830185611292565b6113486020830184610f9e565b9392505050565b5f81905092915050565b50565b5f6113675f8361134f565b915061137282611359565b5f82019050919050565b5f6113868261135c565b9150819050919050565b5f6020820190506113a35f830184611292565b92915050565b5f6060820190506113bc5f830186611292565b6113c96020830185610f9e565b6113d66040830184610f9e565b949350505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f61141582610f95565b915061142083610f95565b9250828203905081811115611438576114376113de565b5b9291505056fea264697066735822122062c2d9037892eaaf3ed10e560616a4724cba637ea3339a8a101397476b6d5b1764736f6c634300081c0033

Verified Source Code Full Match

Compiler: v0.8.28+commit.7893614a EVM: shanghai Optimization: No
BrktETHRouter.sol 113 lines
//SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.25;

import {STETH as STETH_ADDRESS, WSTETH as WSTETH_ADDRESS, BRKT_ETH as BRKTETH_ADDRESS, BRKT_MULTISIG, ROCKET_DEPOSIT_POOL as ROCKET_DEPOSIT_POOL_ADDRESS, RETH as RETH_ADDRESS, WETH as WETH_ADDRESS} from "script/Config.sol";
import {IBrktETHRouter} from "src/token/IBrktETHRouter.sol";
import {IERC20} from "openzeppelin-contracts/interfaces/IERC20.sol";
import {IBrktETH} from "src/token/IBrktETH.sol";
import {IstETH} from "src/interfaces/stETH/IstETH.sol";
import {IwstETH} from "src/interfaces/stETH/IwstETH.sol";
import {IWETH} from "src/interfaces/IWETH.sol";
import {RocketTokenRETHInterface} from "src/interfaces/rETH/RocketTokenRETHInterface.sol";
import {RocketDepositPoolInterface} from "src/interfaces/rETH/RocketDepositPoolInterface.sol";

contract BrktETHRouter is IBrktETHRouter {

    address constant OWNER = payable(BRKT_MULTISIG);

    IBrktETH public constant BRKTETH = IBrktETH(address(BRKTETH_ADDRESS));

    IstETH public constant STETH = IstETH(address(STETH_ADDRESS));
    IwstETH public constant WSTETH = IwstETH(address(WSTETH_ADDRESS));
    IWETH public constant WETH = IWETH(address(WETH_ADDRESS));

    RocketDepositPoolInterface public constant ROCKET_DEPOSIT_POOL = RocketDepositPoolInterface(address(ROCKET_DEPOSIT_POOL_ADDRESS));
    RocketTokenRETHInterface public constant RETH = RocketTokenRETHInterface(address(RETH_ADDRESS));

    modifier onlyOwner() {
        if (msg.sender != OWNER) revert Unauthorized();
        _;
    }

    constructor() {
        STETH.approve(address(WSTETH), type(uint256).max);
        WSTETH.approve(address(BRKTETH), type(uint256).max);
        RETH.approve(address(BRKTETH), type(uint256).max);
    }


    function ethToBrktETH(uint256 mintBrktAmount) public payable returns (uint256) {
        (address lstToken, uint256 brktAmount) = _ethToBrktETH(msg.value, mintBrktAmount);

        emit ETHToBrktETH(msg.sender, msg.value, mintBrktAmount, lstToken, false);

        return brktAmount;
    }

    function wethToBrktETH(uint256 amount, uint256 mintBrktAmount) public returns (uint256) {
        WETH.transferFrom(msg.sender, address(this), amount);
        WETH.withdraw(amount);

        (address lstToken, uint256 brktAmount) = _ethToBrktETH(amount, mintBrktAmount);

        emit ETHToBrktETH(msg.sender, amount, mintBrktAmount, lstToken, true);

        return brktAmount;
    }

    function _ethToBrktETH(uint256 value, uint256 mintBrktAmount) internal returns (address, uint256) {
        uint256 stEthLimit = lidoLimit();

        if (value <= stEthLimit) {
            uint256 brktAmount = _lidoEthToBrktETH(value, mintBrktAmount);
            BRKTETH.transfer(msg.sender, brktAmount);
            return (address(WSTETH), brktAmount);
        } else if (value <= rocketPoolLimit()) {
            uint256 brktAmount = _rocketPoolETHToBrktETH(value, mintBrktAmount);
            BRKTETH.transfer(msg.sender, brktAmount);
            return (address(RETH), brktAmount);
        } else {
            revert AmountOverStakingLimit();
        }
    }
    

    function lidoLimit() public view returns (uint256) {
        if (STETH.isStakingPaused()) {
            return 0;
        }
        return STETH.getCurrentStakeLimit();
    }

    function rocketPoolLimit() public view returns (uint256) {
        return ROCKET_DEPOSIT_POOL.getMaximumDepositAmount();
    }

    function _lidoEthToBrktETH(uint256 value, uint256 mintBrktAmount) internal returns (uint256) {
        uint256 stEthAmount = STETH.submit{value: value}(address(0));
        uint256 wstEthAmount = WSTETH.wrap(stEthAmount);
        return BRKTETH.mint(address(WSTETH), wstEthAmount, mintBrktAmount);
    }

    function _rocketPoolETHToBrktETH(uint256 value, uint256 mintBrktAmount) internal returns (uint256) {
        uint256 rEthBalanceBefore = RETH.balanceOf(address(this));

        ROCKET_DEPOSIT_POOL.deposit{value: value}();
        uint256 rEthAmount = RETH.balanceOf(address(this)) - rEthBalanceBefore;

        return BRKTETH.mint(address(RETH), rEthAmount, mintBrktAmount);
    }

    function recoverETH(uint256 amount) external onlyOwner {
        (bool success, ) = OWNER.call{value: amount}("");
        if (!success) revert ETHTransferFailed();
    }

    function withdrawToken(address token, uint256 amount) external onlyOwner {
        IERC20(token).transfer(OWNER, amount);
    }

    receive() external payable {}

    fallback() external payable {}
}
Config.sol 52 lines
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;

// Lido's Wrapped Staked ETH
address constant STETH = 0x17144556fd3424EDC8Fc8A4C940B2D04936d17eb;
address constant WSTETH = 0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0;
// Rocket Pool's ETH
address constant RETH = 0xae78736Cd615f374D3085123A210448E74Fc6393;
address constant ROCKET_DEPOSIT_POOL = 0xDD3f50F8A6CafbE9b31a427582963f465E745AF8;
// Renzo's Staked ETH
address constant EZETH = 0xbf5495Efe5DB9ce00f80364C8B423567e58d2110;
address constant RENZO_RATE_PROVIDER = 0x387dBc0fB00b26fb085aa658527D5BE98302c84C;
// Etherfi's ETH
address constant WEETH = 0xCd5fE23C85820F7B72D0926FC9b05b43E359b7ee;
// Kelp's DAO rsETH
address constant RSETH = 0xA1290d69c65A6Fe4DF752f95823fae25cB99e5A7;
address constant RSETH_LRT_ORACLE = 0x349A73444b1a310BAe67ef67973022020d70020d;
// Ankr's ETH
address constant ANKRETH = 0xE95A203B1a91a908F9B9CE46459d101078c2c3cb;
// Stakewise's osETH
address constant OSETH = 0xf1C9acDc66974dFB6dEcB12aA385b9cD01190E38;
address constant STAKEWISE_VAULT_CONTROLLER = 0x2A261e60FB14586B474C208b1B7AC6D0f5000306;
// Coinbase's cbETH
address constant CBETH = 0xBe9895146f7AF43049ca1c1AE358B0541Ea49704;
// Frax's sfrxETH
address constant SFRXETH = 0xac3E018457B222d93114458476f3E3416Abbe38F;
// StakeStone's ETH
address constant STONE = 0x7122985656e38BDC0302Db86685bb972b145bD3C;
address constant STONE_ORACLE = 0xcF45D565252D56b5d377631982c8543e80a4c6a1;
// Wrapped Ether
address constant WETH = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2;

// Bracket Contracts
address constant BRKT_ORACLE = 0x65e9aB10f4C4b9005E13195f94E4a2c6db041154;
address constant BRKT_ETH = 0x6C8550167BbD06D4610a6A443eCbEd84Bd1AccD6;
address constant BRKT_VAULT_FACTORY = 0xd206701137299635191Cf3cdf524B42923F97485;
address constant BRKT_VAULT_BEACON = 0x8c24Dda4B2124D0fD8334D731EA345c7745C00d1;
// Bracket Accounts
address constant BRKT_MULTISIG = 0x2375022E90098b6a1bf1Bda066F550022beb0BFA;
address constant NAV_UPDATER_MULTISIG = 0xc3AFCcfC3B59F9f5046477cd9410C263191161e2;
address constant BRKT_STRATEGY_DEPLOYER = 0xF037FaddD03f9E4FBe2c22314f483C4dca5b06A2;

/*
- Bracket Public Contracts -
Bracket Oracle: 0x65e9aB10f4C4b9005E13195f94E4a2c6db041154
BrktETH: 0x6C8550167BbD06D4610a6A443eCbEd84Bd1AccD6
Vault Factory: 0xd206701137299635191Cf3cdf524B42923F97485

- Implementation Contracts -
BrktETH Implementation: 0x22ad51aDcb087eD283F05173E1dB478C0bDC0640
Vault Beacon: 0x8c24Dda4B2124D0fD8334D731EA345c7745C00d1
*/
IBrktETHRouter.sol 18 lines
//SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.25;

interface IBrktETHRouter {
    error AmountOverStakingLimit();
    error ETHTransferFailed();
    error Unauthorized();

    event ETHToBrktETH(address indexed sender, uint256 value, uint256 mintBrktAmount, address lstToken, bool wrapped);

    function ethToBrktETH(uint256 mintBrktAmount) external payable returns (uint256);

    function wethToBrktETH(uint256 amount, uint256 mintBrktAmount) external returns (uint256);

    function lidoLimit() external view returns (uint256);

    function rocketPoolLimit() external view returns (uint256);
}
IERC20.sol 6 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC20.sol)

pragma solidity ^0.8.20;

import {IERC20} from "../token/ERC20/IERC20.sol";
IBrktETH.sol 136 lines
//SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.25;

import {IERC20} from "openzeppelin-contracts/interfaces/IERC20.sol";

interface IBrktETH is IERC20 {
    enum WithdrawalStatus {
        Unset,
        Queued,
        Ready,
        Completed
    }

    struct CollateralInfo {
        address collateral;
        bool whitelisted;
        uint256 totalDeposit;
    }

    error CollateralNotSupported();
    error CollateralNotWhitelisted();
    error CollateralNotBlacklisted();
    error CollateralAlreadyExists();
    error CollateralNotExists();
    error CollateralNotEmpty();
    error DiffArraySize();
    error MaxAmountInExceeded();
    error MaxCollateralsReached();
    error MinAmountOutNotMet();
    error NotEnoughCollateral();
    error SameCollateral();
    error WithdrawalAlreadyQueued();
    error WithdrawalNotReady();
    error ZeroAddress();
    error ZeroAmount();

    event Mint(address indexed user, address token, uint256 colAmount, uint256 brktAmount);
    event Mint(address indexed user, address[] tokens, uint256[] colAmounts, uint256 brktAmount);
    event WithdrawalScheduled(
        address indexed user, address token, uint256 colAmount, uint256 brktAmount, uint256 timestamp, bytes32 salt
    );
    event WithdrawalClaimed(address indexed user, address token, uint256 colAmount, uint256 scheduledTimestamp);

    /// @notice Mints brktETH tokens in exchange for a single collateral token
    /// @param token Address of the collateral token
    /// @param amount Amount of collateral token to deposit
    /// @param minBrktAmount Minimum amount of brktETH to receive
    /// @return brktAmount Amount of brktETH minted
    function mint(address token, uint256 amount, uint256 minBrktAmount) external returns (uint256 brktAmount);
    
    /// @notice Burns brktETH tokens and queues withdrawal of a specific collateral token
    /// @param token Address of the collateral token to receive
    /// @param amount Amount of brktETH to burn
    /// @param minColAmount Minimum amount of collateral token to receive
    /// @param salt A random bytes32 value to prevent hash collisions
    /// @return Amount of collateral token returned
    function burn(address token, uint256 amount, uint256 minColAmount, bytes32 salt) external returns (uint256);

    /// @notice Claims a previously scheduled withdrawal of collateral tokens
    /// @dev This function can only be called after the withdrawal delay has passed
    /// @param token The address of the collateral token to be withdrawn
    /// @param amount The amount of collateral token to be withdrawn
    /// @param salt A random bytes32 value to prevent hash collisions
    /// @param timestamp The timestamp when the withdrawal delay is over
    function claimWithdrawal(address token, uint256 amount, uint256 timestamp, bytes32 salt) external;

    /// @notice Calculates the amount of brktETH that would be minted for a given collateral deposit
    /// @param token Address of the collateral token
    /// @param amount Amount of collateral token
    /// @return Amount of brktETH that would be minted
    function calculateMint(address token, uint256 amount) external view returns (uint256);

    /// @notice Whitelists a collateral token
    /// @param token Address of the collateral token to whitelist
    function whitelistCollateral(address token) external;

    /// @notice Blacklists a collateral token
    /// @param token Address of the collateral token to blacklist
    function blacklistCollateral(address token) external;

    function getBracketRate() external view returns (uint256);

    function getCollateralInfo(address token) external view returns (CollateralInfo memory);

    /// @notice Sets the oracle contract address
    /// @param _oracle New oracle contract address
    function setOracle(address _oracle) external;

    /// @notice Adds a new collateral token
    /// @param token Address of the new collateral token
    function addCollateral(address token) external;

    /// @notice Gets the value in ETH for a given amount of brktETH
    /// @param amount Amount of brktETH
    /// @return Value in ETH
    function getBracketValue(uint256 amount) external view returns (uint256);

    /// @notice Gets the total value of all collateral held by the contract
    /// @return TVL in ETH
    function getTotalValue() external returns (uint256);

    /// @dev Calculates the amount of brktETH to mint for a given value
    /// @param value Value in ETH
    /// @return brktAmount Amount of brktETH to mint
    function calculateMint(uint256 value) external returns (uint256 brktAmount);

    /// @dev Calculates the amount of collateral to return when burning brktETH
    /// @param brktAmount Amount of brktETH to burn
    /// @param token Address of the collateral token to return
    /// @return Amount of collateral token to return
    function calculateBurn(uint256 brktAmount, address token) external returns (uint256);

    /// @notice Computes the hash of a withdrawal request
    /// @dev This hash is used as a unique identifier for each withdrawal request
    /// @param user The address of the user requesting the withdrawal
    /// @param token The address of the token to be withdrawn
    /// @param amount The amount of tokens to be withdrawn
    /// @param time The timestamp when the withdrawal will be available
    /// @param salt A random bytes32 value to prevent hash collisions
    /// @return The keccak256 hash of the encoded withdrawal request parameters
    function hashWithdrawal(address user, address token, uint256 amount, uint256 time, bytes32 salt) external returns (bytes32);

    /// @notice Retrieves the status and hash of a withdrawal request
    /// @dev This function checks the current status of a withdrawal and returns its corresponding hash
    /// @param user The address of the user who initiated the withdrawal
    /// @param token The address of the token to be withdrawn
    /// @param amount The amount of tokens to be withdrawn
    /// @param timestamp The timestamp when the withdrawal was initiated
    /// @param salt A random bytes32 value to prevent hash collisions
    /// @return WithdrawalStatus The current status of the withdrawal (Unset, Queued, Ready, or Completed)
    /// @return bytes32 The unique hash identifying the withdrawal request
    function getWithdrawalStatusAndHash(address user, address token, uint256 amount, uint256 timestamp, bytes32 salt)
        external
        view
        returns (WithdrawalStatus, bytes32);
}
IstETH.sol 26 lines
//SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.25;

import {IERC20} from "openzeppelin-contracts/interfaces/IERC20.sol";

interface IstETH is IERC20 {
    /**
     * @notice Send funds to the pool with optional _referral parameter
     * @dev This function is alternative way to submit funds. Supports optional referral address.
     * @return Amount of StETH shares generated
     */
    function submit(address _referral) external payable returns (uint256);

    /**
     * @notice Check staking state: whether it's paused or not
     */
    function isStakingPaused() external view returns (bool);

    /**
     * @notice Returns how much Ether can be staked in the current block
     * @dev Special return values:
     * - 2^256 - 1 if staking is unlimited;
     * - 0 if staking is paused or if limit is exhausted.
     */
    function getCurrentStakeLimit() external view returns (uint256);
}
IwstETH.sol 19 lines
//SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.25;

import {IERC20} from "openzeppelin-contracts/interfaces/IERC20.sol";

interface IwstETH is IERC20 {
    /**
     * @notice Exchanges stETH to wstETH
     * @param _stETHAmount amount of stETH to wrap in exchange for wstETH
     * @dev Requirements:
     *  - `_stETHAmount` must be non-zero
     *  - msg.sender must approve at least `_stETHAmount` stETH to this
     *    contract.
     *  - msg.sender must have at least `_stETHAmount` of stETH.
     * User should first approve _stETHAmount to the WstETH contract
     * @return Amount of wstETH user receives after wrap
     */
    function wrap(uint256 _stETHAmount) external returns (uint256);
}
IWETH.sol 18 lines
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

interface IWETH {

    function deposit() external payable;

    function withdraw(uint) external;

    function approve(address, uint) external returns(bool);

    function transfer(address, uint) external returns(bool);

    function transferFrom(address, address, uint) external returns(bool);

    function balanceOf(address) external view returns(uint);

}
RocketTokenRETHInterface.sol 43 lines
/**
  *       .
  *      / \
  *     |.'.|
  *     |'.'|
  *   ,'|   |`.
  *  |,-'-|-'-.|
  *   __|_| |         _        _      _____           _
  *  | ___ \|        | |      | |    | ___ \         | |
  *  | |_/ /|__   ___| | _____| |_   | |_/ /__   ___ | |
  *  |    // _ \ / __| |/ / _ \ __|  |  __/ _ \ / _ \| |
  *  | |\ \ (_) | (__|   <  __/ |_   | | | (_) | (_) | |
  *  \_| \_\___/ \___|_|\_\___|\__|  \_|  \___/ \___/|_|
  * +---------------------------------------------------+
  * |    DECENTRALISED STAKING PROTOCOL FOR ETHEREUM    |
  * +---------------------------------------------------+
  *
  *  Rocket Pool is a first-of-its-kind Ethereum staking pool protocol, designed to
  *  be community-owned, decentralised, and trustless.
  *
  *  For more information about Rocket Pool, visit https://rocketpool.net
  *
  *  Authors: David Rugendyke, Jake Pospischil, Kane Wallmann, Darren Langley, Joe Clapis, Nick Doherty
  *
  */

pragma solidity >0.5.0 <0.9.0;

// SPDX-License-Identifier: GPL-3.0-only

import {IERC20} from "openzeppelin-contracts/interfaces/IERC20.sol";

interface RocketTokenRETHInterface is IERC20 {
    function getEthValue(uint256 _rethAmount) external view returns (uint256);
    function getRethValue(uint256 _ethAmount) external view returns (uint256);
    function getExchangeRate() external view returns (uint256);
    function getTotalCollateral() external view returns (uint256);
    function getCollateralRate() external view returns (uint256);
    function depositExcess() external payable;
    function depositExcessCollateral() external;
    function mint(uint256 _ethAmount, address _to) external;
    function burn(uint256 _rethAmount) external;
}
RocketDepositPoolInterface.sol 46 lines
/**
  *       .
  *      / \
  *     |.'.|
  *     |'.'|
  *   ,'|   |`.
  *  |,-'-|-'-.|
  *   __|_| |         _        _      _____           _
  *  | ___ \|        | |      | |    | ___ \         | |
  *  | |_/ /|__   ___| | _____| |_   | |_/ /__   ___ | |
  *  |    // _ \ / __| |/ / _ \ __|  |  __/ _ \ / _ \| |
  *  | |\ \ (_) | (__|   <  __/ |_   | | | (_) | (_) | |
  *  \_| \_\___/ \___|_|\_\___|\__|  \_|  \___/ \___/|_|
  * +---------------------------------------------------+
  * |  DECENTRALISED STAKING PROTOCOL FOR ETHEREUM 2.0  |
  * +---------------------------------------------------+
  *
  *  Rocket Pool is a first-of-its-kind ETH2 Proof of Stake protocol, designed to be community owned,
  *  decentralised, trustless and compatible with staking in Ethereum 2.0.
  *
  *  For more information about Rocket Pool, visit https://rocketpool.net
  *
  *  Authors: David Rugendyke, Jake Pospischil, Kane Wallmann, Darren Langley, Joe Clapis, Nick Doherty
  *
  */

pragma solidity >0.5.0 <0.9.0;

// SPDX-License-Identifier: GPL-3.0-only

interface RocketDepositPoolInterface {
    function getBalance() external view returns (uint256);
    function getNodeBalance() external view returns (uint256);
    function getUserBalance() external view returns (int256);
    function getExcessBalance() external view returns (uint256);
    function deposit() external payable;
    function getMaximumDepositAmount() external view returns (uint256);
    function nodeDeposit(uint256 _totalAmount) external payable;
    function nodeCreditWithdrawal(uint256 _amount) external;
    function recycleDissolvedDeposit() external payable;
    function recycleExcessCollateral() external payable;
    function recycleLiquidatedStake() external payable;
    function assignDeposits() external;
    function maybeAssignDeposits() external returns (bool);
    function withdrawExcessBalance(uint256 _amount) external;
}
IERC20.sol 79 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.20;

/**
 * @dev Interface of the ERC-20 standard as defined in the ERC.
 */
interface IERC20 {
    /**
     * @dev Emitted when `value` tokens are moved from one account (`from`) to
     * another (`to`).
     *
     * Note that `value` may be zero.
     */
    event Transfer(address indexed from, address indexed to, uint256 value);

    /**
     * @dev Emitted when the allowance of a `spender` for an `owner` is set by
     * a call to {approve}. `value` is the new allowance.
     */
    event Approval(address indexed owner, address indexed spender, uint256 value);

    /**
     * @dev Returns the value of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

    /**
     * @dev Returns the value of tokens owned by `account`.
     */
    function balanceOf(address account) external view returns (uint256);

    /**
     * @dev Moves a `value` amount of tokens from the caller's account to `to`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address to, uint256 value) external returns (bool);

    /**
     * @dev Returns the remaining number of tokens that `spender` will be
     * allowed to spend on behalf of `owner` through {transferFrom}. This is
     * zero by default.
     *
     * This value changes when {approve} or {transferFrom} are called.
     */
    function allowance(address owner, address spender) external view returns (uint256);

    /**
     * @dev Sets a `value` amount of tokens as the allowance of `spender` over the
     * caller's tokens.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * IMPORTANT: Beware that changing an allowance with this method brings the risk
     * that someone may use both the old and the new allowance by unfortunate
     * transaction ordering. One possible solution to mitigate this race
     * condition is to first reduce the spender's allowance to 0 and set the
     * desired value afterwards:
     * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
     *
     * Emits an {Approval} event.
     */
    function approve(address spender, uint256 value) external returns (bool);

    /**
     * @dev Moves a `value` amount of tokens from `from` to `to` using the
     * allowance mechanism. `value` is then deducted from the caller's
     * allowance.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(address from, address to, uint256 value) external returns (bool);
}

Read Contract

BRKTETH 0x16d929f4 → address
RETH 0x8265b121 → address
ROCKET_DEPOSIT_POOL 0x2dcd62ac → address
STETH 0xe00bfe50 → address
WETH 0xad5c4648 → address
WSTETH 0xd9fb643a → address
lidoLimit 0x29a83bd9 → uint256
rocketPoolLimit 0x3fd8635f → uint256

Write Contract 4 functions

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

ethToBrktETH 0xfd9f8a95
uint256 mintBrktAmount
returns: uint256
recoverETH 0xd3335553
uint256 amount
wethToBrktETH 0x38ffdeed
uint256 amount
uint256 mintBrktAmount
returns: uint256
withdrawToken 0x9e281a98
address token
uint256 amount

Recent Transactions

No transactions found for this address