Cryo Explorer Ethereum Mainnet

Address Contract Partially Verified

Address 0x1B8Df6ca485BE68E5337402e434179b98070d0F5
Balance 0 ETH
Nonce 1
Code Size 2615 bytes
Indexed Transactions 0
External Etherscan · Sourcify

Contract Bytecode

2615 bytes
0x5f3560e01c60026003820660011b6109b101601e395f51565b632177703181186107c95760633611156109ad5760043560040160088135116109ad5780355f81600881116109ad5780156102c357905b6105608102602085010161056082026102400181358060a01c6109ad57815260208201358060a01c6109ad57602082015260408201358060a01c6109ad57604082015260608201358060a01c6109ad57606082015260808201358060a01c6109ad57608082015260a08201358060a01c6109ad5760a082015260c08201358060a01c6109ad5760c082015260e08201358060a01c6109ad5760e08201526101008201358060a01c6109ad576101008201526101208201358060a01c6109ad576101208201526101408201358060a01c6109ad5761014082015261016082016101608201813581526020820135602082015260408201356040820152606082013560608201526080820135608082015260a0820160a082018135815260208201356020820152604082013560408201526060820135606082015260808201356080820152505061014082016101408201813581526020820135602082015260408201356040820152606082013560608201526080820135608082015250506101e082016101e0820181358152602082013560208201526040820135604082015260608201356060820152608082013560808201525050610280820161028082018135815260208201356020820152604082013560408201526060820135606082015260808201356080820152505050506104808201356104808201526104a08201356104a08201526104c082016104c0820181358060a01c6109ad57815260208201358060a01c6109ad57602082015260408201358060a01c6109ad57604082015260608201358060a01c6109ad57606082015260808201358060a01c6109ad5760808201525050505060010181811861004f575b5050806102205250505f5c6001146109ad5760015f5d34612d40525f54612d60525f612d80525f61022051600881116109ad57801561068957905b61056081026102400161056081612da05e505f613300525f6006905b8061332052613320516133205101600a036133005261330051600b8110156109ad5760051b612da001516103535760010181811861031a575b505060206109b75f395f5161330051600b8110156109ad5760051b612da00151186109ad57613220516103fd5760208061338052600d613320527f496e737566206465706f7369740000000000000000000000000000000000000061334052613320816133800160208251018083835e508051806020830101601f825f03163682375050601f19601f8251602001011690509050810190506308c379a0613360528060040161337cfd5b5f6133205273eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee612da051186105255761322051612d405110156104ab576020806133a052600d613340527f496e737566206465706f7369740000000000000000000000000000000000000061336052613340816133a00160208251018083835e508051806020830101601f825f03163682375050601f19601f8251602001011690509050810190506308c379a0613380528060040161339cfd5b61322051612d405103612d405260206109f75f395f51635c9c18e261334052610160612da06133605e610320612f006134c05e60406132206137e05e60a06132606138205e602061334061056461335c61322051855af161050e573d5f5f3e3d5ffd5b60203d106109ad5761334090505161332052610605565b60206109b75f395f51612da051186105635760206109b760403933606052306080526132205160a0526105566107cb565b6132205161332052610605565b612da05160405233606052306080526132205160a0526105816107cb565b612da05160405260206109f76060396132205160805261059f6108bc565b60206109f75f395f51635c9c18e261334052610160612da06133605e610320612f006134c05e60406132206137e05e60a06132606138205e602061334061056461335c5f855af16105f2573d5f5f3e3d5ffd5b60203d106109ad57613340905051613320525b612d8051613320518082018281106109ad5790509050612d80527f7f5f021c6d3e96396c1460bfd786ac79dc77f0109da5203424b1ac62ae95f4b7612d605161334052612da051613360526132205161338052613320516133a052336133c052604060246133e03760e0613340a16001612d605101612d60526001018181186102fe575b5050612d805161071057602080612e0052600d612da0527f496e737566206465706f73697400000000000000000000000000000000000000612dc052612da081612e000160208251018083835e508051806020830101601f825f03163682375050601f19601f8251602001011690509050810190506308c379a0612de05280600401612dfcfd5b60406109b7604039612d80516080526107276108bc565b60206109d75f395f516301e4f53a612da0526020610a17612dc039612d8051612de052803b156109ad575f612da06044612dbc5f855af161076a573d5f5f3e3d5ffd5b50612d60515f55612d40511561078b575f5f5f5f612d4051335ff1156109ad575b5f5f5d005b637ab1643381186107c957346109ad576020610a1760403960206040f35b6312ece1ed81186107c957346109ad575f5460405260206040f35b005b6040516323b872dd60c0526060606060e05e602060c0606460dc5f855af16107f5573d5f5f3e3d5ffd5b3d61080c57803b156109ad57600161014052610833565b3d602081183d60201002188060c00160e0116109ad5760c0518060011c6109ad5761014052505b6101409050516108ba576020806101c0526013610160527f4661696c6564207472616e7366657246726f6d0000000000000000000000000061018052610160816101c00160208251018083835e508051806020830101601f825f03163682375050601f19601f8251602001011690509050810190506308c379a06101a052806004016101bcfd5b565b60405163095ea7b360a0526040606060c05e602060a0604460bc5f855af16108e6573d5f5f3e3d5ffd5b3d6108fd57803b156109ad57600161010052610924565b3d602081183d60201002188060a00160c0116109ad5760a0518060011c6109ad5761010052505b6101009050516109ab5760208061018052600e610120527f4661696c656420617070726f766500000000000000000000000000000000000061014052610120816101800160208251018083835e508051806020830101601f825f03163682375050601f19601f8251602001011690509050810190506308c379a0610160528060040161017cfd5b565b5f80fd0790001807ae0000000000000000000000006b175474e89094c44da98b954eedeac495271d0f0000000000000000000000004aa42145aa6ebf72e164c9bbc74fbd378804501600000000000000000000000016c6521dff6bab339122a0fe25a9116693265353000000000000000000000000e105da50a007246255cf91b42a82dd9ff5971243

