Skip to content
Verified contractExactMIT

GuruDepositRouter

Address0x861063188ba3abb094bc054bbe3a0bc4eedf326b
Balance

0 ETH

 

Transactions

45

 

Compiler

solc 0.8.27

 

Same code

Only this contract

 

Details

Compiler
solc 0.8.27+commit.40a35a09
Language
solidity
Optimization
Yes, 200 runs
EVM version
paris
License
MIT
Match
Exactcreation code: yes, runtime code: yes
Verified on Sourcify
Created in block
22,203,999
Creation transaction
0x1d96555499…aba04a07e6

contracts/GuruDepositRouter.sol

// SPDX-License-Identifier: MIT
pragma solidity =0.8.27;

import { IWETH } from 'contracts/interfaces/IWETH.sol';

contract GuruDepositRouter {
    IWETH public constant $WETH =
        IWETH(0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2);

    function forwardSwapETH(
        address fund,
        address router,
        uint256 amountIn,
        bytes calldata data
    ) external {
        require(fund == msg.sender, 'NA');

        $WETH.transferFrom(msg.sender, address(this), amountIn);
        $WETH.approve(address(router), amountIn);

        (bool success, ) = router.call(data);
        require(success, 'Failed to forward swap');
    }
}

contracts/interfaces/IWETH.sol

/// SPDX-License-Identifier: MIT
pragma solidity =0.8.27;

interface IWETH {
    function name() external view returns (string memory);

    function symbol() external view returns (string memory);

    function decimals() external view returns (uint8);

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

    function allowance(address owner, address spender) external view returns (uint);

    function totalSupply() external view returns (uint);

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

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

    function transferFrom(address from, address to, uint wad) external returns (bool);

    function deposit() external payable;

    function withdraw(uint wad) external;

    event Approval(address indexed owner, address indexed spender, uint wad);
    event Transfer(address indexed from, address indexed to, uint wad);
    event Deposit(address indexed to, uint wad);
    event Withdrawal(address indexed from, uint wad);
}
Compiler settingsShow
{
  "libraries": {},
  "optimizer": {
    "runs": 200,
    "enabled": true
  },
  "evmVersion": "paris"
}

Source code and metadata: Sourcify.

The source code belongs to the authors of the contract.