{
    "Function": "offerWithETH",
    "File": "contracts/RubiconRouter.sol",
    "Parent Contracts": [],
    "High-Level Calls": [
        "ERC20",
        "ERC20",
        "ERC20",
        "RubiconMarket",
        "WETH9"
    ],
    "Internal Calls": [
        "require(bool,string)"
    ],
    "Library Calls": [],
    "Low-Level Calls": [],
    "Code": "function offerWithETH(\n        uint256 pay_amt, //maker (ask) sell how much\n        // ERC20 nativeETH, //maker (ask) sell which token\n        uint256 buy_amt, //maker (ask) buy how much\n        ERC20 buy_gem, //maker (ask) buy which token\n        uint256 pos //position to insert offer, 0 should be used if unknown\n    ) external payable returns (uint256) {\n        require(\n            msg.value >= pay_amt,\n            \"didnt send enough native ETH for WETH offer\"\n        );\n        uint256 _before = ERC20(buy_gem).balanceOf(address(this));\n        WETH9(wethAddress).deposit{value: pay_amt}();\n        uint256 id = RubiconMarket(RubiconMarketAddress).offer(\n            pay_amt,\n            ERC20(wethAddress),\n            buy_amt,\n            buy_gem,\n            pos\n        );\n        uint256 _after = ERC20(buy_gem).balanceOf(address(this));\n        if (_after > _before) {\n            //return any potential fill amount on the offer\n            ERC20(buy_gem).transfer(msg.sender, _after - _before);\n        }\n        return id;\n    }"
}