@levelk/token-price-oracles
Version:
tools for creating token price data feeds and oracles that integrate with on-chain dex's
1,693 lines • 320 kB
JSON
{
"contractName": "UniswapExchangeInterface",
"abi": [
{
"constant": true,
"inputs": [],
"name": "name",
"outputs": [
{
"name": "",
"type": "bytes32"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "decimals",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "symbol",
"outputs": [
{
"name": "",
"type": "bytes32"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "tokenAddress",
"outputs": [
{
"name": "token",
"type": "address"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "factoryAddress",
"outputs": [
{
"name": "factory",
"type": "address"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "min_liquidity",
"type": "uint256"
},
{
"name": "max_tokens",
"type": "uint256"
},
{
"name": "deadline",
"type": "uint256"
}
],
"name": "addLiquidity",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": true,
"stateMutability": "payable",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "amount",
"type": "uint256"
},
{
"name": "min_eth",
"type": "uint256"
},
{
"name": "min_tokens",
"type": "uint256"
},
{
"name": "deadline",
"type": "uint256"
}
],
"name": "removeLiquidity",
"outputs": [
{
"name": "",
"type": "uint256"
},
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "eth_sold",
"type": "uint256"
}
],
"name": "getEthToTokenInputPrice",
"outputs": [
{
"name": "tokens_bought",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "tokens_bought",
"type": "uint256"
}
],
"name": "getEthToTokenOutputPrice",
"outputs": [
{
"name": "eth_sold",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "tokens_sold",
"type": "uint256"
}
],
"name": "getTokenToEthInputPrice",
"outputs": [
{
"name": "eth_bought",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "eth_bought",
"type": "uint256"
}
],
"name": "getTokenToEthOutputPrice",
"outputs": [
{
"name": "tokens_sold",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "min_tokens",
"type": "uint256"
},
{
"name": "deadline",
"type": "uint256"
}
],
"name": "ethToTokenSwapInput",
"outputs": [
{
"name": "tokens_bought",
"type": "uint256"
}
],
"payable": true,
"stateMutability": "payable",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "min_tokens",
"type": "uint256"
},
{
"name": "deadline",
"type": "uint256"
},
{
"name": "recipient",
"type": "address"
}
],
"name": "ethToTokenTransferInput",
"outputs": [
{
"name": "tokens_bought",
"type": "uint256"
}
],
"payable": true,
"stateMutability": "payable",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "tokens_bought",
"type": "uint256"
},
{
"name": "deadline",
"type": "uint256"
}
],
"name": "ethToTokenSwapOutput",
"outputs": [
{
"name": "eth_sold",
"type": "uint256"
}
],
"payable": true,
"stateMutability": "payable",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "tokens_bought",
"type": "uint256"
},
{
"name": "deadline",
"type": "uint256"
},
{
"name": "recipient",
"type": "address"
}
],
"name": "ethToTokenTransferOutput",
"outputs": [
{
"name": "eth_sold",
"type": "uint256"
}
],
"payable": true,
"stateMutability": "payable",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "tokens_sold",
"type": "uint256"
},
{
"name": "min_eth",
"type": "uint256"
},
{
"name": "deadline",
"type": "uint256"
}
],
"name": "tokenToEthSwapInput",
"outputs": [
{
"name": "eth_bought",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "tokens_sold",
"type": "uint256"
},
{
"name": "min_eth",
"type": "uint256"
},
{
"name": "deadline",
"type": "uint256"
},
{
"name": "recipient",
"type": "address"
}
],
"name": "tokenToEthTransferInput",
"outputs": [
{
"name": "eth_bought",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "eth_bought",
"type": "uint256"
},
{
"name": "max_tokens",
"type": "uint256"
},
{
"name": "deadline",
"type": "uint256"
}
],
"name": "tokenToEthSwapOutput",
"outputs": [
{
"name": "tokens_sold",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "eth_bought",
"type": "uint256"
},
{
"name": "max_tokens",
"type": "uint256"
},
{
"name": "deadline",
"type": "uint256"
},
{
"name": "recipient",
"type": "address"
}
],
"name": "tokenToEthTransferOutput",
"outputs": [
{
"name": "tokens_sold",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "tokens_sold",
"type": "uint256"
},
{
"name": "min_tokens_bought",
"type": "uint256"
},
{
"name": "min_eth_bought",
"type": "uint256"
},
{
"name": "deadline",
"type": "uint256"
},
{
"name": "token_addr",
"type": "address"
}
],
"name": "tokenToTokenSwapInput",
"outputs": [
{
"name": "tokens_bought",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "tokens_sold",
"type": "uint256"
},
{
"name": "min_tokens_bought",
"type": "uint256"
},
{
"name": "min_eth_bought",
"type": "uint256"
},
{
"name": "deadline",
"type": "uint256"
},
{
"name": "recipient",
"type": "address"
},
{
"name": "token_addr",
"type": "address"
}
],
"name": "tokenToTokenTransferInput",
"outputs": [
{
"name": "tokens_bought",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "tokens_bought",
"type": "uint256"
},
{
"name": "max_tokens_sold",
"type": "uint256"
},
{
"name": "max_eth_sold",
"type": "uint256"
},
{
"name": "deadline",
"type": "uint256"
},
{
"name": "token_addr",
"type": "address"
}
],
"name": "tokenToTokenSwapOutput",
"outputs": [
{
"name": "tokens_sold",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "tokens_bought",
"type": "uint256"
},
{
"name": "max_tokens_sold",
"type": "uint256"
},
{
"name": "max_eth_sold",
"type": "uint256"
},
{
"name": "deadline",
"type": "uint256"
},
{
"name": "recipient",
"type": "address"
},
{
"name": "token_addr",
"type": "address"
}
],
"name": "tokenToTokenTransferOutput",
"outputs": [
{
"name": "tokens_sold",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "tokens_sold",
"type": "uint256"
},
{
"name": "min_tokens_bought",
"type": "uint256"
},
{
"name": "min_eth_bought",
"type": "uint256"
},
{
"name": "deadline",
"type": "uint256"
},
{
"name": "exchange_addr",
"type": "address"
}
],
"name": "tokenToExchangeSwapInput",
"outputs": [
{
"name": "tokens_bought",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "tokens_sold",
"type": "uint256"
},
{
"name": "min_tokens_bought",
"type": "uint256"
},
{
"name": "min_eth_bought",
"type": "uint256"
},
{
"name": "deadline",
"type": "uint256"
},
{
"name": "recipient",
"type": "address"
},
{
"name": "exchange_addr",
"type": "address"
}
],
"name": "tokenToExchangeTransferInput",
"outputs": [
{
"name": "tokens_bought",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "tokens_bought",
"type": "uint256"
},
{
"name": "max_tokens_sold",
"type": "uint256"
},
{
"name": "max_eth_sold",
"type": "uint256"
},
{
"name": "deadline",
"type": "uint256"
},
{
"name": "exchange_addr",
"type": "address"
}
],
"name": "tokenToExchangeSwapOutput",
"outputs": [
{
"name": "tokens_sold",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "tokens_bought",
"type": "uint256"
},
{
"name": "max_tokens_sold",
"type": "uint256"
},
{
"name": "max_eth_sold",
"type": "uint256"
},
{
"name": "deadline",
"type": "uint256"
},
{
"name": "recipient",
"type": "address"
},
{
"name": "exchange_addr",
"type": "address"
}
],
"name": "tokenToExchangeTransferOutput",
"outputs": [
{
"name": "tokens_sold",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "_to",
"type": "address"
},
{
"name": "_value",
"type": "uint256"
}
],
"name": "transfer",
"outputs": [
{
"name": "",
"type": "bool"
}
],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "_from",
"type": "address"
},
{
"name": "_to",
"type": "address"
},
{
"name": "value",
"type": "uint256"
}
],
"name": "transferFrom",
"outputs": [
{
"name": "",
"type": "bool"
}
],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "_spender",
"type": "address"
},
{
"name": "_value",
"type": "uint256"
}
],
"name": "approve",
"outputs": [
{
"name": "",
"type": "bool"
}
],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "_owner",
"type": "address"
},
{
"name": "_spender",
"type": "address"
}
],
"name": "allowance",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "_owner",
"type": "address"
}
],
"name": "balanceOf",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "totalSupply",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "token_addr",
"type": "address"
}
],
"name": "setup",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
}
],
"bytecode": "0x",
"deployedBytecode": "0x",
"sourceMap": "",
"deployedSourceMap": "",
"source": "pragma solidity >=0.4.24;\n\ncontract UniswapExchangeInterface {\n // Address of ERC20 token sold on this exchange\n function tokenAddress() external view returns (address token);\n // Address of Uniswap Factory\n function factoryAddress() external view returns (address factory);\n // Provide Liquidity\n function addLiquidity(uint256 min_liquidity, uint256 max_tokens, uint256 deadline) external payable returns (uint256);\n function removeLiquidity(uint256 amount, uint256 min_eth, uint256 min_tokens, uint256 deadline) external returns (uint256, uint256);\n // Get Prices\n function getEthToTokenInputPrice(uint256 eth_sold) external view returns (uint256 tokens_bought);\n function getEthToTokenOutputPrice(uint256 tokens_bought) external view returns (uint256 eth_sold);\n function getTokenToEthInputPrice(uint256 tokens_sold) external view returns (uint256 eth_bought);\n function getTokenToEthOutputPrice(uint256 eth_bought) external view returns (uint256 tokens_sold);\n // Trade ETH to ERC20\n function ethToTokenSwapInput(uint256 min_tokens, uint256 deadline) external payable returns (uint256 tokens_bought);\n function ethToTokenTransferInput(uint256 min_tokens, uint256 deadline, address recipient) external payable returns (uint256 tokens_bought);\n function ethToTokenSwapOutput(uint256 tokens_bought, uint256 deadline) external payable returns (uint256 eth_sold);\n function ethToTokenTransferOutput(uint256 tokens_bought, uint256 deadline, address recipient) external payable returns (uint256 eth_sold);\n // Trade ERC20 to ETH\n function tokenToEthSwapInput(uint256 tokens_sold, uint256 min_eth, uint256 deadline) external returns (uint256 eth_bought);\n function tokenToEthTransferInput(uint256 tokens_sold, uint256 min_eth, uint256 deadline, address recipient) external returns (uint256 eth_bought);\n function tokenToEthSwapOutput(uint256 eth_bought, uint256 max_tokens, uint256 deadline) external returns (uint256 tokens_sold);\n function tokenToEthTransferOutput(uint256 eth_bought, uint256 max_tokens, uint256 deadline, address recipient) external returns (uint256 tokens_sold);\n // Trade ERC20 to ERC20\n function tokenToTokenSwapInput(uint256 tokens_sold, uint256 min_tokens_bought, uint256 min_eth_bought, uint256 deadline, address token_addr) external returns (uint256 tokens_bought);\n function tokenToTokenTransferInput(uint256 tokens_sold, uint256 min_tokens_bought, uint256 min_eth_bought, uint256 deadline, address recipient, address token_addr) external returns (uint256 tokens_bought);\n function tokenToTokenSwapOutput(uint256 tokens_bought, uint256 max_tokens_sold, uint256 max_eth_sold, uint256 deadline, address token_addr) external returns (uint256 tokens_sold);\n function tokenToTokenTransferOutput(uint256 tokens_bought, uint256 max_tokens_sold, uint256 max_eth_sold, uint256 deadline, address recipient, address token_addr) external returns (uint256 tokens_sold);\n // Trade ERC20 to Custom Pool\n function tokenToExchangeSwapInput(uint256 tokens_sold, uint256 min_tokens_bought, uint256 min_eth_bought, uint256 deadline, address exchange_addr) external returns (uint256 tokens_bought);\n function tokenToExchangeTransferInput(uint256 tokens_sold, uint256 min_tokens_bought, uint256 min_eth_bought, uint256 deadline, address recipient, address exchange_addr) external returns (uint256 tokens_bought);\n function tokenToExchangeSwapOutput(uint256 tokens_bought, uint256 max_tokens_sold, uint256 max_eth_sold, uint256 deadline, address exchange_addr) external returns (uint256 tokens_sold);\n function tokenToExchangeTransferOutput(uint256 tokens_bought, uint256 max_tokens_sold, uint256 max_eth_sold, uint256 deadline, address recipient, address exchange_addr) external returns (uint256 tokens_sold);\n // ERC20 comaptibility for liquidity tokens\n bytes32 public name;\n bytes32 public symbol;\n uint256 public decimals;\n function transfer(address _to, uint256 _value) external returns (bool);\n function transferFrom(address _from, address _to, uint256 value) external returns (bool);\n function approve(address _spender, uint256 _value) external returns (bool);\n function allowance(address _owner, address _spender) external view returns (uint256);\n function balanceOf(address _owner) external view returns (uint256);\n function totalSupply() external view returns (uint256);\n // Never use\n function setup(address token_addr) external;\n}\n",
"sourcePath": "/Users/mfcalvanese/dev/eth/token-price-oracles/contracts/ExchangeAdapters/Uniswap/UniswapExchangeInterface.sol",
"ast": {
"absolutePath": "/Users/mfcalvanese/dev/eth/token-price-oracles/contracts/ExchangeAdapters/Uniswap/UniswapExchangeInterface.sol",
"exportedSymbols": {
"UniswapExchangeInterface": [
984
]
},
"id": 985,
"nodeType": "SourceUnit",
"nodes": [
{
"id": 642,
"literals": [
"solidity",
">=",
"0.4",
".24"
],
"nodeType": "PragmaDirective",
"src": "0:25:4"
},
{
"baseContracts": [],
"contractDependencies": [],
"contractKind": "contract",
"documentation": null,
"fullyImplemented": false,
"id": 984,
"linearizedBaseContracts": [
984
],
"name": "UniswapExchangeInterface",
"nodeType": "ContractDefinition",
"nodes": [
{
"body": null,
"documentation": null,
"id": 647,
"implemented": false,
"isConstructor": false,
"isDeclaredConst": true,
"modifiers": [],
"name": "tokenAddress",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 643,
"nodeType": "ParameterList",
"parameters": [],
"src": "140:2:4"
},
"payable": false,
"returnParameters": {
"id": 646,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 645,
"name": "token",
"nodeType": "VariableDeclaration",
"scope": 647,
"src": "166:13:4",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 644,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "166:7:4",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "165:15:4"
},
"scope": 984,
"src": "119:62:4",
"stateMutability": "view",
"superFunction": null,
"visibility": "external"
},
{
"body": null,
"documentation": null,
"id": 652,
"implemented": false,
"isConstructor": false,
"isDeclaredConst": true,
"modifiers": [],
"name": "factoryAddress",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 648,
"nodeType": "ParameterList",
"parameters": [],
"src": "243:2:4"
},
"payable": false,
"returnParameters": {
"id": 651,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 650,
"name": "factory",
"nodeType": "VariableDeclaration",
"scope": 652,
"src": "269:15:4",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 649,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "269:7:4",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "268:17:4"
},
"scope": 984,
"src": "220:66:4",
"stateMutability": "view",
"superFunction": null,
"visibility": "external"
},
{
"body": null,
"documentation": null,
"id": 663,
"implemented": false,
"isConstructor": false,
"isDeclaredConst": false,
"modifiers": [],
"name": "addLiquidity",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 659,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 654,
"name": "min_liquidity",
"nodeType": "VariableDeclaration",
"scope": 663,
"src": "338:21:4",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 653,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "338:7:4",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 656,
"name": "max_tokens",
"nodeType": "VariableDeclaration",
"scope": 663,
"src": "361:18:4",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 655,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "361:7:4",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 658,
"name": "deadline",
"nodeType": "VariableDeclaration",
"scope": 663,
"src": "381:16:4",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 657,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "381:7:4",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "337:61:4"
},
"payable": true,
"returnParameters": {
"id": 662,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 661,
"name": "",
"nodeType": "VariableDeclaration",
"scope": 663,
"src": "425:7:4",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 660,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "425:7:4",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "424:9:4"
},
"scope": 984,
"src": "316:118:4",
"stateMutability": "payable",
"superFunction": null,
"visibility": "external"
},
{
"body": null,
"documentation": null,
"id": 678,
"implemented": false,
"isConstructor": false,
"isDeclaredConst": false,
"modifiers": [],
"name": "removeLiquidity",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 672,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 665,
"name": "amount",
"nodeType": "VariableDeclaration",
"scope": 678,
"src": "464:14:4",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 664,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "464:7:4",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 667,
"name": "min_eth",
"nodeType": "VariableDeclaration",
"scope": 678,
"src": "480:15:4",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 666,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "480:7:4",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 669,
"name": "min_tokens",
"nodeType": "VariableDeclaration",
"scope": 678,
"src": "497:18:4",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 668,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "497:7:4",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 671,
"name": "deadline",
"nodeType": "VariableDeclaration",
"scope": 678,
"src": "517:16:4",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 670,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "517:7:4",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "463:71:4"
},
"payable": false,
"returnParameters": {
"id": 677,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 674,
"name": "",
"nodeType": "VariableDeclaration",
"scope": 678,
"src": "553:7:4",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 673,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "553:7:4",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 676,
"name": "",
"nodeType": "VariableDeclaration",
"scope": 678,
"src": "562:7:4",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 675,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "562:7:4",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "552:18:4"
},
"scope": 984,
"src": "439:132:4",
"stateMutability": "nonpayable",
"superFunction": null,
"visibility": "external"
},
{
"body": null,
"documentation": null,
"id": 685,
"implemented": false,
"isConstructor": false,
"isDeclaredConst": true,
"modifiers": [],
"name": "getEthToTokenInputPrice",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 681,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 680,
"name": "eth_sold",
"nodeType": "VariableDeclaration",
"scope": 685,
"src": "627:16:4",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 679,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "627:7:4",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "626:18:4"
},
"payable": false,
"returnParameters": {
"id": 684,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 683,
"name": "tokens_bought",
"nodeType": "VariableDeclaration",
"scope": 685,
"src": "668:21:4",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 682,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "668:7:4",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "667:23:4"
},
"scope": 984,
"src": "594:97:4",
"stateMutability": "view",
"superFunction": null,
"visibility": "external"
},
{
"body": null,
"documentation": null,
"id": 692,
"implemented": false,
"isConstructor": false,
"isDeclaredConst": true,
"modifiers": [],
"name": "getEthToTokenOutputPrice",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 688,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 687,
"name": "tokens_bought",
"nodeType": "VariableDeclaration",
"scope": 692,
"src": "730:21:4",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 686,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "730:7:4",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "729:23:4"
},
"payable": false,
"returnParameters": {
"id": 691,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 690,
"name": "eth_sold",
"nodeType": "VariableDeclaration",
"scope": 692,
"src": "776:16:4",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 689,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "776:7:4",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "775:18:4"
},
"scope": 984,
"src": "696:98:4",
"stateMutability": "view",
"superFunction": null,
"visibility": "external"
},
{
"body": null,
"documentation": null,
"id": 699,
"implemented": false,
"isConstructor": false,
"isDeclaredConst": true,
"modifiers": [],
"name": "getTokenToEthInputPrice",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 695,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 694,
"name": "tokens_sold",
"nodeType": "VariableDeclaration",
"scope": 699,
"src": "832:19:4",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 693,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "832:7:4",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "831:21:4"
},
"payable": false,
"returnParameters": {
"id": 698,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 697,
"name": "eth_bought",
"nodeType": "VariableDeclaration",
"scope": 699,
"src": "876:18:4",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 696,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "876:7:4",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "875:20:4"
},
"scope": 984,
"src": "799:97:4",
"stateMutability": "view",
"superFunction": null,
"visibility": "external"
},
{
"body": null,
"documentation": null,
"id": 706,
"implemented": false,
"isConstructor": false,
"isDeclaredConst": true,
"modifiers": [],
"name": "getTokenToEthOutputPrice",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 702,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 701,
"name": "eth_bought",
"nodeType": "VariableDeclaration",
"scope": 706,
"src": "935:18:4",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 700,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "935:7:4",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "934:20:4"
},
"payable": false,
"returnParameters": {
"id": 705,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 704,
"name": "tokens_sold",
"nodeType": "VariableDeclaration",
"scope": 706,
"src": "978:19:4",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 703,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "978:7:4",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "977:21:4"
},
"scope": 984,
"src": "901:98:4",
"stateMutability": "view",
"superFunction": null,
"visibility": "external"
},
{
"body": null,
"documentation": null,
"id": 715,
"implemented": false,
"isConstructor": false,
"isDeclaredConst": false,
"modifiers": [],
"name": "ethToTokenSwapInput",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 711,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 708,
"name": "min_tokens",
"nodeType": "VariableDeclaration",
"scope