Verified Source Code Partial Match

Compiler: v0.4.0+commit.e9db8d9f
OfframpTWAPBotonETH.vy 105 lines
#pragma version 0.4.0
#pragma optimize gas
#pragma evm-version cancun
"""
@title Offramp TWAP Bot on ETH
@license Apache 2.0
@author Volume.finance
"""

struct SwapInfo:
    route: address[11]
    swap_params: uint256[5][5]
    amount: uint256
    expected: uint256
    pools: address[5]

interface CurveSwapRouter:
    def exchange(
        _route: address[11],
        _swap_params: uint256[5][5],
        _amount: uint256,
        _expected: uint256,
        _pools: address[5]
    ) -> uint256: payable

interface ERC20:
    def approve(_spender: address, _value: uint256) -> bool: nonpayable
    def transferFrom(_from: address, _to: address, _value: uint256) -> bool: nonpayable

interface DaiBridge:
    def relayTokens(_receiver: address, _amount: uint256): nonpayable

VETH: constant(address) = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE # Virtual ETH
DAI: immutable(address)
BRIDGE: immutable(address)
ROUTER: immutable(address)
MAX_SIZE: constant(uint256) = 8
OPPOSITE: public(immutable(address))
next_deposit: public(uint256)

event Deposited:
    deposit_id: uint256
    token0: address
    amount0: uint256
    amount1: uint256
    depositor: address
    number_trades: uint256
    interval: uint256

@deploy
def __init__(dai: address, bridge: address, router: address, opposite: address):
    ROUTER = router
    DAI = dai
    BRIDGE = bridge
    OPPOSITE = opposite

@internal
def _safe_approve(_token: address, _spender: address, _value: uint256):
    assert extcall ERC20(_token).approve(_spender, _value, default_return_value=True), "Failed approve"

@internal
def _safe_transfer_from(_token: address, _from: address, _to: address, _value: uint256):
    assert extcall ERC20(_token).transferFrom(_from, _to, _value, default_return_value=True), "Failed transferFrom"

@external
@payable
@nonreentrant
def deposit(swap_infos: DynArray[SwapInfo, MAX_SIZE], number_trades: uint256, interval: uint256):
    _value: uint256 = msg.value
    _next_deposit: uint256 = self.next_deposit
    dai_amount: uint256 = 0
    for swap_info: SwapInfo in swap_infos:
        last_index: uint256 = 0
        for i: uint256 in range(6):
            last_index = unsafe_sub(10, unsafe_add(i, i))
            if swap_info.route[last_index] != empty(address):
                break
        assert swap_info.route[last_index] == DAI
        assert swap_info.amount > 0, "Insuf deposit"
        out_amount: uint256 = 0
        if swap_info.route[0] == VETH:
            assert _value >= swap_info.amount, "Insuf deposit"
            _value = unsafe_sub(_value, swap_info.amount)
            out_amount = extcall CurveSwapRouter(ROUTER).exchange(swap_info.route, swap_info.swap_params, swap_info.amount, swap_info.expected, swap_info.pools, value=swap_info.amount)
        elif swap_info.route[0] == DAI:
            self._safe_transfer_from(DAI, msg.sender, self, swap_info.amount)
            out_amount = swap_info.amount
        else:
            self._safe_transfer_from(swap_info.route[0], msg.sender, self, swap_info.amount)
            self._safe_approve(swap_info.route[0], ROUTER, swap_info.amount)
            out_amount = extcall CurveSwapRouter(ROUTER).exchange(swap_info.route, swap_info.swap_params, swap_info.amount, swap_info.expected, swap_info.pools)
        dai_amount += out_amount
        log Deposited(_next_deposit, swap_info.route[0], swap_info.amount, out_amount, msg.sender, number_trades, interval)
        _next_deposit = unsafe_add(_next_deposit, 1)
    assert dai_amount > 0, "Insuf deposit"
    self._safe_approve(DAI, BRIDGE, dai_amount)
    extcall DaiBridge(BRIDGE).relayTokens(OPPOSITE, dai_amount)
    self.next_deposit = _next_deposit
    if _value > 0:
        send(msg.sender, _value)

@external
@payable
def __default__():
    pass

Read Contract

OPPOSITE 0x7ab16433 → address
next_deposit 0x12ece1ed → uint256

Write Contract 1 functions

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

deposit 0xbfaf92d2
tuple[] swap_infos
uint256 number_trades
uint256 interval

Recent Transactions

No transactions found for this address