UNPKG

@fleupold/dex-contracts

Version:

Contracts for dFusion multi-token batch auction exchange

1,171 lines 2.98 MB
{ "contractName": "BatchExchange", "abi": [ { "constant": true, "inputs": [], "name": "IMPROVEMENT_DENOMINATOR", "outputs": [ { "name": "", "type": "uint256" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "getSecondsRemainingInBatch", "outputs": [ { "name": "", "type": "uint256" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": false, "inputs": [ { "name": "token", "type": "address" }, { "name": "amount", "type": "uint256" } ], "name": "requestWithdraw", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": true, "inputs": [], "name": "FEE_FOR_LISTING_TOKEN_IN_OWL", "outputs": [ { "name": "", "type": "uint256" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": false, "inputs": [ { "name": "token", "type": "address" }, { "name": "amount", "type": "uint256" } ], "name": "deposit", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": true, "inputs": [], "name": "AMOUNT_MINIMUM", "outputs": [ { "name": "", "type": "uint128" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "feeToken", "outputs": [ { "name": "", "type": "address" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [ { "name": "", "type": "uint16" } ], "name": "currentPrices", "outputs": [ { "name": "", "type": "uint128" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [ { "name": "", "type": "address" }, { "name": "", "type": "uint256" } ], "name": "orders", "outputs": [ { "name": "buyToken", "type": "uint16" }, { "name": "sellToken", "type": "uint16" }, { "name": "validFrom", "type": "uint32" }, { "name": "validUntil", "type": "uint32" }, { "name": "priceNumerator", "type": "uint128" }, { "name": "priceDenominator", "type": "uint128" }, { "name": "usedAmount", "type": "uint128" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "UNLIMITED_ORDER_AMOUNT", "outputs": [ { "name": "", "type": "uint128" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "numTokens", "outputs": [ { "name": "", "type": "uint16" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [ { "name": "", "type": "address" }, { "name": "", "type": "address" } ], "name": "lastCreditBatchId", "outputs": [ { "name": "", "type": "uint32" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "latestSolution", "outputs": [ { "name": "batchId", "type": "uint32" }, { "name": "solutionSubmitter", "type": "address" }, { "name": "feeReward", "type": "uint256" }, { "name": "objectiveValue", "type": "uint256" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [ { "name": "user", "type": "address" }, { "name": "token", "type": "address" } ], "name": "getPendingDeposit", "outputs": [ { "name": "", "type": "uint256" }, { "name": "", "type": "uint32" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [ { "name": "user", "type": "address" }, { "name": "token", "type": "address" } ], "name": "getPendingWithdraw", "outputs": [ { "name": "", "type": "uint256" }, { "name": "", "type": "uint32" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [ { "name": "user", "type": "address" }, { "name": "token", "type": "address" } ], "name": "getBalance", "outputs": [ { "name": "", "type": "uint256" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "FEE_DENOMINATOR", "outputs": [ { "name": "", "type": "uint128" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "ENCODED_AUCTION_ELEMENT_WIDTH", "outputs": [ { "name": "", "type": "uint128" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "BATCH_TIME", "outputs": [ { "name": "", "type": "uint32" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "getCurrentBatchId", "outputs": [ { "name": "", "type": "uint32" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": false, "inputs": [ { "name": "token", "type": "address" }, { "name": "amount", "type": "uint256" }, { "name": "batchId", "type": "uint32" } ], "name": "requestFutureWithdraw", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": true, "inputs": [ { "name": "user", "type": "address" }, { "name": "token", "type": "address" } ], "name": "hasValidWithdrawRequest", "outputs": [ { "name": "", "type": "bool" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "MAX_TOKENS", "outputs": [ { "name": "", "type": "uint256" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": false, "inputs": [ { "name": "user", "type": "address" }, { "name": "token", "type": "address" } ], "name": "withdraw", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": true, "inputs": [], "name": "MAX_TOUCHED_ORDERS", "outputs": [ { "name": "", "type": "uint256" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "inputs": [ { "name": "maxTokens", "type": "uint256" }, { "name": "_feeToken", "type": "address" } ], "payable": false, "stateMutability": "nonpayable", "type": "constructor" }, { "anonymous": false, "inputs": [ { "indexed": true, "name": "owner", "type": "address" }, { "indexed": false, "name": "index", "type": "uint16" }, { "indexed": true, "name": "buyToken", "type": "uint16" }, { "indexed": true, "name": "sellToken", "type": "uint16" }, { "indexed": false, "name": "validFrom", "type": "uint32" }, { "indexed": false, "name": "validUntil", "type": "uint32" }, { "indexed": false, "name": "priceNumerator", "type": "uint128" }, { "indexed": false, "name": "priceDenominator", "type": "uint128" } ], "name": "OrderPlacement", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": false, "name": "token", "type": "address" }, { "indexed": false, "name": "id", "type": "uint16" } ], "name": "TokenListing", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "name": "owner", "type": "address" }, { "indexed": false, "name": "id", "type": "uint16" } ], "name": "OrderCancellation", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "name": "owner", "type": "address" }, { "indexed": false, "name": "id", "type": "uint16" } ], "name": "OrderDeletion", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "name": "owner", "type": "address" }, { "indexed": true, "name": "orderId", "type": "uint16" }, { "indexed": true, "name": "sellToken", "type": "uint16" }, { "indexed": false, "name": "buyToken", "type": "uint16" }, { "indexed": false, "name": "executedSellAmount", "type": "uint128" }, { "indexed": false, "name": "executedBuyAmount", "type": "uint128" } ], "name": "Trade", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "name": "owner", "type": "address" }, { "indexed": true, "name": "orderId", "type": "uint16" }, { "indexed": true, "name": "sellToken", "type": "uint16" }, { "indexed": false, "name": "buyToken", "type": "uint16" }, { "indexed": false, "name": "executedSellAmount", "type": "uint128" }, { "indexed": false, "name": "executedBuyAmount", "type": "uint128" } ], "name": "TradeReversion", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "name": "submitter", "type": "address" }, { "indexed": false, "name": "utility", "type": "uint256" }, { "indexed": false, "name": "disregardedUtility", "type": "uint256" }, { "indexed": false, "name": "burntFees", "type": "uint256" }, { "indexed": false, "name": "lastAuctionBurntFees", "type": "uint256" }, { "indexed": false, "name": "prices", "type": "uint128[]" }, { "indexed": false, "name": "tokenIdsForPrice", "type": "uint16[]" } ], "name": "SolutionSubmission", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "name": "user", "type": "address" }, { "indexed": true, "name": "token", "type": "address" }, { "indexed": false, "name": "amount", "type": "uint256" }, { "indexed": false, "name": "batchId", "type": "uint32" } ], "name": "Deposit", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "name": "user", "type": "address" }, { "indexed": true, "name": "token", "type": "address" }, { "indexed": false, "name": "amount", "type": "uint256" }, { "indexed": false, "name": "batchId", "type": "uint32" } ], "name": "WithdrawRequest", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "name": "user", "type": "address" }, { "indexed": true, "name": "token", "type": "address" }, { "indexed": false, "name": "amount", "type": "uint256" } ], "name": "Withdraw", "type": "event" }, { "constant": false, "inputs": [ { "name": "token", "type": "address" } ], "name": "addToken", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": false, "inputs": [ { "name": "buyToken", "type": "uint16" }, { "name": "sellToken", "type": "uint16" }, { "name": "validUntil", "type": "uint32" }, { "name": "buyAmount", "type": "uint128" }, { "name": "sellAmount", "type": "uint128" } ], "name": "placeOrder", "outputs": [ { "name": "", "type": "uint256" } ], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": false, "inputs": [ { "name": "buyTokens", "type": "uint16[]" }, { "name": "sellTokens", "type": "uint16[]" }, { "name": "validFroms", "type": "uint32[]" }, { "name": "validUntils", "type": "uint32[]" }, { "name": "buyAmounts", "type": "uint128[]" }, { "name": "sellAmounts", "type": "uint128[]" } ], "name": "placeValidFromOrders", "outputs": [ { "name": "orderIds", "type": "uint16[]" } ], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": false, "inputs": [ { "name": "orderIds", "type": "uint16[]" } ], "name": "cancelOrders", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": false, "inputs": [ { "name": "cancellations", "type": "uint16[]" }, { "name": "buyTokens", "type": "uint16[]" }, { "name": "sellTokens", "type": "uint16[]" }, { "name": "validFroms", "type": "uint32[]" }, { "name": "validUntils", "type": "uint32[]" }, { "name": "buyAmounts", "type": "uint128[]" }, { "name": "sellAmounts", "type": "uint128[]" } ], "name": "replaceOrders", "outputs": [ { "name": "", "type": "uint16[]" } ], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": false, "inputs": [ { "name": "batchId", "type": "uint32" }, { "name": "claimedObjectiveValue", "type": "uint256" }, { "name": "owners", "type": "address[]" }, { "name": "orderIds", "type": "uint16[]" }, { "name": "buyVolumes", "type": "uint128[]" }, { "name": "prices", "type": "uint128[]" }, { "name": "tokenIdsForPrice", "type": "uint16[]" } ], "name": "submitSolution", "outputs": [ { "name": "", "type": "uint256" } ], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": true, "inputs": [ { "name": "addr", "type": "address" } ], "name": "tokenAddressToIdMap", "outputs": [ { "name": "", "type": "uint16" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [ { "name": "id", "type": "uint16" } ], "name": "tokenIdToAddressMap", "outputs": [ { "name": "", "type": "address" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [ { "name": "addr", "type": "address" } ], "name": "hasToken", "outputs": [ { "name": "", "type": "bool" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [ { "name": "user", "type": "address" }, { "name": "offset", "type": "uint16" }, { "name": "pageSize", "type": "uint16" } ], "name": "getEncodedUserOrdersPaginated", "outputs": [ { "name": "elements", "type": "bytes" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [ { "name": "previousPageUser", "type": "address" }, { "name": "pageSize", "type": "uint16" } ], "name": "getUsersPaginated", "outputs": [ { "name": "users", "type": "bytes" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [ { "name": "user", "type": "address" } ], "name": "getEncodedUserOrders", "outputs": [ { "name": "elements", "type": "bytes" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [ { "name": "previousPageUser", "type": "address" }, { "name": "previousPageUserOffset", "type": "uint16" }, { "name": "pageSize", "type": "uint16" } ], "name": "getEncodedUsersPaginated", "outputs": [ { "name": "elements", "type": "bytes" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "getEncodedOrders", "outputs": [ { "name": "elements", "type": "bytes" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [ { "name": "batchId", "type": "uint32" } ], "name": "acceptingSolutions", "outputs": [ { "name": "", "type": "bool" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "getCurrentObjectiveValue", "outputs": [ { "name": "", "type": "uint256" } ], "payable": false, "stateMutability": "view", "type": "function" } ], "metadata": "{\"compiler\":{\"version\":\"0.5.10+commit.5a6ea5b1\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"constant\":true,\"inputs\":[],\"name\":\"IMPROVEMENT_DENOMINATOR\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getSecondsRemainingInBatch\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getEncodedOrders\",\"outputs\":[{\"name\":\"elements\",\"type\":\"bytes\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"buyToken\",\"type\":\"uint16\"},{\"name\":\"sellToken\",\"type\":\"uint16\"},{\"name\":\"validUntil\",\"type\":\"uint32\"},{\"name\":\"buyAmount\",\"type\":\"uint128\"},{\"name\":\"sellAmount\",\"type\":\"uint128\"}],\"name\":\"placeOrder\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"batchId\",\"type\":\"uint32\"},{\"name\":\"claimedObjectiveValue\",\"type\":\"uint256\"},{\"name\":\"owners\",\"type\":\"address[]\"},{\"name\":\"orderIds\",\"type\":\"uint16[]\"},{\"name\":\"buyVolumes\",\"type\":\"uint128[]\"},{\"name\":\"prices\",\"type\":\"uint128[]\"},{\"name\":\"tokenIdsForPrice\",\"type\":\"uint16[]\"}],\"name\":\"submitSolution\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"id\",\"type\":\"uint16\"}],\"name\":\"tokenIdToAddressMap\",\"outputs\":[{\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"token\",\"type\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"requestWithdraw\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"FEE_FOR_LISTING_TOKEN_IN_OWL\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"previousPageUser\",\"type\":\"address\"},{\"name\":\"pageSize\",\"type\":\"uint16\"}],\"name\":\"getUsersPaginated\",\"outputs\":[{\"name\":\"users\",\"type\":\"bytes\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"token\",\"type\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"deposit\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"orderIds\",\"type\":\"uint16[]\"}],\"name\":\"cancelOrders\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"AMOUNT_MINIMUM\",\"outputs\":[{\"name\":\"\",\"type\":\"uint128\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"feeToken\",\"outputs\":[{\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"buyTokens\",\"type\":\"uint16[]\"},{\"name\":\"sellTokens\",\"type\":\"uint16[]\"},{\"name\":\"validFroms\",\"type\":\"uint32[]\"},{\"name\":\"validUntils\",\"type\":\"uint32[]\"},{\"name\":\"buyAmounts\",\"type\":\"uint128[]\"},{\"name\":\"sellAmounts\",\"type\":\"uint128[]\"}],\"name\":\"placeValidFromOrders\",\"outputs\":[{\"name\":\"orderIds\",\"type\":\"uint16[]\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"\",\"type\":\"uint16\"}],\"name\":\"currentPrices\",\"outputs\":[{\"name\":\"\",\"type\":\"uint128\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"user\",\"type\":\"address\"}],\"name\":\"getEncodedUserOrders\",\"outputs\":[{\"name\":\"elements\",\"type\":\"bytes\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"\",\"type\":\"address\"},{\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"orders\",\"outputs\":[{\"name\":\"buyToken\",\"type\":\"uint16\"},{\"name\":\"sellToken\",\"type\":\"uint16\"},{\"name\":\"validFrom\",\"type\":\"uint32\"},{\"name\":\"validUntil\",\"type\":\"uint32\"},{\"name\":\"priceNumerator\",\"type\":\"uint128\"},{\"name\":\"priceDenominator\",\"type\":\"uint128\"},{\"name\":\"usedAmount\",\"type\":\"uint128\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"UNLIMITED_ORDER_AMOUNT\",\"outputs\":[{\"name\":\"\",\"type\":\"uint128\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"numTokens\",\"outputs\":[{\"name\":\"\",\"type\":\"uint16\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"\",\"type\":\"address\"},{\"name\":\"\",\"type\":\"address\"}],\"name\":\"lastCreditBatchId\",\"outputs\":[{\"name\":\"\",\"type\":\"uint32\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"previousPageUser\",\"type\":\"address\"},{\"name\":\"previousPageUserOffset\",\"type\":\"uint16\"},{\"name\":\"pageSize\",\"type\":\"uint16\"}],\"name\":\"getEncodedUsersPaginated\",\"outputs\":[{\"name\":\"elements\",\"type\":\"bytes\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"hasToken\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"latestSolution\",\"outputs\":[{\"name\":\"batchId\",\"type\":\"uint32\"},{\"name\":\"solutionSubmitter\",\"type\":\"address\"},{\"name\":\"feeReward\",\"type\":\"uint256\"},{\"name\":\"objectiveValue\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"user\",\"type\":\"address\"},{\"name\":\"token\",\"type\":\"address\"}],\"name\":\"getPendingDeposit\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"},{\"name\":\"\",\"type\":\"uint32\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"cancellations\",\"type\":\"uint16[]\"},{\"name\":\"buyTokens\",\"type\":\"uint16[]\"},{\"name\":\"sellTokens\",\"type\":\"uint16[]\"},{\"name\":\"validFroms\",\"type\":\"uint32[]\"},{\"name\":\"validUntils\",\"type\":\"uint32[]\"},{\"name\":\"buyAmounts\",\"type\":\"uint128[]\"},{\"name\":\"sellAmounts\",\"type\":\"uint128[]\"}],\"name\":\"replaceOrders\",\"outputs\":[{\"name\":\"\",\"type\":\"uint16[]\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"user\",\"type\":\"address\"},{\"name\":\"token\",\"type\":\"address\"}],\"name\":\"getPendingWithdraw\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"},{\"name\":\"\",\"type\":\"uint32\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"batchId\",\"type\":\"uint32\"}],\"name\":\"acceptingSolutions\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"token\",\"type\":\"address\"}],\"name\":\"addToken\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"user\",\"type\":\"address\"},{\"name\":\"token\",\"type\":\"address\"}],\"name\":\"getBalance\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"FEE_DENOMINATOR\",\"outputs\":[{\"name\":\"\",\"type\":\"uint128\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"ENCODED_AUCTION_ELEMENT_WIDTH\",\"outputs\":[{\"name\":\"\",\"type\":\"uint128\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"BATCH_TIME\",\"outputs\":[{\"name\":\"\",\"type\":\"uint32\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getCurrentBatchId\",\"outputs\":[{\"name\":\"\",\"type\":\"uint32\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"user\",\"type\":\"address\"},{\"name\":\"offset\",\"type\":\"uint16\"},{\"name\":\"pageSize\",\"type\":\"uint16\"}],\"name\":\"getEncodedUserOrdersPaginated\",\"outputs\":[{\"name\":\"elements\",\"type\":\"bytes\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"tokenAddressToIdMap\",\"outputs\":[{\"name\":\"\",\"type\":\"uint16\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"token\",\"type\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\"},{\"name\":\"batchId\",\"type\":\"uint32\"}],\"name\":\"requestFutureWithdraw\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"user\",\"type\":\"address\"},{\"name\":\"token\",\"type\":\"address\"}],\"name\":\"hasValidWithdrawRequest\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"MAX_TOKENS\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"user\",\"type\":\"address\"},{\"name\":\"token\",\"type\":\"address\"}],\"name\":\"withdraw\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"MAX_TOUCHED_ORDERS\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getCurrentObjectiveValue\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"name\":\"maxTokens\",\"type\":\"uint256\"},{\"name\":\"_feeToken\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"index\",\"type\":\"uint16\"},{\"indexed\":true,\"name\":\"buyToken\",\"type\":\"uint16\"},{\"indexed\":true,\"name\":\"sellToken\",\"type\":\"uint16\"},{\"indexed\":false,\"name\":\"validFrom\",\"type\":\"uint32\"},{\"indexed\":false,\"name\":\"validUntil\",\"type\":\"uint32\"},{\"indexed\":false,\"name\":\"priceNumerator\",\"type\":\"uint128\"},{\"indexed\":false,\"name\":\"priceDenominator\",\"type\":\"uint128\"}],\"name\":\"OrderPlacement\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"token\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"id\",\"type\":\"uint16\"}],\"name\":\"TokenListing\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"id\",\"type\":\"uint16\"}],\"name\":\"OrderCancellation\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"id\",\"type\":\"uint16\"}],\"name\":\"OrderDeletion\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"name\":\"orderId\",\"type\":\"uint16\"},{\"indexed\":true,\"name\":\"sellToken\",\"type\":\"uint16\"},{\"indexed\":false,\"name\":\"buyToken\",\"type\":\"uint16\"},{\"indexed\":false,\"name\":\"executedSellAmount\",\"type\":\"uint128\"},{\"indexed\":false,\"name\":\"executedBuyAmount\",\"type\":\"uint128\"}],\"name\":\"Trade\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"name\":\"orderId\",\"type\":\"uint16\"},{\"indexed\":true,\"name\":\"sellToken\",\"type\":\"uint16\"},{\"indexed\":false,\"name\":\"buyToken\",\"type\":\"uint16\"},{\"indexed\":false,\"name\":\"executedSellAmount\",\"type\":\"uint128\"},{\"indexed\":false,\"name\":\"executedBuyAmount\",\"type\":\"uint128\"}],\"name\":\"TradeReversion\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"submitter\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"utility\",\"type\":\"uint256\"},{\"indexed\":false,\"name\":\"disregardedUtility\",\"type\":\"uint256\"},{\"indexed\":false,\"name\":\"burntFees\",\"type\":\"uint256\"},{\"indexed\":false,\"name\":\"lastAuctionBurntFees\",\"type\":\"uint256\"},{\"indexed\":false,\"name\":\"prices\",\"type\":\"uint128[]\"},{\"indexed\":false,\"name\":\"tokenIdsForPrice\",\"type\":\"uint16[]\"}],\"name\":\"SolutionSubmission\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"user\",\"type\":\"address\"},{\"indexed\":true,\"name\":\"token\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"amount\",\"type\":\"uint256\"},{\"indexed\":false,\"name\":\"batchId\",\"type\":\"uint32\"}],\"name\":\"Deposit\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"user\",\"type\":\"address\"},{\"indexed\":true,\"name\":\"token\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"amount\",\"type\":\"uint256\"},{\"indexed\":false,\"name\":\"batchId\",\"type\":\"uint32\"}],\"name\":\"WithdrawRequest\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"user\",\"type\":\"address\"},{\"indexed\":true,\"name\":\"token\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"Withdraw\",\"type\":\"event\"}],\"devdoc\":{\"author\":\"@gnosis/dfusion-team <https://github.com/orgs/gnosis/teams/dfusion-team/members>\",\"methods\":{\"addToken(address)\":{\"details\":\"Used to list a new token on the contract: Hence, making it available for exchange in an auction.\",\"params\":{\"token\":\"ERC20 token to be listed. * Requirements: - `maxTokens` has not already been reached - `token` has not already been added\"}},\"cancelOrders(uint16[])\":{\"details\":\"a user facing function used to cancel orders. If the order is valid for the batch that is currently being solved, it sets order expiry to that batchId. Otherwise it removes it from storage. Can be called multiple times (e.g. to eventually free storage once order is expired).\",\"params\":{\"orderIds\":\"referencing the indices of user's orders to be cancelled * Emits an {OrderCancellation} or {OrderDeletion} with sender's address and orderId\"}},\"constructor\":{\"details\":\"Constructor determines exchange parameters\",\"params\":{\"_feeToken\":\"Address of ERC20 fee token.\",\"maxTokens\":\"The maximum number of tokens that can be listed.\"}},\"deposit(address,uint256)\":{\"details\":\"credits user with deposit amount on next epoch (given by getCurrentBatchId)\",\"params\":{\"amount\":\"number of token(s) to be credited to user's account * Emits an {Deposit} event with relevent deposit information. * Requirements: - token transfer to contract is successfull\",\"token\":\"address of token to be deposited\"}},\"getBalance(address,address)\":{\"details\":\"fetches and returns user's balance\",\"params\":{\"token\":\"address of ERC20 token return Current `token` balance of `user`'s account\",\"user\":\"address of user\"}},\"getCurrentBatchId()\":{\"details\":\"getter function to determine current auction id. return current batchId\"},\"getCurrentObjectiveValue()\":{\"details\":\"gets the objective value of currently winning solution.\",\"return\":\"objective function evaluation of the currently winning solution, or zero if no solution proposed.\"},\"getEncodedOrders()\":{\"details\":\"View returning all byte-encoded sell orders\",\"return\":\"encoded bytes representing all orders ordered by (user, index)\"},\"getEncodedUserOrders(address)\":{\"details\":\"View returning all byte-encoded sell orders for specified user\",\"params\":{\"user\":\"address of user whose orders are being queried\"},\"return\":\"encoded bytes representing all orders\"},\"getEncodedUserOrdersPaginated(address,uint16,uint16)\":{\"details\":\"View returning all byte-encoded sell orders for specified user\",\"params\":{\"offset\":\"uint determining the starting orderIndex\",\"pageSize\":\"uint determining the count of elements to be viewed\",\"user\":\"address of user whose orders are being queried\"},\"return\":\"encoded bytes representing all orders\"},\"getEncodedUsersPaginated(address,uint16,uint16)\":{\"details\":\"View returning byte-encoded sell orders in paginated form\",\"params\":{\"pageSize\":\"uint determining the count of orders to be returned per page\",\"previousPageUser\":\"address of last user received in the previous page (address(0) for first page)\",\"previousPageUserOffset\":\"the number of orders received for the last user on the previous page (0 for first page).\"},\"return\":\"encoded bytes representing a page of orders ordered by (user, index)\"},\"getPendingDeposit(address,address)\":{\"details\":\"getter function used to display pending deposit\",\"params\":{\"token\":\"address of ERC20 token return amount and batchId of deposit's transfer if any (else 0)\",\"user\":\"address of user\"}},\"getPendingWithdraw(address,address)\":{\"details\":\"getter function used to display pending withdraw\",\"params\":{\"token\":\"address of ERC20 token return amount and batchId when withdraw was requested if any (else 0)\",\"user\":\"address of user\"}},\"getSecondsRemainingInBatch()\":{\"details\":\"used to determine how much time is left in a batch return seconds remaining in current batch\"},\"getUsersPaginated(address,uint16)\":{\"details\":\"View returning all byte-encoded users in paginated form\",\"params\":{\"pageSize\":\"uint determining the count of users to be returned per page\",\"previousPageUser\":\"address of last user received in last pages (address(0) for first page)\"},\"return\":\"encoded packed bytes of user addresses\"},\"hasToken(address)\":{\"details\":\"View returning a bool attesting whether token was already added\",\"params\":{\"addr\":\"address of the token to be checked\"},\"return\":\"bool attesting whether token was already added\"},\"hasValidWithdrawRequest(address,address)\":{\"details\":\"Used to determine if user has a valid pending withdraw request of specific token\",\"params\":{\"token\":\"address of ERC20 token return true if `user` has valid withdraw request for `token`, otherwise false\",\"user\":\"address of user\"}},\"placeOrder(uint16,uint16,uint32,uint128,uint128)\":{\"details\":\"A user facing function used to place limit sell orders in auction with expiry defined by batchId\",\"params\":{\"buyAmount\":\"relative minimum amount of requested buy amount\",\"buyToken\":\"id of token to be bought\",\"sellAmount\":\"maximum amount of sell token to be exchanged\",\"sellToken\":\"id of token to be sold\",\"validUntil\":\"batchId representing order's expiry\"},\"return\":\"orderId defined as the index in user's order array * Emits an {OrderPlacement} event with all relevant order details.\"},\"placeValidFromOrders(uint16[],uint16[],uint32[],uint32[],uint128[],uint128[])\":{\"details\":\"A user facing function used to place limit sell orders in auction with expiry defined by batchId Note that parameters are passed as arrays and the indices correspond to each order.\",\"params\":{\"buyAmounts\":\"relative minimum amount of requested buy amounts\",\"buyTokens\":\"ids of tokens to be bought\",\"sellAmounts\":\"maximum amounts of sell token to be exchanged\",\"sellTokens\":\"ids of tokens to be sold\",\"validFroms\":\"batchIds representing order's validity start time\",\"validUntils\":\"batchIds representing order's expiry\"},\"return\":\"`orderIds` an array of indices in which `msg.sender`'s orders are included * Emits an {OrderPlacement} event with all relevant order details.\"},\"replaceOrders(uint16[],uint16[],uint16[],uint32[],uint32[],uint128[],uint128[])\":{\"details\":\"A user facing wrapper to cancel and place new orders in the same transaction.\",\"params\":{\"buyAmounts\":\"relative minimum amount of requested buy amounts in new orders\",\"buyTokens\":\"ids of tokens to be bought in new orders\",\"cancellations\":\"indices of orders to be cancelled\",\"sellAmounts\":\"maximum amounts of sell token to be exchanged in new orders\",\"sellTokens\":\"ids of tokens to be sold in new orders\",\"validFroms\":\"batchIds representing order's validity start time in new orders\",\"validUntils\":\"batchIds represnnting order's expiry in new orders\"},\"return\":\"an array of indices in which `msg.sender`'s new orders are included * Emits {OrderCancellation} events for all cancelled orders and {OrderPlacement} events with relevant new order details.\"},\"requestFutureWithdraw(address,uint256,uint32)\":{\"details\":\"Signals and initiates user's intent to withdraw.\",\"params\":{\"amount\":\"number of token(s) to be withdrawn\",\"batchId\":\"state index at which request is to be made. * Emits an {WithdrawRequest} event with relevent request information.\",\"token\":\"address of token to be withdrawn\"}},\"requestWithdraw(address,uint256)\":{\"details\":\"Signals and initiates user's intent to withdraw.\",\"params\":{\"amount\":\"number of token(s) to be withdrawn * Emits an {WithdrawRequest} event with relevent request information.\",\"token\":\"address of token to be withdrawn\"}},\"submitSolution(uint32,uint256,address[],uint16[],uint128[],uint128[],uint16[])\":{\"details\":\"a solver facing function called for auction settlement\",\"params\":{\"batchId\":\"index of auction solution is referring to\",\"buyVolumes\":\"executed buy amounts for each order identified by index of owner-orderId arrays\",\"orderIds\":\"array of order indices used in parallel with owners to identify touched order\",\"owners\":\"array of addresses corresponding to touched orders\",\"prices\":\"list of prices for touched tokens indexed by next parameter\",\"tokenIdsForPrice\":\"price[i] is the price for the token with tokenID tokenIdsForPrice[i]\"},\"return\":\"the computed objective value of the solution * Requirements: - Solutions for this `batchId` are currently being accepted. - Claimed objetive value is a great enough improvement on the current winning solution - Fee Token price is non-zero - `tokenIdsForPrice` is sorted. - Number of touched orders does not exceed `MAX_TOUCHED_ORDERS`. - Each touched order is valid at current `batchId`. - Each touched order's `executedSellAmount` does not exceed its remaining amount. - Limit Price of each touched order is respected. - Solution's objective evaluation must be positive. * Sub Requirements: Those nested within other functions - checkAndOverrideObjectiveValue; Objetive value is a great enough improvement on the current winning solution - checkTokenConservation; for all, non-fee, tokens total amount sold == total amount bought\"},\"tokenAddressToIdMap(address)\":{\"details\":\"View returning ID of listed tokens\",\"params\":{\"addr\":\"address of listed token.\"},\"return\":\"tokenId as stored within the contract.\"},\"tokenIdToAddressMap(uint16)\":{\"details\":\"View returning address of listed token by ID\",\"params\":{\"id\":\"tokenId as stored, via BiMap, within the contract.\"},\"return\":\"address of (listed) token\"},\"withdraw(address,address)\":{\"details\":\"Claims pending withdraw - can be called on behalf of others\",\"params\":{\"token\":\"address of token to be withdrawn\",\"user\":\"address of user who withdraw is being claimed. * Emits an {Withdraw} event stating that `user` withdrew `amount` of `token` * Requirements: - withdraw was requested in previous epoch - token was received from exchange in current auction batch\"}}},\"title\":\"BatchExchange - A decentralized exchange for any ERC20 token as a multi-token batch auction with uniform clearing prices. For more information visit: <https://github.com/gnosis/dex-contracts>\"},\"userdoc\":{\"methods\":{}}},\"settings\":{\"compilationTarget\":{\"/Users/felixleupold/Gnosis/dex-contracts/contracts/BatchExchange.sol\":\"BatchExchange\"},\"evmVersion\":\"petersburg\",\"libraries\":{},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"/Users/felixleupold/Gnosis/dex-contracts/contracts/BatchExchange.sol\":{\"keccak256\":\"0x568ae2e96fec035e0be33bc8d79ab961849fe35bcf067b30459bb1c8798df74a\",\"urls\":[\"bzzr://0177e5a5dac570a177dbb7b4379d609292f01f3b1da1c626becae751d3dc54d9\",\"dweb:/ipfs/QmSATs9QyuvTXCj23ihapUQEkbzrRZvXEupvuv3QZhttce\"]},\"/Users/felixleupold/Gnosis/dex-contracts/contracts/EpochTokenLocker.sol\":{\"keccak256\":\"0x6a0e16a44b858c3af0e4e0113af93bf23160f175f36c524f9e753085d8de9978\",\"urls\":[\"bzzr://d6178f1d3533ed733e7eba91d12ce1597711e5b74ad1a4492aed9dc28a8d5c97\",\"dweb:/ipfs/QmeVeD8xeZUfwRi4BCBhrBWCHUDF3tdzwwYDgSNr5T4xPo\"]},\"/Users/felixleupold/Gnosis/dex-contracts/contracts/libraries/TokenConservation.sol\":{\"keccak256\":\"0x674557850e56ef6a716bb1dc528479e290238c592d0764bc7144cc1e811cedea\",\"urls\":[\"bzzr://f6a943472678132ef59cf3b2f131daf28952c1b72cd0e28bda46050dd577a29b\",\"dweb:/ipfs/QmbQsAgu7Fd6i84A98DxXemSnW3UkgccXxNnZLKvtuzHdE\"]},\"@gnosis.pm/owl-token/contracts/TokenOWL.sol\":{\"keccak256\":\"0x79dd31b4211c98b57c6c4b85c4902a786c0a1f2549b0481496a322955880c6e4\",\"urls\":[\"bzzr://9004a7707bca62b408542476343c3bd6ca17be5509a3f17e7495ff011495d3c6\",\"dweb:/ipfs/QmNaoSa5P6Py6ZhuqXZeeW6eyG8Hx7FYJFygXPNVBeXSJV\"]},\"@gnosis.pm/solidity-data-structures/contracts/libraries/IdToAddressBiMap.sol\":{\"keccak256\":\"0xde850dc49a037a4acbd792d295afed2222f2d6cd3780240317db2d1ca8ccebc0\",\"urls\":[\"bzzr://900a7be0f54054d59ccb3225f788d77dbf44ea22e6b8d7bd7d295f079c8932f0\",\"dweb:/ipfs/QmNQTeooqchHdMjQfRUmCjwyTUg5PJ4z6he3ym5YUsm8Lm\"]},\"@gnosis.pm/solidity-data-structures/contracts/libraries/IterableAppendOnlySet.sol\":{\"keccak256\":\"0x1447fbecc010c778476e135325a5c8fec70d02d71f736fae8cfccd85ae481241\",\"urls\":[\"bzzr://eea3ac90e8b9e299179c21134dfbf8be2d5ae1276816f2f95f63b836e11e285e\",\"dweb:/ipfs/QmZMn8wVzmr49CXjaix5BMWSNybkDv6BeSQpAFr3btaxuu\"]},\"@gnosis.pm/util-contracts/c