{
    "Function": "swapWithETH",
    "File": "contracts/RubiconRouter.sol",
    "Parent Contracts": [],
    "High-Level Calls": [
        "SafeMath",
        "SafeMath",
        "SafeMath",
        "WETH9"
    ],
    "Internal Calls": [
        "require(bool,string)",
        "_swap",
        "require(bool,string)"
    ],
    "Library Calls": [
        "div",
        "add",
        "mul"
    ],
    "Low-Level Calls": [],
    "Code": "function swapWithETH(\n        uint256 pay_amt,\n        uint256 buy_amt_min,\n        address[] calldata route, // First address is what is being payed, Last address is what is being bought\n        uint256 expectedMarketFeeBPS\n    ) external payable returns (uint256) {\n        require(route[0] == wethAddress, \"Initial value in path not WETH\");\n        uint256 amtWithFee = pay_amt.add(\n            pay_amt.mul(expectedMarketFeeBPS).div(10000)\n        );\n        require(\n            msg.value >= amtWithFee,\n            \"must send enough native ETH to pay as weth and account for fee\"\n        );\n        WETH9(wethAddress).deposit{value: amtWithFee}();\n        return\n            _swap(\n                pay_amt,\n                buy_amt_min,\n                route,\n                expectedMarketFeeBPS,\n                msg.sender\n            );\n    }"
}