{
  "address": "0xCb2A26e44bD8bC19FB33957c6adbdca693C56F64",
  "abi": [
    {
      "anonymous": false,
      "inputs": [
        {
          "indexed": false,
          "internalType": "uint256",
          "name": "amountIn",
          "type": "uint256"
        },
        {
          "indexed": false,
          "internalType": "uint256",
          "name": "amountOut",
          "type": "uint256"
        }
      ],
      "name": "SwapInfo",
      "type": "event"
    },
    {
      "inputs": [
        {
          "internalType": "address",
          "name": "_tokenAddress",
          "type": "address"
        },
        {
          "internalType": "address",
          "name": "_router",
          "type": "address"
        }
      ],
      "name": "buy",
      "outputs": [],
      "stateMutability": "payable",
      "type": "function"
    }
  ],
  "transactionHash": "0xe7ccf39695ca175fd680ff27b43fd6c8e4a4bd7d37fab2539a7f299d8ab6b0e7",
  "receipt": {
    "to": null,
    "from": "0x5CB01385d3097b6a189d1ac8BA3364D900666445",
    "contractAddress": "0xCb2A26e44bD8bC19FB33957c6adbdca693C56F64",
    "transactionIndex": 44,
    "gasUsed": "361516",
    "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000100000008000000000000000000000000000000000000000000000000000000000800010000000000000000100000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000004000000000000000000001000000000000080000000000000000100000000000000000000000000000000000000000000000000000000004000000000000100020",
    "blockHash": "0x7786440824d6cb70142f85d8c532905bff252a9d583ee5f6f3ba273170cb4f2f",
    "transactionHash": "0xe7ccf39695ca175fd680ff27b43fd6c8e4a4bd7d37fab2539a7f299d8ab6b0e7",
    "logs": [
      {
        "transactionIndex": 44,
        "blockNumber": 30879299,
        "transactionHash": "0xe7ccf39695ca175fd680ff27b43fd6c8e4a4bd7d37fab2539a7f299d8ab6b0e7",
        "address": "0x0000000000000000000000000000000000001010",
        "topics": [
          "0x4dfe1bbbcf077ddc3e01291eea2d5c70c2b422b415d95645b9adcfd678cb1d63",
          "0x0000000000000000000000000000000000000000000000000000000000001010",
          "0x0000000000000000000000005cb01385d3097b6a189d1ac8ba3364d900666445",
          "0x000000000000000000000000127685d6dd6683085da4b6a041efcef1681e5c9c"
        ],
        "data": "0x000000000000000000000000000000000000000000000000007e808cb5aeac9800000000000000000000000000000000000000000000000160c13107ecaeaf3700000000000000000000000000000000000000000000082962ede5cc528a4b570000000000000000000000000000000000000000000000016042b07b3700029f000000000000000000000000000000000000000000000829636c66590838f7ef",
        "logIndex": 255,
        "blockHash": "0x7786440824d6cb70142f85d8c532905bff252a9d583ee5f6f3ba273170cb4f2f"
      }
    ],
    "blockNumber": 30879299,
    "cumulativeGasUsed": "10095191",
    "status": 1,
    "byzantium": true
  },
  "args": [],
  "numDeployments": 1,
  "solcInputHash": "aaac413f6ad979b12e8402cb099e634a",
  "metadata": "{\"compiler\":{\"version\":\"0.8.6+commit.11564f7e\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amountIn\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amountOut\",\"type\":\"uint256\"}],\"name\":\"SwapInfo\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_tokenAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_router\",\"type\":\"address\"}],\"name\":\"buy\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"}],\"devdoc\":{\"details\":\"Contract to learn how to swap on Uniswap\",\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/test/BuyonSwap.sol\":\"BuyonSwap\"},\"evmVersion\":\"berlin\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"contracts/test/BuyonSwap.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >=0.8.0 <0.9.0;\\n\\ninterface IUniswapV2Router01 {\\n\\n    function WETH() external pure returns (address);\\n\\n    function swapExactETHForTokens(uint amountOutMin, address[] calldata path, address to, uint deadline)\\n    external\\n    payable\\n    returns (uint[] memory amounts);\\n\\n    function getAmountsOut(uint amountIn, address[] calldata path) external view returns (uint[] memory amounts);\\n}\\n\\n/**\\n * @dev Contract to learn how to swap on Uniswap\\n */\\ncontract BuyonSwap {\\n\\n    event SwapInfo(uint256 amountIn, uint256 amountOut);\\n\\n    function buy(address _tokenAddress, address _router) public payable {\\n        IUniswapV2Router01 router = IUniswapV2Router01(_router);\\n\\n        address[] memory path = new address[](2);\\n        path[0] = router.WETH();\\n        path[1] = _tokenAddress;\\n\\n        uint[] memory amountsOut = router.getAmountsOut(msg.value, path);\\n\\n        amountsOut = router.swapExactETHForTokens{value : msg.value}(\\n            (amountsOut[1] * 9) / 10,\\n            path,\\n            msg.sender,\\n            block.timestamp + 600\\n        );\\n\\n        emit SwapInfo(amountsOut[0], amountsOut[1]);\\n    }\\n}\\n\",\"keccak256\":\"0xdae166291e16d96b0575e71dbaae73d4425328b6c1762ef9fd457cb44196139d\",\"license\":\"MIT\"}},\"version\":1}",
  "bytecode": "0x608060405234801561001057600080fd5b50610594806100206000396000f3fe60806040526004361061001e5760003560e01c8063ad7fadc514610023575b600080fd5b610036610031366004610313565b610038565b005b60408051600280825260608201835283926000929190602083019080368337019050509050816001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561009657600080fd5b505afa1580156100aa573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906100ce91906102ef565b816000815181106100e1576100e161051a565b60200260200101906001600160a01b031690816001600160a01b03168152505083816001815181106101155761011561051a565b6001600160a01b03928316602091820292909201015260405163d06ca61f60e01b815260009184169063d06ca61f906101549034908690600401610455565b60006040518083038186803b15801561016c57600080fd5b505afa158015610180573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526101a8919081019061034c565b9050826001600160a01b0316637ff36ab534600a846001815181106101cf576101cf61051a565b602002602001015160096101e391906104e5565b6101ed91906104c3565b85336101fb426102586104ab565b6040518663ffffffff1660e01b815260040161021a9493929190610476565b6000604051808303818588803b15801561023357600080fd5b505af1158015610247573d6000803e3d6000fd5b50505050506040513d6000823e601f3d908101601f19168201604052610270919081019061034c565b90507fd4444facf26594196e79c17cbc3269cd16854a3b5a5bd2d3d737b3cdc898d95e816000815181106102a6576102a661051a565b6020026020010151826001815181106102c1576102c161051a565b60200260200101516040516102e0929190918252602082015260400190565b60405180910390a15050505050565b60006020828403121561030157600080fd5b815161030c81610546565b9392505050565b6000806040838503121561032657600080fd5b823561033181610546565b9150602083013561034181610546565b809150509250929050565b6000602080838503121561035f57600080fd5b825167ffffffffffffffff8082111561037757600080fd5b818501915085601f83011261038b57600080fd5b81518181111561039d5761039d610530565b8060051b604051601f19603f830116810181811085821117156103c2576103c2610530565b604052828152858101935084860182860187018a10156103e157600080fd5b600095505b838610156104045780518552600195909501949386019386016103e6565b5098975050505050505050565b600081518084526020808501945080840160005b8381101561044a5781516001600160a01b031687529582019590820190600101610425565b509495945050505050565b82815260406020820152600061046e6040830184610411565b949350505050565b84815260806020820152600061048f6080830186610411565b6001600160a01b03949094166040830152506060015292915050565b600082198211156104be576104be610504565b500190565b6000826104e057634e487b7160e01b600052601260045260246000fd5b500490565b60008160001904831182151516156104ff576104ff610504565b500290565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461055b57600080fd5b5056fea26469706673582212207dbbd32c7965c61b2e190c71a2ab95e8e0a07513d996a372d3054b7e0f3fbe1464736f6c63430008060033",
  "deployedBytecode": "0x60806040526004361061001e5760003560e01c8063ad7fadc514610023575b600080fd5b610036610031366004610313565b610038565b005b60408051600280825260608201835283926000929190602083019080368337019050509050816001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561009657600080fd5b505afa1580156100aa573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906100ce91906102ef565b816000815181106100e1576100e161051a565b60200260200101906001600160a01b031690816001600160a01b03168152505083816001815181106101155761011561051a565b6001600160a01b03928316602091820292909201015260405163d06ca61f60e01b815260009184169063d06ca61f906101549034908690600401610455565b60006040518083038186803b15801561016c57600080fd5b505afa158015610180573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526101a8919081019061034c565b9050826001600160a01b0316637ff36ab534600a846001815181106101cf576101cf61051a565b602002602001015160096101e391906104e5565b6101ed91906104c3565b85336101fb426102586104ab565b6040518663ffffffff1660e01b815260040161021a9493929190610476565b6000604051808303818588803b15801561023357600080fd5b505af1158015610247573d6000803e3d6000fd5b50505050506040513d6000823e601f3d908101601f19168201604052610270919081019061034c565b90507fd4444facf26594196e79c17cbc3269cd16854a3b5a5bd2d3d737b3cdc898d95e816000815181106102a6576102a661051a565b6020026020010151826001815181106102c1576102c161051a565b60200260200101516040516102e0929190918252602082015260400190565b60405180910390a15050505050565b60006020828403121561030157600080fd5b815161030c81610546565b9392505050565b6000806040838503121561032657600080fd5b823561033181610546565b9150602083013561034181610546565b809150509250929050565b6000602080838503121561035f57600080fd5b825167ffffffffffffffff8082111561037757600080fd5b818501915085601f83011261038b57600080fd5b81518181111561039d5761039d610530565b8060051b604051601f19603f830116810181811085821117156103c2576103c2610530565b604052828152858101935084860182860187018a10156103e157600080fd5b600095505b838610156104045780518552600195909501949386019386016103e6565b5098975050505050505050565b600081518084526020808501945080840160005b8381101561044a5781516001600160a01b031687529582019590820190600101610425565b509495945050505050565b82815260406020820152600061046e6040830184610411565b949350505050565b84815260806020820152600061048f6080830186610411565b6001600160a01b03949094166040830152506060015292915050565b600082198211156104be576104be610504565b500190565b6000826104e057634e487b7160e01b600052601260045260246000fd5b500490565b60008160001904831182151516156104ff576104ff610504565b500290565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461055b57600080fd5b5056fea26469706673582212207dbbd32c7965c61b2e190c71a2ab95e8e0a07513d996a372d3054b7e0f3fbe1464736f6c63430008060033",
  "devdoc": {
    "details": "Contract to learn how to swap on Uniswap",
    "kind": "dev",
    "methods": {},
    "version": 1
  },
  "userdoc": {
    "kind": "user",
    "methods": {},
    "version": 1
  },
  "storageLayout": {
    "storage": [],
    "types": null
  }
}