Files
dodo-contractV2/build-v1/contracts/Pricing.json
2020-11-10 18:38:34 +08:00

14277 lines
621 KiB
JSON

{
"contractName": "Pricing",
"abi": [
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "previousOwner",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "newOwner",
"type": "address"
}
],
"name": "OwnershipTransferPrepared",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "previousOwner",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "newOwner",
"type": "address"
}
],
"name": "OwnershipTransferred",
"type": "event"
},
{
"inputs": [],
"name": "_BASE_BALANCE_",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "_BASE_BALANCE_LIMIT_",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "_BASE_CAPITAL_RECEIVE_QUOTE_",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "_BASE_CAPITAL_TOKEN_",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "_BASE_TOKEN_",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "_BUYING_ALLOWED_",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"name": "_CLAIMED_",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "_CLOSED_",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "_DEPOSIT_BASE_ALLOWED_",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "_DEPOSIT_QUOTE_ALLOWED_",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "_GAS_PRICE_LIMIT_",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "_K_",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "_LP_FEE_RATE_",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "_MAINTAINER_",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "_MT_FEE_RATE_",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "_NEW_OWNER_",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "_ORACLE_",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "_OWNER_",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "_QUOTE_BALANCE_",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "_QUOTE_BALANCE_LIMIT_",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "_QUOTE_CAPITAL_RECEIVE_BASE_",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "_QUOTE_CAPITAL_TOKEN_",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "_QUOTE_TOKEN_",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "_R_STATUS_",
"outputs": [
{
"internalType": "enum Types.RStatus",
"name": "",
"type": "uint8"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "_SELLING_ALLOWED_",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "_SUPERVISOR_",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "_TARGET_BASE_TOKEN_AMOUNT_",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "_TARGET_QUOTE_TOKEN_AMOUNT_",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "_TRADE_ALLOWED_",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "claimOwnership",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "lp",
"type": "address"
}
],
"name": "getBaseCapitalBalanceOf",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "getOraclePrice",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "lp",
"type": "address"
}
],
"name": "getQuoteCapitalBalanceOf",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "getTotalBaseCapital",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "getTotalQuoteCapital",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "newOwner",
"type": "address"
}
],
"name": "transferOwnership",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "version",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "pure",
"type": "function"
},
{
"inputs": [],
"name": "getExpectedTarget",
"outputs": [
{
"internalType": "uint256",
"name": "baseTarget",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "quoteTarget",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "getMidPrice",
"outputs": [
{
"internalType": "uint256",
"name": "midPrice",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
}
],
"metadata": "{\"compiler\":{\"version\":\"0.6.9+commit.3e3065ac\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferPrepared\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"_BASE_BALANCE_\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"_BASE_BALANCE_LIMIT_\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"_BASE_CAPITAL_RECEIVE_QUOTE_\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"_BASE_CAPITAL_TOKEN_\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"_BASE_TOKEN_\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"_BUYING_ALLOWED_\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"_CLAIMED_\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"_CLOSED_\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"_DEPOSIT_BASE_ALLOWED_\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"_DEPOSIT_QUOTE_ALLOWED_\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"_GAS_PRICE_LIMIT_\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"_K_\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"_LP_FEE_RATE_\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"_MAINTAINER_\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"_MT_FEE_RATE_\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"_NEW_OWNER_\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"_ORACLE_\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"_OWNER_\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"_QUOTE_BALANCE_\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"_QUOTE_BALANCE_LIMIT_\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"_QUOTE_CAPITAL_RECEIVE_BASE_\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"_QUOTE_CAPITAL_TOKEN_\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"_QUOTE_TOKEN_\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"_R_STATUS_\",\"outputs\":[{\"internalType\":\"enum Types.RStatus\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"_SELLING_ALLOWED_\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"_SUPERVISOR_\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"_TARGET_BASE_TOKEN_AMOUNT_\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"_TARGET_QUOTE_TOKEN_AMOUNT_\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"_TRADE_ALLOWED_\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"claimOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"lp\",\"type\":\"address\"}],\"name\":\"getBaseCapitalBalanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getExpectedTarget\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"baseTarget\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"quoteTarget\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getMidPrice\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"midPrice\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getOraclePrice\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"lp\",\"type\":\"address\"}],\"name\":\"getQuoteCapitalBalanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getTotalBaseCapital\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getTotalQuoteCapital\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"version\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"pure\",\"type\":\"function\"}],\"devdoc\":{\"author\":\"DODO Breeder\",\"methods\":{},\"title\":\"Pricing\"},\"userdoc\":{\"methods\":{},\"notice\":\"DODO Pricing model\"}},\"settings\":{\"compilationTarget\":{\"/Users/owen/Desktop/dodo/dodo-smart-contract/contracts/impl/Pricing.sol\":\"Pricing\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"/Users/owen/Desktop/dodo/dodo-smart-contract/contracts/impl/Pricing.sol\":{\"keccak256\":\"0xaec47be06aa7f8994923c80f2c2318304423666300a48f03a43265787f27c708\",\"license\":\"Apache-2.0\",\"urls\":[\"bzz-raw://e187f46639dd1127abc81439896e67e21338e9eee8707996606b0c9c8ede68a1\",\"dweb:/ipfs/QmPSfPbZuyM3haHZtWVFknZLAMqg2Jy613jQ36JGuCm7LS\"]},\"/Users/owen/Desktop/dodo/dodo-smart-contract/contracts/impl/Storage.sol\":{\"keccak256\":\"0xbf15f2a72d59bbf0ed32b2a24fc4a68d45ffaa60dd2b2c1cc555d03ec1cd2f0a\",\"license\":\"Apache-2.0\",\"urls\":[\"bzz-raw://7289884a2a8939295c4f61aeb7754bd3ce49e9d09188a1eddb762342589f36be\",\"dweb:/ipfs/QmaHYH51wieAyxBDASyHyfYSeu6UJNV7adD3AceeZXCgcZ\"]},\"/Users/owen/Desktop/dodo/dodo-smart-contract/contracts/intf/IDODOLpToken.sol\":{\"keccak256\":\"0x2183977c7a3cf5aa8d2f56d2167bf59515e34a8e4ebd2402efa85b612631955f\",\"license\":\"Apache-2.0\",\"urls\":[\"bzz-raw://61766578f8d1bef7f51912a5327e8d4e95e3d9adb509e9486b4e2c8cf179f5e6\",\"dweb:/ipfs/QmXJRK4JKMrJkdn7BFVueoNRixsu26shnX3Dxeb5T9JKK4\"]},\"/Users/owen/Desktop/dodo/dodo-smart-contract/contracts/intf/IOracle.sol\":{\"keccak256\":\"0xed4a31155c30a764366aba2244e42406269e59618088f93c02f1b4c9fec9e53c\",\"license\":\"Apache-2.0\",\"urls\":[\"bzz-raw://bd3d50110c9120d942f7713e1cfced848ba7721ea336b2d9c4a87a6eb2a82ca9\",\"dweb:/ipfs/QmTYFeDcAyA2JpfoL1LsGLgj4TeRJxNV1rM27vdcaZSwpF\"]},\"/Users/owen/Desktop/dodo/dodo-smart-contract/contracts/lib/DODOMath.sol\":{\"keccak256\":\"0xe3f63c53706f21ad68ebeff69321682ffa83bb0552db7e4453dff9772724f657\",\"license\":\"Apache-2.0\",\"urls\":[\"bzz-raw://64e385f8c3fbe9e485d0b1b0f90f9621bf50fe02ee7cb95a44828a255db3581f\",\"dweb:/ipfs/QmNesw9cspw1fDDumDy1BSrCeGVij1BAfAVXpfajKHGUcn\"]},\"/Users/owen/Desktop/dodo/dodo-smart-contract/contracts/lib/DecimalMath.sol\":{\"keccak256\":\"0x9a093cbac4e37ed4ee5e27495dae08754bbfec81f7c0ceb57a5a7ac4f362208f\",\"license\":\"Apache-2.0\",\"urls\":[\"bzz-raw://1ddd9e5de1c555f0d1232e148fe18574e6adaa348e792844d9011bbd39bf908f\",\"dweb:/ipfs/QmSgZNwPNqCrQC4kJNdwH3iQNasbTfw2cbTtAtNVcpqnYc\"]},\"/Users/owen/Desktop/dodo/dodo-smart-contract/contracts/lib/InitializableOwnable.sol\":{\"keccak256\":\"0xf462d86a85221f424c5a40f3c0d4a699c72a61b31ed07091ffb0e0b28b3cd137\",\"license\":\"Apache-2.0\",\"urls\":[\"bzz-raw://3d92b79f4527b3d7812395c41e5d0786309a121b99af3bff5cd7663f7255d335\",\"dweb:/ipfs/QmYkQANWtKsJNHKeD6PrtUFeC3D6uWAxhXjB97eBHwqtzK\"]},\"/Users/owen/Desktop/dodo/dodo-smart-contract/contracts/lib/ReentrancyGuard.sol\":{\"keccak256\":\"0xc9c3fc946350fd72083a9d5b1327ff923533ef37b054bc7b6007562b20b0faaf\",\"license\":\"Apache-2.0\",\"urls\":[\"bzz-raw://fc140417457139fb240427629673bfaf970c5d4568ad1cfe582764c6e4855bbb\",\"dweb:/ipfs/Qmd7ESYe5kyM6NYiSzeFE74f1YGGPXzpdVd5qnYg2AvgH8\"]},\"/Users/owen/Desktop/dodo/dodo-smart-contract/contracts/lib/SafeMath.sol\":{\"keccak256\":\"0x57d750628881687f826b54f60cbfd46c1a172433eed892bbb123f91869886af1\",\"license\":\"Apache-2.0\",\"urls\":[\"bzz-raw://b40bd7946010ddae9679f36630510217dcaa9cb8643824f9edc8ef52bda95717\",\"dweb:/ipfs/QmZSjpfUGyrmokZyaMc74a8h6zy2qFVECPVP8VfTvzNEFb\"]},\"/Users/owen/Desktop/dodo/dodo-smart-contract/contracts/lib/Types.sol\":{\"keccak256\":\"0x0aebcc897b4de833e87e46a11e5a70d2b6e1d2fd99ebdf9e32e6421924f18b15\",\"license\":\"Apache-2.0\",\"urls\":[\"bzz-raw://a1098dace4f0664b0e3f5c3b6ce535ad2aba52e68fb6d1ea94b09debc06ed33c\",\"dweb:/ipfs/QmRbiq7M3Y8utAXaPWmVooGmoYF27N5dKVn6QYTaDFwqdP\"]}},\"version\":1}",
"bytecode": "0x608060405234801561001057600080fd5b50610ec7806100206000396000f3fe608060405234801561001057600080fd5b506004361061023d5760003560e01c80638456db151161013b578063c6b73cf9116100b8578063ec2fd46d1161007c578063ec2fd46d146103a7578063ee27c689146103af578063f2fde38b146103b7578063f67ed448146103ca578063ffa64225146103dd5761023d565b8063c6b73cf91461037f578063d4b9704614610387578063d689107c1461038f578063dd58b41c14610397578063eab5d20e1461039f5761023d565b8063ab44a7a3116100ff578063ab44a7a314610357578063ac1fbc981461035f578063b2094fd314610367578063c0ffa1781461036f578063c5bbffe8146103775761023d565b80638456db151461032f5780638ff5e742146103375780639b020fba1461033f578063a3161a5614610347578063a598aca71461034f5761023d565b80634a248d2a116101c95780636ec6a58d1161018d5780636ec6a58d146102fc57806373a2ab7c14610304578063796da7af1461030c5780637aed942d146103145780637c9b8e89146103275761023d565b80634a248d2a146102ba5780634de4527e146102c25780634e71e0c8146102ca57806354fd4d50146102d457806368be20ad146102dc5761023d565b806317be952e1161021057806317be952e14610285578063245c96851461029a5780632aa82c65146102a25780633960f142146102aa5780634322ec83146102b25761023d565b80630cd1667d146102425780630e6518e91461026057806316048bc4146102685780631769ddaa1461027d575b600080fd5b61024a6103f3565b6040516102579190610e7a565b60405180910390f35b61024a610476565b61027061047c565b6040516102579190610d45565b61024a61048b565b61028d610491565b6040516102579190610d64565b61024a61049a565b61024a6104a0565b6102706104e5565b6102706104f4565b610270610503565b61024a610512565b6102d2610518565b005b61024a6105af565b6102ef6102ea366004610d06565b6105b4565b6040516102579190610d59565b6102ef6105c9565b6102706105d9565b61024a6105e8565b61024a610322366004610d06565b61062d565b61024a6106b4565b6102706106ba565b6102ef6106c9565b61024a6106d7565b6102ef6106dd565b6102ef6106e6565b61024a6106f6565b6102706106fc565b61024a61070b565b61024a610711565b6102ef610717565b61024a610727565b61027061072d565b61027061073c565b6102ef61074b565b61024a61075b565b61024a610761565b61024a610767565b6102d26103c5366004610d06565b610864565b61024a6103d8366004610d06565b61090f565b6103e5610940565b604051610257929190610e83565b601354604080516318160ddd60e01b815290516000926001600160a01b0316916318160ddd916004808301926020929190829003018186803b15801561043857600080fd5b505afa15801561044c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104709190610d2d565b90505b90565b60165481565b6000546001600160a01b031681565b60055481565b600e5460ff1681565b60105481565b601454604080516318160ddd60e01b815290516000926001600160a01b0316916318160ddd916004808301926020929190829003018186803b15801561043857600080fd5b6006546001600160a01b031681565b6007546001600160a01b031681565b6008546001600160a01b031681565b60025481565b6001546001600160a01b0316331461054b5760405162461bcd60e51b815260040161054290610d78565b60405180910390fd5b600154600080546040516001600160a01b0393841693909116917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a360018054600080546001600160a01b03199081166001600160a01b03841617909155169055565b606590565b60176020526000908152604090205460ff1681565b600154600160b01b900460ff1681565b600a546001600160a01b031681565b600a5460408051634c6afee560e11b815290516000926001600160a01b0316916398d5fdca916004808301926020929190829003018186803b15801561043857600080fd5b6013546040516370a0823160e01b81526000916001600160a01b0316906370a082319061065e908590600401610d45565b60206040518083038186803b15801561067657600080fd5b505afa15801561068a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106ae9190610d2d565b92915050565b60125481565b6001546001600160a01b031681565b600354610100900460ff1681565b60045481565b60035460ff1681565b600154600160c01b900460ff1681565b600b5481565b6014546001600160a01b031681565b600f5481565b600c5481565b600154600160b81b900460ff1681565b60155481565b6009546001600160a01b031681565b6013546001600160a01b031681565b600154600160c81b900460ff1681565b60115481565b600d5481565b6000806000610774610940565b90925090506002600e5460ff16600281111561078c57fe5b141561081a5760006107c46107bc6012546107b08586610a0490919063ffffffff16565b9063ffffffff610a4516565b601254610a77565b90506107fd6107d5600d5483610a95565b600d546107f190670de0b6b3a76400009063ffffffff610ab716565b9063ffffffff610adf16565b905061081061080a6105e8565b82610a77565b9350505050610473565b60006108406108386011546107b08687610a0490919063ffffffff16565b601154610a77565b90506108516107d5600d5483610a95565b905061081061085e6105e8565b82610a95565b6000546001600160a01b0316331461088e5760405162461bcd60e51b815260040161054290610e11565b6001600160a01b0381166108b45760405162461bcd60e51b815260040161054290610dea565b600080546040516001600160a01b03808516939216917fdcf55418cee3220104fef63f979ff3c4097ad240c0c43dcb33ce837748983e6291a3600180546001600160a01b0319166001600160a01b0392909216919091179055565b6014546040516370a0823160e01b81526000916001600160a01b0316906370a082319061065e908590600401610d45565b601254601154600091829182600e5460ff16600281111561095d57fe5b141561097457600f54601054935093505050610a00565b6002600e5460ff16600281111561098757fe5b14156109b9576000610997610b04565b600f549091506109ad848363ffffffff610adf16565b94509450505050610a00565b6001600e5460ff1660028111156109cc57fe5b14156109fd5760006109dc610b6b565b90506109ee828263ffffffff610adf16565b60105494509450505050610a00565b50505b9091565b600082610a13575060006106ae565b82820282848281610a2057fe5b0414610a3e5760405162461bcd60e51b815260040161054290610e57565b9392505050565b6000808211610a665760405162461bcd60e51b815260040161054290610d9f565b818381610a6f57fe5b049392505050565b6000610a3e826107b085670de0b6b3a764000063ffffffff610a0416565b6000670de0b6b3a7640000610ab0848463ffffffff610a0416565b81610a6f57fe5b600082821115610ad95760405162461bcd60e51b815260040161054290610dc7565b50900390565b600082820183811015610a3e5760405162461bcd60e51b815260040161054290610e34565b600080610b1e600f54601154610ab790919063ffffffff16565b90506000610b2a6105e8565b90506000610b388383610a95565b90506000610b4b601254600d5484610bc9565b9050610b6260125482610ab790919063ffffffff16565b94505050505090565b600080610b85601054601254610ab790919063ffffffff16565b90506000610b916105e8565b90506000610b9f8383610a77565b90506000610bb2601154600d5484610bc9565b9050610b6260115482610ab790919063ffffffff16565b600080610bf0610bea6004610bde8787610a95565b9063ffffffff610a0416565b86610c78565b9050610c16610c11670de0b6b3a7640000610bde848263ffffffff610adf16565b610ca2565b90506000610c4b610c3583670de0b6b3a764000063ffffffff610ab716565b610c4687600263ffffffff610a0416565b610c78565b9050610c6e86610c69670de0b6b3a76400008463ffffffff610adf16565b610a95565b9695505050505050565b6000610a3e82610c9685670de0b6b3a764000063ffffffff610a0416565b9063ffffffff610cd916565b80600160028204015b81811015610cd357809150600281828581610cc257fe5b040181610ccb57fe5b049050610cab565b50919050565b600080610ce68484610a45565b905082810284038015610cfe575060010190506106ae565b5090506106ae565b600060208284031215610d17578081fd5b81356001600160a01b0381168114610a3e578182fd5b600060208284031215610d3e578081fd5b5051919050565b6001600160a01b0391909116815260200190565b901515815260200190565b6020810160038310610d7257fe5b91905290565b6020808252600d908201526c494e56414c49445f434c41494d60981b604082015260600190565b6020808252600e908201526d2224ab24a224a723afa2a92927a960911b604082015260600190565b60208082526009908201526829aaa12fa2a92927a960b91b604082015260600190565b6020808252600d908201526c24a72b20a624a22fa7aba722a960991b604082015260600190565b6020808252600990820152682727aa2fa7aba722a960b91b604082015260600190565b60208082526009908201526820a2222fa2a92927a960b91b604082015260600190565b60208082526009908201526826aaa62fa2a92927a960b91b604082015260600190565b90815260200190565b91825260208201526040019056fea264697066735822122015504639ba866f736aae2392c0b00473f18b005220704b493962a458c6d65db064736f6c63430006090033",
"deployedBytecode": "0x608060405234801561001057600080fd5b506004361061023d5760003560e01c80638456db151161013b578063c6b73cf9116100b8578063ec2fd46d1161007c578063ec2fd46d146103a7578063ee27c689146103af578063f2fde38b146103b7578063f67ed448146103ca578063ffa64225146103dd5761023d565b8063c6b73cf91461037f578063d4b9704614610387578063d689107c1461038f578063dd58b41c14610397578063eab5d20e1461039f5761023d565b8063ab44a7a3116100ff578063ab44a7a314610357578063ac1fbc981461035f578063b2094fd314610367578063c0ffa1781461036f578063c5bbffe8146103775761023d565b80638456db151461032f5780638ff5e742146103375780639b020fba1461033f578063a3161a5614610347578063a598aca71461034f5761023d565b80634a248d2a116101c95780636ec6a58d1161018d5780636ec6a58d146102fc57806373a2ab7c14610304578063796da7af1461030c5780637aed942d146103145780637c9b8e89146103275761023d565b80634a248d2a146102ba5780634de4527e146102c25780634e71e0c8146102ca57806354fd4d50146102d457806368be20ad146102dc5761023d565b806317be952e1161021057806317be952e14610285578063245c96851461029a5780632aa82c65146102a25780633960f142146102aa5780634322ec83146102b25761023d565b80630cd1667d146102425780630e6518e91461026057806316048bc4146102685780631769ddaa1461027d575b600080fd5b61024a6103f3565b6040516102579190610e7a565b60405180910390f35b61024a610476565b61027061047c565b6040516102579190610d45565b61024a61048b565b61028d610491565b6040516102579190610d64565b61024a61049a565b61024a6104a0565b6102706104e5565b6102706104f4565b610270610503565b61024a610512565b6102d2610518565b005b61024a6105af565b6102ef6102ea366004610d06565b6105b4565b6040516102579190610d59565b6102ef6105c9565b6102706105d9565b61024a6105e8565b61024a610322366004610d06565b61062d565b61024a6106b4565b6102706106ba565b6102ef6106c9565b61024a6106d7565b6102ef6106dd565b6102ef6106e6565b61024a6106f6565b6102706106fc565b61024a61070b565b61024a610711565b6102ef610717565b61024a610727565b61027061072d565b61027061073c565b6102ef61074b565b61024a61075b565b61024a610761565b61024a610767565b6102d26103c5366004610d06565b610864565b61024a6103d8366004610d06565b61090f565b6103e5610940565b604051610257929190610e83565b601354604080516318160ddd60e01b815290516000926001600160a01b0316916318160ddd916004808301926020929190829003018186803b15801561043857600080fd5b505afa15801561044c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104709190610d2d565b90505b90565b60165481565b6000546001600160a01b031681565b60055481565b600e5460ff1681565b60105481565b601454604080516318160ddd60e01b815290516000926001600160a01b0316916318160ddd916004808301926020929190829003018186803b15801561043857600080fd5b6006546001600160a01b031681565b6007546001600160a01b031681565b6008546001600160a01b031681565b60025481565b6001546001600160a01b0316331461054b5760405162461bcd60e51b815260040161054290610d78565b60405180910390fd5b600154600080546040516001600160a01b0393841693909116917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a360018054600080546001600160a01b03199081166001600160a01b03841617909155169055565b606590565b60176020526000908152604090205460ff1681565b600154600160b01b900460ff1681565b600a546001600160a01b031681565b600a5460408051634c6afee560e11b815290516000926001600160a01b0316916398d5fdca916004808301926020929190829003018186803b15801561043857600080fd5b6013546040516370a0823160e01b81526000916001600160a01b0316906370a082319061065e908590600401610d45565b60206040518083038186803b15801561067657600080fd5b505afa15801561068a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106ae9190610d2d565b92915050565b60125481565b6001546001600160a01b031681565b600354610100900460ff1681565b60045481565b60035460ff1681565b600154600160c01b900460ff1681565b600b5481565b6014546001600160a01b031681565b600f5481565b600c5481565b600154600160b81b900460ff1681565b60155481565b6009546001600160a01b031681565b6013546001600160a01b031681565b600154600160c81b900460ff1681565b60115481565b600d5481565b6000806000610774610940565b90925090506002600e5460ff16600281111561078c57fe5b141561081a5760006107c46107bc6012546107b08586610a0490919063ffffffff16565b9063ffffffff610a4516565b601254610a77565b90506107fd6107d5600d5483610a95565b600d546107f190670de0b6b3a76400009063ffffffff610ab716565b9063ffffffff610adf16565b905061081061080a6105e8565b82610a77565b9350505050610473565b60006108406108386011546107b08687610a0490919063ffffffff16565b601154610a77565b90506108516107d5600d5483610a95565b905061081061085e6105e8565b82610a95565b6000546001600160a01b0316331461088e5760405162461bcd60e51b815260040161054290610e11565b6001600160a01b0381166108b45760405162461bcd60e51b815260040161054290610dea565b600080546040516001600160a01b03808516939216917fdcf55418cee3220104fef63f979ff3c4097ad240c0c43dcb33ce837748983e6291a3600180546001600160a01b0319166001600160a01b0392909216919091179055565b6014546040516370a0823160e01b81526000916001600160a01b0316906370a082319061065e908590600401610d45565b601254601154600091829182600e5460ff16600281111561095d57fe5b141561097457600f54601054935093505050610a00565b6002600e5460ff16600281111561098757fe5b14156109b9576000610997610b04565b600f549091506109ad848363ffffffff610adf16565b94509450505050610a00565b6001600e5460ff1660028111156109cc57fe5b14156109fd5760006109dc610b6b565b90506109ee828263ffffffff610adf16565b60105494509450505050610a00565b50505b9091565b600082610a13575060006106ae565b82820282848281610a2057fe5b0414610a3e5760405162461bcd60e51b815260040161054290610e57565b9392505050565b6000808211610a665760405162461bcd60e51b815260040161054290610d9f565b818381610a6f57fe5b049392505050565b6000610a3e826107b085670de0b6b3a764000063ffffffff610a0416565b6000670de0b6b3a7640000610ab0848463ffffffff610a0416565b81610a6f57fe5b600082821115610ad95760405162461bcd60e51b815260040161054290610dc7565b50900390565b600082820183811015610a3e5760405162461bcd60e51b815260040161054290610e34565b600080610b1e600f54601154610ab790919063ffffffff16565b90506000610b2a6105e8565b90506000610b388383610a95565b90506000610b4b601254600d5484610bc9565b9050610b6260125482610ab790919063ffffffff16565b94505050505090565b600080610b85601054601254610ab790919063ffffffff16565b90506000610b916105e8565b90506000610b9f8383610a77565b90506000610bb2601154600d5484610bc9565b9050610b6260115482610ab790919063ffffffff16565b600080610bf0610bea6004610bde8787610a95565b9063ffffffff610a0416565b86610c78565b9050610c16610c11670de0b6b3a7640000610bde848263ffffffff610adf16565b610ca2565b90506000610c4b610c3583670de0b6b3a764000063ffffffff610ab716565b610c4687600263ffffffff610a0416565b610c78565b9050610c6e86610c69670de0b6b3a76400008463ffffffff610adf16565b610a95565b9695505050505050565b6000610a3e82610c9685670de0b6b3a764000063ffffffff610a0416565b9063ffffffff610cd916565b80600160028204015b81811015610cd357809150600281828581610cc257fe5b040181610ccb57fe5b049050610cab565b50919050565b600080610ce68484610a45565b905082810284038015610cfe575060010190506106ae565b5090506106ae565b600060208284031215610d17578081fd5b81356001600160a01b0381168114610a3e578182fd5b600060208284031215610d3e578081fd5b5051919050565b6001600160a01b0391909116815260200190565b901515815260200190565b6020810160038310610d7257fe5b91905290565b6020808252600d908201526c494e56414c49445f434c41494d60981b604082015260600190565b6020808252600e908201526d2224ab24a224a723afa2a92927a960911b604082015260600190565b60208082526009908201526829aaa12fa2a92927a960b91b604082015260600190565b6020808252600d908201526c24a72b20a624a22fa7aba722a960991b604082015260600190565b6020808252600990820152682727aa2fa7aba722a960b91b604082015260600190565b60208082526009908201526820a2222fa2a92927a960b91b604082015260600190565b60208082526009908201526826aaa62fa2a92927a960b91b604082015260600190565b90815260200190565b91825260208201526040019056fea264697066735822122015504639ba866f736aae2392c0b00473f18b005220704b493962a458c6d65db064736f6c63430006090033",
"immutableReferences": {},
"sourceMap": "444:6425:25:-:0;;;;;;;;;;;;;;;;;;;",
"deployedSourceMap": "444:6425:25:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2949:133:27;;;:::i;:::-;;;;;;;;;;;;;;;;2006:43;;;:::i;264:22:37:-;;;:::i;:::-;;;;;;;;1112:36:27;;;:::i;1604:31::-;;;:::i;:::-;;;;;;;;1688:42;;;:::i;3243:135::-;;;:::i;1202:27::-;;;:::i;1271:::-;;;:::i;1352:::-;;;:::i;912:32::-;;;:::i;963:225:37:-;;;:::i;:::-;;3433:87:27;;;:::i;2055:41::-;;;;;;;;;:::i;:::-;;;;;;;;772:20;;;:::i;1419:23::-;;;:::i;2682:108::-;;;:::i;2796:147::-;;;;;;;;;:::i;1771:30::-;;;:::i;292:26:37:-;;;:::i;1036:29:27:-;;;:::i;1071:35::-;;;:::i;1002:28::-;;;:::i;839:34::-;;;:::i;1511:28::-;;;:::i;1849:36::-;;;:::i;1641:41::-;;;:::i;1545:28::-;;;:::i;798:35::-;;;:::i;1957:43::-;;;:::i;1385:28::-;;;:::i;1808:35::-;;;:::i;879:27::-;;;:::i;1736:29::-;;;:::i;1579:18::-;;;:::i;5504:799:25:-;;;:::i;737:220:37:-;;;;;;;;;:::i;3088:149:27:-;;;;;;;;;:::i;4819:679:25:-;;;:::i;:::-;;;;;;;;;2949:133:27;3040:20;;3027:48;;;-1:-1:-1;;;3027:48:27;;;;3001:7;;-1:-1:-1;;;;;3040:20:27;;3027:46;;:48;;;;;;;;;;;;;;3040:20;3027:48;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3020:55;;2949:133;;:::o;2006:43::-;;;;:::o;264:22:37:-;;;-1:-1:-1;;;;;264:22:37;;:::o;1112:36:27:-;;;;:::o;1604:31::-;;;;;;:::o;1688:42::-;;;;:::o;3243:135::-;3335:21;;3322:49;;;-1:-1:-1;;;3322:49:27;;;;3296:7;;-1:-1:-1;;;;;3335:21:27;;3322:47;;:49;;;;;;;;;;;;;;3335:21;3322:49;;;;;;;;;;1202:27;;;-1:-1:-1;;;;;1202:27:27;;:::o;1271:::-;;;-1:-1:-1;;;;;1271:27:27;;:::o;1352:::-;;;-1:-1:-1;;;;;1352:27:27;;:::o;912:32::-;;;;:::o;963:225:37:-;1030:11;;-1:-1:-1;;;;;1030:11:37;1016:10;:25;1008:51;;;;-1:-1:-1;;;1008:51:37;;;;;;;;;;;;;;;;;1104:11;;;1095:7;;1074:42;;-1:-1:-1;;;;;1104:11:37;;;;1095:7;;;;1074:42;;;1136:11;;;;1126:21;;-1:-1:-1;;;;;;1126:21:37;;;-1:-1:-1;;;;;1136:11:37;;1126:21;;;;1157:24;;;963:225::o;3433:87:27:-;3501:3;3433:87;:::o;2055:41::-;;;;;;;;;;;;;;;:::o;772:20::-;;;-1:-1:-1;;;772:20:27;;;;;:::o;1419:23::-;;;-1:-1:-1;;;;;1419:23:27;;:::o;2682:108::-;2763:8;;2755:28;;;-1:-1:-1;;;2755:28:27;;;;2729:7;;-1:-1:-1;;;;;2763:8:27;;2755:26;;:28;;;;;;;;;;;;;;2763:8;2755:28;;;;;;;;;;2796:147;2901:20;;2888:48;;-1:-1:-1;;;2888:48:27;;2862:7;;-1:-1:-1;;;;;2901:20:27;;2888:44;;:48;;2933:2;;2888:48;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2881:55;2796:147;-1:-1:-1;;2796:147:27:o;1771:30::-;;;;:::o;292:26:37:-;;;-1:-1:-1;;;;;292:26:37;;:::o;1036:29:27:-;;;;;;;;;:::o;1071:35::-;;;;:::o;1002:28::-;;;;;;:::o;839:34::-;;;-1:-1:-1;;;839:34:27;;;;;:::o;1511:28::-;;;;:::o;1849:36::-;;;-1:-1:-1;;;;;1849:36:27;;:::o;1641:41::-;;;;:::o;1545:28::-;;;;:::o;798:35::-;;;-1:-1:-1;;;798:35:27;;;;;:::o;1957:43::-;;;;:::o;1385:28::-;;;-1:-1:-1;;;;;1385:28:27;;:::o;1808:35::-;;;-1:-1:-1;;;;;1808:35:27;;:::o;879:27::-;;;-1:-1:-1;;;879:27:27;;;;;:::o;1736:29::-;;;;:::o;1579:18::-;;;;:::o;5504:799:25:-;5548:16;5577:18;5597:19;5620;:17;:19::i;:::-;5576:63;;-1:-1:-1;5576:63:25;-1:-1:-1;5667:23:25;5653:10;;;;:37;;;;;;;;;5649:648;;;5706:9;5718:134;5756:49;5789:15;;5756:28;5772:11;5756;:15;;:28;;;;:::i;:::-;:32;:49;:32;:49;:::i;:::-;5823:15;;5718:20;:134::i;:::-;5706:146;;5870:53;5899:23;5915:3;;5920:1;5899:15;:23::i;:::-;5890:3;;5870:24;;379:6:36;;5870:24:25;:19;:24;:::i;:::-;:28;:53;:28;:53;:::i;:::-;5866:57;;5944:41;5965:16;:14;:16::i;:::-;5983:1;5944:20;:41::i;:::-;5937:48;;;;;;;5649:648;6016:9;6028:130;6066:46;6097:14;;6066:26;6081:10;6066;:14;;:26;;;;:::i;:46::-;6130:14;;6028:20;:130::i;:::-;6016:142;;6176:53;6205:23;6221:3;;6226:1;6205:15;:23::i;6176:53::-;6172:57;;6250:36;6266:16;:14;:16::i;:::-;6284:1;6250:15;:36::i;737:220:37:-;648:7;;-1:-1:-1;;;;;648:7:37;634:10;:21;626:43;;;;-1:-1:-1;;;626:43:37;;;;;;;;;-1:-1:-1;;;;;819:22:37;::::1;811:48;;;;-1:-1:-1::0;;;811:48:37::1;;;;;;;;;900:7;::::0;;874:44:::1;::::0;-1:-1:-1;;;;;874:44:37;;::::1;::::0;900:7;::::1;::::0;874:44:::1;::::0;::::1;928:11;:22:::0;;-1:-1:-1;;;;;;928:22:37::1;-1:-1:-1::0;;;;;928:22:37;;;::::1;::::0;;;::::1;::::0;;737:220::o;3088:149:27:-;3194:21;;3181:49;;-1:-1:-1;;;3181:49:27;;3155:7;;-1:-1:-1;;;;;3194:21:27;;3181:45;;:49;;3227:2;;3181:49;;;;4819:679:25;4932:15;;4969:14;;4869:18;;;;;4997:10;;;;:31;;;;;;;;;4993:499;;;5052:26;;5080:27;;5044:64;;;;;;;;4993:499;5143:23;5129:10;;;;:37;;;;;;;;;5125:367;;;5182:21;5206:18;:16;:18::i;:::-;5246:26;;5182:42;;-1:-1:-1;5274:20:25;:1;5182:42;5274:20;:5;:20;:::i;:::-;5238:57;;;;;;;;;5125:367;5330:23;5316:10;;;;:37;;;;;;;;;5312:180;;;5369:20;5392:18;:16;:18::i;:::-;5369:41;-1:-1:-1;5432:19:25;:1;5369:41;5432:19;:5;:19;:::i;:::-;5453:27;;5424:57;;;;;;;;;5312:180;4819:679;;;;;:::o;281:217:41:-;339:7;362:6;358:45;;-1:-1:-1;391:1:41;384:8;;358:45;425:5;;;429:1;425;:5;:1;448:5;;;;;:10;440:32;;;;-1:-1:-1;;;440:32:41;;;;;;;;;490:1;281:217;-1:-1:-1;;;281:217:41:o;504:138::-;562:7;593:1;589;:5;581:32;;;;-1:-1:-1;;;581:32:41;;;;;;;;;634:1;630;:5;;;;;;;504:138;-1:-1:-1;;;504:138:41:o;645:123:36:-;713:7;739:22;759:1;739:15;:6;379;739:15;:10;:15;:::i;392:115::-;455:7;379:6;481:13;:6;492:1;481:13;:10;:13;:::i;:::-;:19;;;;934:134:41;992:7;1024:1;1019;:6;;1011:28;;;;-1:-1:-1;;;1011:28:41;;;;;;;;;-1:-1:-1;1056:5:41;;;934:134::o;1074:157::-;1132:7;1163:5;;;1186:6;;;;1178:28;;;;-1:-1:-1;;;1178:28:41;;;;;;;;2736:578:25;2787:21;2927:17;2947:46;2966:26;;2947:14;;:18;;:46;;;;:::i;:::-;2927:66;;3003:13;3019:16;:14;:16::i;:::-;3003:32;;3045:18;3066:33;3082:9;3093:5;3066:15;:33::i;:::-;3045:54;;3109:22;3134:121;3189:15;;3218:3;;3235:10;3134:41;:121::i;:::-;3109:146;;3272:35;3291:15;;3272:14;:18;;:35;;;;:::i;:::-;3265:42;;;;;;2736:578;:::o;4180:582::-;4231:20;4370:18;4391:48;4411:27;;4391:15;;:19;;:48;;;;:::i;:::-;4370:69;;4449:13;4465:16;:14;:16::i;:::-;4449:32;;4491:18;4512:39;4533:10;4545:5;4512:20;:39::i;:::-;4491:60;;4561:21;4585:120;4640:14;;4668:3;;4685:10;4585:41;:120::i;:::-;4561:144;;4722:33;4740:14;;4722:13;:17;;:33;;;;:::i;3310:569:35:-;3448:10;3504:12;3519:62;3539:37;3574:1;3539:30;3555:1;3558:10;3539:15;:30::i;:::-;:34;:37;:34;:37;:::i;:::-;3578:2;3519:19;:62::i;:::-;3504:77;-1:-1:-1;3598:53:35;:46;379:6:36;3598:25:35;3504:77;379:6:36;3598:25:35;:8;:25;:::i;:46::-;:51;:53::i;:::-;3591:60;-1:-1:-1;3661:15:35;3679:56;3699:25;3591:60;379:6:36;3699:25:35;:8;:25;:::i;:::-;3726:8;:1;3732;3726:8;:5;:8;:::i;:::-;3679:19;:56::i;:::-;3661:74;-1:-1:-1;3823:49:35;3839:2;3843:28;379:6:36;3661:74:35;3843:28;:19;:28;:::i;:::-;3823:15;:49::i;:::-;3816:56;3310:569;-1:-1:-1;;;;;;3310:569:35:o;774:126:36:-;841:7;867:26;891:1;867:15;:6;379;867:15;:10;:15;:::i;:::-;:23;:26;:23;:26;:::i;1237:198:41:-;1318:1;1326;1322;1318:5;;:9;1352:77;1363:1;1359;:5;1352:77;;;1384:1;1380:5;;1417:1;1412;1408;1404;:5;;;;;;:9;1403:15;;;;;;1399:19;;1352:77;;;1237:198;;;;:::o;648:280::-;710:7;729:16;748:9;752:1;755;748:3;:9::i;:::-;729:28;-1:-1:-1;791:12:41;;;787:16;;817:13;;813:109;;-1:-1:-1;864:1:41;853:12;;-1:-1:-1;846:19:41;;813:109;-1:-1:-1;903:8:41;-1:-1:-1;896:15:41;;283:241:-1;;387:2;375:9;366:7;362:23;358:32;355:2;;;-1:-1;;393:12;355:2;72:20;;-1:-1;;;;;8332:54;;8786:35;;8776:2;;-1:-1;;8825:12;531:263;;646:2;634:9;625:7;621:23;617:32;614:2;;;-1:-1;;652:12;614:2;-1:-1;220:13;;608:186;-1:-1;608:186;3542:222;-1:-1;;;;;8332:54;;;;872:37;;3669:2;3654:18;;3640:124;3771:210;8105:13;;8098:21;986:34;;3892:2;3877:18;;3863:118;3988:244;4126:2;4111:18;;8698:1;8688:12;;8678:2;;8704:9;8678:2;1114:61;;;4097:135;;4239:416;4439:2;4453:47;;;1412:2;4424:18;;;7873:19;-1:-1;;;7913:14;;;1428:36;1483:12;;;4410:245;4662:416;4862:2;4876:47;;;1734:2;4847:18;;;7873:19;-1:-1;;;7913:14;;;1750:37;1806:12;;;4833:245;5085:416;5285:2;5299:47;;;2057:1;5270:18;;;7873:19;-1:-1;;;7913:14;;;2072:32;2123:12;;;5256:245;5508:416;5708:2;5722:47;;;2374:2;5693:18;;;7873:19;-1:-1;;;7913:14;;;2390:36;2445:12;;;5679:245;5931:416;6131:2;6145:47;;;2696:1;6116:18;;;7873:19;-1:-1;;;7913:14;;;2711:32;2762:12;;;6102:245;6354:416;6554:2;6568:47;;;3013:1;6539:18;;;7873:19;-1:-1;;;7913:14;;;3028:32;3079:12;;;6525:245;6777:416;6977:2;6991:47;;;3330:1;6962:18;;;7873:19;-1:-1;;;7913:14;;;3345:32;3396:12;;;6948:245;7200:222;3493:37;;;7327:2;7312:18;;7298:124;7429:333;3493:37;;;7748:2;7733:18;;3493:37;7584:2;7569:18;;7555:207",
"source": "/*\n\n Copyright 2020 DODO ZOO.\n SPDX-License-Identifier: Apache-2.0\n\n*/\n\npragma solidity 0.6.9;\npragma experimental ABIEncoderV2;\n\nimport {SafeMath} from \"../lib/SafeMath.sol\";\nimport {DecimalMath} from \"../lib/DecimalMath.sol\";\nimport {DODOMath} from \"../lib/DODOMath.sol\";\nimport {Types} from \"../lib/Types.sol\";\nimport {Storage} from \"./Storage.sol\";\n\n\n/**\n * @title Pricing\n * @author DODO Breeder\n *\n * @notice DODO Pricing model\n */\ncontract Pricing is Storage {\n using SafeMath for uint256;\n\n // ============ R = 1 cases ============\n\n function _ROneSellBaseToken(uint256 amount, uint256 targetQuoteTokenAmount)\n internal\n view\n returns (uint256 receiveQuoteToken)\n {\n uint256 i = getOraclePrice();\n uint256 Q2 = DODOMath._SolveQuadraticFunctionForTrade(\n targetQuoteTokenAmount,\n targetQuoteTokenAmount,\n DecimalMath.mul(i, amount),\n false,\n _K_\n );\n // in theory Q2 <= targetQuoteTokenAmount\n // however when amount is close to 0, precision problems may cause Q2 > targetQuoteTokenAmount\n return targetQuoteTokenAmount.sub(Q2);\n }\n\n function _ROneBuyBaseToken(uint256 amount, uint256 targetBaseTokenAmount)\n internal\n view\n returns (uint256 payQuoteToken)\n {\n require(amount < targetBaseTokenAmount, \"DODO_BASE_BALANCE_NOT_ENOUGH\");\n uint256 B2 = targetBaseTokenAmount.sub(amount);\n payQuoteToken = _RAboveIntegrate(targetBaseTokenAmount, targetBaseTokenAmount, B2);\n return payQuoteToken;\n }\n\n // ============ R < 1 cases ============\n\n function _RBelowSellBaseToken(\n uint256 amount,\n uint256 quoteBalance,\n uint256 targetQuoteAmount\n ) internal view returns (uint256 receieQuoteToken) {\n uint256 i = getOraclePrice();\n uint256 Q2 = DODOMath._SolveQuadraticFunctionForTrade(\n targetQuoteAmount,\n quoteBalance,\n DecimalMath.mul(i, amount),\n false,\n _K_\n );\n return quoteBalance.sub(Q2);\n }\n\n function _RBelowBuyBaseToken(\n uint256 amount,\n uint256 quoteBalance,\n uint256 targetQuoteAmount\n ) internal view returns (uint256 payQuoteToken) {\n // Here we don't require amount less than some value\n // Because it is limited at upper function\n // See Trader.queryBuyBaseToken\n uint256 i = getOraclePrice();\n uint256 Q2 = DODOMath._SolveQuadraticFunctionForTrade(\n targetQuoteAmount,\n quoteBalance,\n DecimalMath.mulCeil(i, amount),\n true,\n _K_\n );\n return Q2.sub(quoteBalance);\n }\n\n function _RBelowBackToOne() internal view returns (uint256 payQuoteToken) {\n // important: carefully design the system to make sure spareBase always greater than or equal to 0\n uint256 spareBase = _BASE_BALANCE_.sub(_TARGET_BASE_TOKEN_AMOUNT_);\n uint256 price = getOraclePrice();\n uint256 fairAmount = DecimalMath.mul(spareBase, price);\n uint256 newTargetQuote = DODOMath._SolveQuadraticFunctionForTarget(\n _QUOTE_BALANCE_,\n _K_,\n fairAmount\n );\n return newTargetQuote.sub(_QUOTE_BALANCE_);\n }\n\n // ============ R > 1 cases ============\n\n function _RAboveBuyBaseToken(\n uint256 amount,\n uint256 baseBalance,\n uint256 targetBaseAmount\n ) internal view returns (uint256 payQuoteToken) {\n require(amount < baseBalance, \"DODO_BASE_BALANCE_NOT_ENOUGH\");\n uint256 B2 = baseBalance.sub(amount);\n return _RAboveIntegrate(targetBaseAmount, baseBalance, B2);\n }\n\n function _RAboveSellBaseToken(\n uint256 amount,\n uint256 baseBalance,\n uint256 targetBaseAmount\n ) internal view returns (uint256 receiveQuoteToken) {\n // here we don't require B1 <= targetBaseAmount\n // Because it is limited at upper function\n // See Trader.querySellBaseToken\n uint256 B1 = baseBalance.add(amount);\n return _RAboveIntegrate(targetBaseAmount, B1, baseBalance);\n }\n\n function _RAboveBackToOne() internal view returns (uint256 payBaseToken) {\n // important: carefully design the system to make sure spareBase always greater than or equal to 0\n uint256 spareQuote = _QUOTE_BALANCE_.sub(_TARGET_QUOTE_TOKEN_AMOUNT_);\n uint256 price = getOraclePrice();\n uint256 fairAmount = DecimalMath.divFloor(spareQuote, price);\n uint256 newTargetBase = DODOMath._SolveQuadraticFunctionForTarget(\n _BASE_BALANCE_,\n _K_,\n fairAmount\n );\n return newTargetBase.sub(_BASE_BALANCE_);\n }\n\n // ============ Helper functions ============\n\n function getExpectedTarget() public view returns (uint256 baseTarget, uint256 quoteTarget) {\n uint256 Q = _QUOTE_BALANCE_;\n uint256 B = _BASE_BALANCE_;\n if (_R_STATUS_ == Types.RStatus.ONE) {\n return (_TARGET_BASE_TOKEN_AMOUNT_, _TARGET_QUOTE_TOKEN_AMOUNT_);\n } else if (_R_STATUS_ == Types.RStatus.BELOW_ONE) {\n uint256 payQuoteToken = _RBelowBackToOne();\n return (_TARGET_BASE_TOKEN_AMOUNT_, Q.add(payQuoteToken));\n } else if (_R_STATUS_ == Types.RStatus.ABOVE_ONE) {\n uint256 payBaseToken = _RAboveBackToOne();\n return (B.add(payBaseToken), _TARGET_QUOTE_TOKEN_AMOUNT_);\n }\n }\n\n function getMidPrice() public view returns (uint256 midPrice) {\n (uint256 baseTarget, uint256 quoteTarget) = getExpectedTarget();\n if (_R_STATUS_ == Types.RStatus.BELOW_ONE) {\n uint256 R = DecimalMath.divFloor(\n quoteTarget.mul(quoteTarget).div(_QUOTE_BALANCE_),\n _QUOTE_BALANCE_\n );\n R = DecimalMath.ONE.sub(_K_).add(DecimalMath.mul(_K_, R));\n return DecimalMath.divFloor(getOraclePrice(), R);\n } else {\n uint256 R = DecimalMath.divFloor(\n baseTarget.mul(baseTarget).div(_BASE_BALANCE_),\n _BASE_BALANCE_\n );\n R = DecimalMath.ONE.sub(_K_).add(DecimalMath.mul(_K_, R));\n return DecimalMath.mul(getOraclePrice(), R);\n }\n }\n\n function _RAboveIntegrate(\n uint256 B0,\n uint256 B1,\n uint256 B2\n ) internal view returns (uint256) {\n uint256 i = getOraclePrice();\n return DODOMath._GeneralIntegrate(B0, B1, B2, i, _K_);\n }\n\n // function _RBelowIntegrate(\n // uint256 Q0,\n // uint256 Q1,\n // uint256 Q2\n // ) internal view returns (uint256) {\n // uint256 i = getOraclePrice();\n // i = DecimalMath.divFloor(DecimalMath.ONE, i); // 1/i\n // return DODOMath._GeneralIntegrate(Q0, Q1, Q2, i, _K_);\n // }\n}\n",
"sourcePath": "/Users/owen/Desktop/dodo/dodo-smart-contract/contracts/impl/Pricing.sol",
"ast": {
"absolutePath": "/Users/owen/Desktop/dodo/dodo-smart-contract/contracts/impl/Pricing.sol",
"exportedSymbols": {
"Pricing": [
8853
]
},
"id": 8854,
"license": "Apache-2.0",
"nodeType": "SourceUnit",
"nodes": [
{
"id": 8371,
"literals": [
"solidity",
"0.6",
".9"
],
"nodeType": "PragmaDirective",
"src": "78:22:25"
},
{
"id": 8372,
"literals": [
"experimental",
"ABIEncoderV2"
],
"nodeType": "PragmaDirective",
"src": "101:33:25"
},
{
"absolutePath": "/Users/owen/Desktop/dodo/dodo-smart-contract/contracts/lib/SafeMath.sol",
"file": "../lib/SafeMath.sol",
"id": 8374,
"nodeType": "ImportDirective",
"scope": 8854,
"sourceUnit": 11624,
"src": "136:45:25",
"symbolAliases": [
{
"foreign": {
"argumentTypes": null,
"id": 8373,
"name": "SafeMath",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": null,
"src": "144:8:25",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
},
"local": null
}
],
"unitAlias": ""
},
{
"absolutePath": "/Users/owen/Desktop/dodo/dodo-smart-contract/contracts/lib/DecimalMath.sol",
"file": "../lib/DecimalMath.sol",
"id": 8376,
"nodeType": "ImportDirective",
"scope": 8854,
"sourceUnit": 11079,
"src": "182:51:25",
"symbolAliases": [
{
"foreign": {
"argumentTypes": null,
"id": 8375,
"name": "DecimalMath",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": null,
"src": "190:11:25",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
},
"local": null
}
],
"unitAlias": ""
},
{
"absolutePath": "/Users/owen/Desktop/dodo/dodo-smart-contract/contracts/lib/DODOMath.sol",
"file": "../lib/DODOMath.sol",
"id": 8378,
"nodeType": "ImportDirective",
"scope": 8854,
"sourceUnit": 10993,
"src": "234:45:25",
"symbolAliases": [
{
"foreign": {
"argumentTypes": null,
"id": 8377,
"name": "DODOMath",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": null,
"src": "242:8:25",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
},
"local": null
}
],
"unitAlias": ""
},
{
"absolutePath": "/Users/owen/Desktop/dodo/dodo-smart-contract/contracts/lib/Types.sol",
"file": "../lib/Types.sol",
"id": 8380,
"nodeType": "ImportDirective",
"scope": 8854,
"sourceUnit": 11632,
"src": "280:39:25",
"symbolAliases": [
{
"foreign": {
"argumentTypes": null,
"id": 8379,
"name": "Types",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": null,
"src": "288:5:25",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
},
"local": null
}
],
"unitAlias": ""
},
{
"absolutePath": "/Users/owen/Desktop/dodo/dodo-smart-contract/contracts/impl/Storage.sol",
"file": "./Storage.sol",
"id": 8382,
"nodeType": "ImportDirective",
"scope": 8854,
"sourceUnit": 9614,
"src": "320:38:25",
"symbolAliases": [
{
"foreign": {
"argumentTypes": null,
"id": 8381,
"name": "Storage",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": null,
"src": "328:7:25",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
},
"local": null
}
],
"unitAlias": ""
},
{
"abstract": false,
"baseContracts": [
{
"arguments": null,
"baseName": {
"contractScope": null,
"id": 8384,
"name": "Storage",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 9613,
"src": "464:7:25",
"typeDescriptions": {
"typeIdentifier": "t_contract$_Storage_$9613",
"typeString": "contract Storage"
}
},
"id": 8385,
"nodeType": "InheritanceSpecifier",
"src": "464:7:25"
}
],
"contractDependencies": [
9613,
11166,
11296
],
"contractKind": "contract",
"documentation": {
"id": 8383,
"nodeType": "StructuredDocumentation",
"src": "361:82:25",
"text": " @title Pricing\n @author DODO Breeder\n @notice DODO Pricing model"
},
"fullyImplemented": true,
"id": 8853,
"linearizedBaseContracts": [
8853,
9613,
11296,
11166
],
"name": "Pricing",
"nodeType": "ContractDefinition",
"nodes": [
{
"id": 8388,
"libraryName": {
"contractScope": null,
"id": 8386,
"name": "SafeMath",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 11623,
"src": "484:8:25",
"typeDescriptions": {
"typeIdentifier": "t_contract$_SafeMath_$11623",
"typeString": "library SafeMath"
}
},
"nodeType": "UsingForDirective",
"src": "478:27:25",
"typeName": {
"id": 8387,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "497:7:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
},
{
"body": {
"id": 8422,
"nodeType": "Block",
"src": "711:466:25",
"statements": [
{
"assignments": [
8398
],
"declarations": [
{
"constant": false,
"id": 8398,
"mutability": "mutable",
"name": "i",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 8422,
"src": "721:9:25",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 8397,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "721:7:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 8401,
"initialValue": {
"argumentTypes": null,
"arguments": [],
"expression": {
"argumentTypes": [],
"id": 8399,
"name": "getOraclePrice",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9550,
"src": "733:14:25",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$",
"typeString": "function () view returns (uint256)"
}
},
"id": 8400,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "733:16:25",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "721:28:25"
},
{
"assignments": [
8403
],
"declarations": [
{
"constant": false,
"id": 8403,
"mutability": "mutable",
"name": "Q2",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 8422,
"src": "759:10:25",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 8402,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "759:7:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 8416,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 8406,
"name": "targetQuoteTokenAmount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8392,
"src": "826:22:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 8407,
"name": "targetQuoteTokenAmount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8392,
"src": "862:22:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 8410,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8398,
"src": "914:1:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 8411,
"name": "amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8390,
"src": "917:6:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"id": 8408,
"name": "DecimalMath",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 11078,
"src": "898:11:25",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_DecimalMath_$11078_$",
"typeString": "type(library DecimalMath)"
}
},
"id": 8409,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "mul",
"nodeType": "MemberAccess",
"referencedDeclaration": 11023,
"src": "898:15:25",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$",
"typeString": "function (uint256,uint256) pure returns (uint256)"
}
},
"id": 8412,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "898:26:25",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"hexValue": "66616c7365",
"id": 8413,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "bool",
"lValueRequested": false,
"nodeType": "Literal",
"src": "938:5:25",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"value": "false"
},
{
"argumentTypes": null,
"id": 8414,
"name": "_K_",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9457,
"src": "957:3:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"id": 8404,
"name": "DODOMath",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 10992,
"src": "772:8:25",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_DODOMath_$10992_$",
"typeString": "type(library DODOMath)"
}
},
"id": 8405,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "_SolveQuadraticFunctionForTrade",
"nodeType": "MemberAccess",
"referencedDeclaration": 10925,
"src": "772:40:25",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$_t_uint256_$_t_bool_$_t_uint256_$returns$_t_uint256_$",
"typeString": "function (uint256,uint256,uint256,bool,uint256) pure returns (uint256)"
}
},
"id": 8415,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "772:198:25",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "759:211:25"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 8419,
"name": "Q2",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8403,
"src": "1167:2:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"id": 8417,
"name": "targetQuoteTokenAmount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8392,
"src": "1140:22:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 8418,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sub",
"nodeType": "MemberAccess",
"referencedDeclaration": 11557,
"src": "1140:26:25",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
"typeString": "function (uint256,uint256) pure returns (uint256)"
}
},
"id": 8420,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1140:30:25",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"functionReturnParameters": 8396,
"id": 8421,
"nodeType": "Return",
"src": "1133:37:25"
}
]
},
"documentation": null,
"id": 8423,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "_ROneSellBaseToken",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 8393,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 8390,
"mutability": "mutable",
"name": "amount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 8423,
"src": "585:14:25",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 8389,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "585:7:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 8392,
"mutability": "mutable",
"name": "targetQuoteTokenAmount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 8423,
"src": "601:30:25",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 8391,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "601:7:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "584:48:25"
},
"returnParameters": {
"id": 8396,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 8395,
"mutability": "mutable",
"name": "receiveQuoteToken",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 8423,
"src": "680:25:25",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 8394,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "680:7:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "679:27:25"
},
"scope": 8853,
"src": "557:620:25",
"stateMutability": "view",
"virtual": false,
"visibility": "internal"
},
{
"body": {
"id": 8456,
"nodeType": "Block",
"src": "1331:266:25",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 8435,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 8433,
"name": "amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8425,
"src": "1349:6:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "<",
"rightExpression": {
"argumentTypes": null,
"id": 8434,
"name": "targetBaseTokenAmount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8427,
"src": "1358:21:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "1349:30:25",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"argumentTypes": null,
"hexValue": "444f444f5f424153455f42414c414e43455f4e4f545f454e4f554748",
"id": 8436,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1381:30:25",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_997068fbd59291c0e94aa73a95de3c076c00f04014e63bef27a7316bb88c0e69",
"typeString": "literal_string \"DODO_BASE_BALANCE_NOT_ENOUGH\""
},
"value": "DODO_BASE_BALANCE_NOT_ENOUGH"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_stringliteral_997068fbd59291c0e94aa73a95de3c076c00f04014e63bef27a7316bb88c0e69",
"typeString": "literal_string \"DODO_BASE_BALANCE_NOT_ENOUGH\""
}
],
"id": 8432,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
-18,
-18
],
"referencedDeclaration": -18,
"src": "1341:7:25",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 8437,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1341:71:25",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 8438,
"nodeType": "ExpressionStatement",
"src": "1341:71:25"
},
{
"assignments": [
8440
],
"declarations": [
{
"constant": false,
"id": 8440,
"mutability": "mutable",
"name": "B2",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 8456,
"src": "1422:10:25",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 8439,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "1422:7:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 8445,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 8443,
"name": "amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8425,
"src": "1461:6:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"id": 8441,
"name": "targetBaseTokenAmount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8427,
"src": "1435:21:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 8442,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sub",
"nodeType": "MemberAccess",
"referencedDeclaration": 11557,
"src": "1435:25:25",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
"typeString": "function (uint256,uint256) pure returns (uint256)"
}
},
"id": 8444,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1435:33:25",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "1422:46:25"
},
{
"expression": {
"argumentTypes": null,
"id": 8452,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 8446,
"name": "payQuoteToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8430,
"src": "1478:13:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 8448,
"name": "targetBaseTokenAmount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8427,
"src": "1511:21:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 8449,
"name": "targetBaseTokenAmount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8427,
"src": "1534:21:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 8450,
"name": "B2",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8440,
"src": "1557:2:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 8447,
"name": "_RAboveIntegrate",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8852,
"src": "1494:16:25",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$_t_uint256_$_t_uint256_$_t_uint256_$returns$_t_uint256_$",
"typeString": "function (uint256,uint256,uint256) view returns (uint256)"
}
},
"id": 8451,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1494:66:25",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "1478:82:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 8453,
"nodeType": "ExpressionStatement",
"src": "1478:82:25"
},
{
"expression": {
"argumentTypes": null,
"id": 8454,
"name": "payQuoteToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8430,
"src": "1577:13:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"functionReturnParameters": 8431,
"id": 8455,
"nodeType": "Return",
"src": "1570:20:25"
}
]
},
"documentation": null,
"id": 8457,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "_ROneBuyBaseToken",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 8428,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 8425,
"mutability": "mutable",
"name": "amount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 8457,
"src": "1210:14:25",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 8424,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "1210:7:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 8427,
"mutability": "mutable",
"name": "targetBaseTokenAmount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 8457,
"src": "1226:29:25",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 8426,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "1226:7:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "1209:47:25"
},
"returnParameters": {
"id": 8431,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 8430,
"mutability": "mutable",
"name": "payQuoteToken",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 8457,
"src": "1304:21:25",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 8429,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "1304:7:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "1303:23:25"
},
"scope": 8853,
"src": "1183:414:25",
"stateMutability": "view",
"virtual": false,
"visibility": "internal"
},
{
"body": {
"id": 8493,
"nodeType": "Block",
"src": "1823:288:25",
"statements": [
{
"assignments": [
8469
],
"declarations": [
{
"constant": false,
"id": 8469,
"mutability": "mutable",
"name": "i",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 8493,
"src": "1833:9:25",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 8468,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "1833:7:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 8472,
"initialValue": {
"argumentTypes": null,
"arguments": [],
"expression": {
"argumentTypes": [],
"id": 8470,
"name": "getOraclePrice",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9550,
"src": "1845:14:25",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$",
"typeString": "function () view returns (uint256)"
}
},
"id": 8471,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1845:16:25",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "1833:28:25"
},
{
"assignments": [
8474
],
"declarations": [
{
"constant": false,
"id": 8474,
"mutability": "mutable",
"name": "Q2",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 8493,
"src": "1871:10:25",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 8473,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "1871:7:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 8487,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 8477,
"name": "targetQuoteAmount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8463,
"src": "1938:17:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 8478,
"name": "quoteBalance",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8461,
"src": "1969:12:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 8481,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8469,
"src": "2011:1:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 8482,
"name": "amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8459,
"src": "2014:6:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"id": 8479,
"name": "DecimalMath",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 11078,
"src": "1995:11:25",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_DecimalMath_$11078_$",
"typeString": "type(library DecimalMath)"
}
},
"id": 8480,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "mul",
"nodeType": "MemberAccess",
"referencedDeclaration": 11023,
"src": "1995:15:25",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$",
"typeString": "function (uint256,uint256) pure returns (uint256)"
}
},
"id": 8483,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1995:26:25",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"hexValue": "66616c7365",
"id": 8484,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "bool",
"lValueRequested": false,
"nodeType": "Literal",
"src": "2035:5:25",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"value": "false"
},
{
"argumentTypes": null,
"id": 8485,
"name": "_K_",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9457,
"src": "2054:3:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"id": 8475,
"name": "DODOMath",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 10992,
"src": "1884:8:25",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_DODOMath_$10992_$",
"typeString": "type(library DODOMath)"
}
},
"id": 8476,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "_SolveQuadraticFunctionForTrade",
"nodeType": "MemberAccess",
"referencedDeclaration": 10925,
"src": "1884:40:25",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$_t_uint256_$_t_bool_$_t_uint256_$returns$_t_uint256_$",
"typeString": "function (uint256,uint256,uint256,bool,uint256) pure returns (uint256)"
}
},
"id": 8486,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1884:183:25",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "1871:196:25"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 8490,
"name": "Q2",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8474,
"src": "2101:2:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"id": 8488,
"name": "quoteBalance",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8461,
"src": "2084:12:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 8489,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sub",
"nodeType": "MemberAccess",
"referencedDeclaration": 11557,
"src": "2084:16:25",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
"typeString": "function (uint256,uint256) pure returns (uint256)"
}
},
"id": 8491,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "2084:20:25",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"functionReturnParameters": 8467,
"id": 8492,
"nodeType": "Return",
"src": "2077:27:25"
}
]
},
"documentation": null,
"id": 8494,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "_RBelowSellBaseToken",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 8464,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 8459,
"mutability": "mutable",
"name": "amount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 8494,
"src": "1688:14:25",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 8458,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "1688:7:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 8461,
"mutability": "mutable",
"name": "quoteBalance",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 8494,
"src": "1712:20:25",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 8460,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "1712:7:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 8463,
"mutability": "mutable",
"name": "targetQuoteAmount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 8494,
"src": "1742:25:25",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 8462,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "1742:7:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "1678:95:25"
},
"returnParameters": {
"id": 8467,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 8466,
"mutability": "mutable",
"name": "receieQuoteToken",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 8494,
"src": "1797:24:25",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 8465,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "1797:7:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "1796:26:25"
},
"scope": 8853,
"src": "1649:462:25",
"stateMutability": "view",
"virtual": false,
"visibility": "internal"
},
{
"body": {
"id": 8530,
"nodeType": "Block",
"src": "2287:443:25",
"statements": [
{
"assignments": [
8506
],
"declarations": [
{
"constant": false,
"id": 8506,
"mutability": "mutable",
"name": "i",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 8530,
"src": "2449:9:25",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 8505,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "2449:7:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 8509,
"initialValue": {
"argumentTypes": null,
"arguments": [],
"expression": {
"argumentTypes": [],
"id": 8507,
"name": "getOraclePrice",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9550,
"src": "2461:14:25",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$",
"typeString": "function () view returns (uint256)"
}
},
"id": 8508,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "2461:16:25",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "2449:28:25"
},
{
"assignments": [
8511
],
"declarations": [
{
"constant": false,
"id": 8511,
"mutability": "mutable",
"name": "Q2",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 8530,
"src": "2487:10:25",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 8510,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "2487:7:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 8524,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 8514,
"name": "targetQuoteAmount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8500,
"src": "2554:17:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 8515,
"name": "quoteBalance",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8498,
"src": "2585:12:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 8518,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8506,
"src": "2631:1:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 8519,
"name": "amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8496,
"src": "2634:6:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"id": 8516,
"name": "DecimalMath",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 11078,
"src": "2611:11:25",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_DecimalMath_$11078_$",
"typeString": "type(library DecimalMath)"
}
},
"id": 8517,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "mulCeil",
"nodeType": "MemberAccess",
"referencedDeclaration": 11041,
"src": "2611:19:25",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$",
"typeString": "function (uint256,uint256) pure returns (uint256)"
}
},
"id": 8520,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "2611:30:25",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"hexValue": "74727565",
"id": 8521,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "bool",
"lValueRequested": false,
"nodeType": "Literal",
"src": "2655:4:25",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"value": "true"
},
{
"argumentTypes": null,
"id": 8522,
"name": "_K_",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9457,
"src": "2673:3:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"id": 8512,
"name": "DODOMath",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 10992,
"src": "2500:8:25",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_DODOMath_$10992_$",
"typeString": "type(library DODOMath)"
}
},
"id": 8513,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "_SolveQuadraticFunctionForTrade",
"nodeType": "MemberAccess",
"referencedDeclaration": 10925,
"src": "2500:40:25",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$_t_uint256_$_t_bool_$_t_uint256_$returns$_t_uint256_$",
"typeString": "function (uint256,uint256,uint256,bool,uint256) pure returns (uint256)"
}
},
"id": 8523,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "2500:186:25",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "2487:199:25"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 8527,
"name": "quoteBalance",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8498,
"src": "2710:12:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"id": 8525,
"name": "Q2",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8511,
"src": "2703:2:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 8526,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sub",
"nodeType": "MemberAccess",
"referencedDeclaration": 11557,
"src": "2703:6:25",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
"typeString": "function (uint256,uint256) pure returns (uint256)"
}
},
"id": 8528,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "2703:20:25",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"functionReturnParameters": 8504,
"id": 8529,
"nodeType": "Return",
"src": "2696:27:25"
}
]
},
"documentation": null,
"id": 8531,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "_RBelowBuyBaseToken",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 8501,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 8496,
"mutability": "mutable",
"name": "amount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 8531,
"src": "2155:14:25",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 8495,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "2155:7:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 8498,
"mutability": "mutable",
"name": "quoteBalance",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 8531,
"src": "2179:20:25",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 8497,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "2179:7:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 8500,
"mutability": "mutable",
"name": "targetQuoteAmount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 8531,
"src": "2209:25:25",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 8499,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "2209:7:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "2145:95:25"
},
"returnParameters": {
"id": 8504,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 8503,
"mutability": "mutable",
"name": "payQuoteToken",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 8531,
"src": "2264:21:25",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 8502,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "2264:7:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "2263:23:25"
},
"scope": 8853,
"src": "2117:613:25",
"stateMutability": "view",
"virtual": false,
"visibility": "internal"
},
{
"body": {
"id": 8570,
"nodeType": "Block",
"src": "2810:504:25",
"statements": [
{
"assignments": [
8537
],
"declarations": [
{
"constant": false,
"id": 8537,
"mutability": "mutable",
"name": "spareBase",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 8570,
"src": "2927:17:25",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 8536,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "2927:7:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 8542,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 8540,
"name": "_TARGET_BASE_TOKEN_AMOUNT_",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9461,
"src": "2966:26:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"id": 8538,
"name": "_BASE_BALANCE_",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9465,
"src": "2947:14:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 8539,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sub",
"nodeType": "MemberAccess",
"referencedDeclaration": 11557,
"src": "2947:18:25",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
"typeString": "function (uint256,uint256) pure returns (uint256)"
}
},
"id": 8541,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "2947:46:25",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "2927:66:25"
},
{
"assignments": [
8544
],
"declarations": [
{
"constant": false,
"id": 8544,
"mutability": "mutable",
"name": "price",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 8570,
"src": "3003:13:25",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 8543,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "3003:7:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 8547,
"initialValue": {
"argumentTypes": null,
"arguments": [],
"expression": {
"argumentTypes": [],
"id": 8545,
"name": "getOraclePrice",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9550,
"src": "3019:14:25",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$",
"typeString": "function () view returns (uint256)"
}
},
"id": 8546,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "3019:16:25",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "3003:32:25"
},
{
"assignments": [
8549
],
"declarations": [
{
"constant": false,
"id": 8549,
"mutability": "mutable",
"name": "fairAmount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 8570,
"src": "3045:18:25",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 8548,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "3045:7:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 8555,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 8552,
"name": "spareBase",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8537,
"src": "3082:9:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 8553,
"name": "price",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8544,
"src": "3093:5:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"id": 8550,
"name": "DecimalMath",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 11078,
"src": "3066:11:25",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_DecimalMath_$11078_$",
"typeString": "type(library DecimalMath)"
}
},
"id": 8551,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "mul",
"nodeType": "MemberAccess",
"referencedDeclaration": 11023,
"src": "3066:15:25",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$",
"typeString": "function (uint256,uint256) pure returns (uint256)"
}
},
"id": 8554,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "3066:33:25",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "3045:54:25"
},
{
"assignments": [
8557
],
"declarations": [
{
"constant": false,
"id": 8557,
"mutability": "mutable",
"name": "newTargetQuote",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 8570,
"src": "3109:22:25",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 8556,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "3109:7:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 8564,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 8560,
"name": "_QUOTE_BALANCE_",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9467,
"src": "3189:15:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 8561,
"name": "_K_",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9457,
"src": "3218:3:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 8562,
"name": "fairAmount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8549,
"src": "3235:10:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"id": 8558,
"name": "DODOMath",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 10992,
"src": "3134:8:25",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_DODOMath_$10992_$",
"typeString": "type(library DODOMath)"
}
},
"id": 8559,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "_SolveQuadraticFunctionForTarget",
"nodeType": "MemberAccess",
"referencedDeclaration": 10991,
"src": "3134:41:25",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$_t_uint256_$returns$_t_uint256_$",
"typeString": "function (uint256,uint256,uint256) pure returns (uint256)"
}
},
"id": 8563,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "3134:121:25",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "3109:146:25"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 8567,
"name": "_QUOTE_BALANCE_",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9467,
"src": "3291:15:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"id": 8565,
"name": "newTargetQuote",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8557,
"src": "3272:14:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 8566,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sub",
"nodeType": "MemberAccess",
"referencedDeclaration": 11557,
"src": "3272:18:25",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
"typeString": "function (uint256,uint256) pure returns (uint256)"
}
},
"id": 8568,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "3272:35:25",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"functionReturnParameters": 8535,
"id": 8569,
"nodeType": "Return",
"src": "3265:42:25"
}
]
},
"documentation": null,
"id": 8571,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "_RBelowBackToOne",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 8532,
"nodeType": "ParameterList",
"parameters": [],
"src": "2761:2:25"
},
"returnParameters": {
"id": 8535,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 8534,
"mutability": "mutable",
"name": "payQuoteToken",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 8571,
"src": "2787:21:25",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 8533,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "2787:7:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "2786:23:25"
},
"scope": 8853,
"src": "2736:578:25",
"stateMutability": "view",
"virtual": false,
"visibility": "internal"
},
{
"body": {
"id": 8602,
"nodeType": "Block",
"src": "3534:192:25",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 8585,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 8583,
"name": "amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8573,
"src": "3552:6:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "<",
"rightExpression": {
"argumentTypes": null,
"id": 8584,
"name": "baseBalance",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8575,
"src": "3561:11:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "3552:20:25",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"argumentTypes": null,
"hexValue": "444f444f5f424153455f42414c414e43455f4e4f545f454e4f554748",
"id": 8586,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "3574:30:25",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_997068fbd59291c0e94aa73a95de3c076c00f04014e63bef27a7316bb88c0e69",
"typeString": "literal_string \"DODO_BASE_BALANCE_NOT_ENOUGH\""
},
"value": "DODO_BASE_BALANCE_NOT_ENOUGH"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_stringliteral_997068fbd59291c0e94aa73a95de3c076c00f04014e63bef27a7316bb88c0e69",
"typeString": "literal_string \"DODO_BASE_BALANCE_NOT_ENOUGH\""
}
],
"id": 8582,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
-18,
-18
],
"referencedDeclaration": -18,
"src": "3544:7:25",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 8587,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "3544:61:25",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 8588,
"nodeType": "ExpressionStatement",
"src": "3544:61:25"
},
{
"assignments": [
8590
],
"declarations": [
{
"constant": false,
"id": 8590,
"mutability": "mutable",
"name": "B2",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 8602,
"src": "3615:10:25",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 8589,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "3615:7:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 8595,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 8593,
"name": "amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8573,
"src": "3644:6:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"id": 8591,
"name": "baseBalance",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8575,
"src": "3628:11:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 8592,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sub",
"nodeType": "MemberAccess",
"referencedDeclaration": 11557,
"src": "3628:15:25",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
"typeString": "function (uint256,uint256) pure returns (uint256)"
}
},
"id": 8594,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "3628:23:25",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "3615:36:25"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 8597,
"name": "targetBaseAmount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8577,
"src": "3685:16:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 8598,
"name": "baseBalance",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8575,
"src": "3703:11:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 8599,
"name": "B2",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8590,
"src": "3716:2:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 8596,
"name": "_RAboveIntegrate",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8852,
"src": "3668:16:25",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$_t_uint256_$_t_uint256_$_t_uint256_$returns$_t_uint256_$",
"typeString": "function (uint256,uint256,uint256) view returns (uint256)"
}
},
"id": 8600,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "3668:51:25",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"functionReturnParameters": 8581,
"id": 8601,
"nodeType": "Return",
"src": "3661:58:25"
}
]
},
"documentation": null,
"id": 8603,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "_RAboveBuyBaseToken",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 8578,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 8573,
"mutability": "mutable",
"name": "amount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 8603,
"src": "3404:14:25",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 8572,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "3404:7:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 8575,
"mutability": "mutable",
"name": "baseBalance",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 8603,
"src": "3428:19:25",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 8574,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "3428:7:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 8577,
"mutability": "mutable",
"name": "targetBaseAmount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 8603,
"src": "3457:24:25",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 8576,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "3457:7:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "3394:93:25"
},
"returnParameters": {
"id": 8581,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 8580,
"mutability": "mutable",
"name": "payQuoteToken",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 8603,
"src": "3511:21:25",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 8579,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "3511:7:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "3510:23:25"
},
"scope": 8853,
"src": "3366:360:25",
"stateMutability": "view",
"virtual": false,
"visibility": "internal"
},
{
"body": {
"id": 8627,
"nodeType": "Block",
"src": "3905:269:25",
"statements": [
{
"assignments": [
8615
],
"declarations": [
{
"constant": false,
"id": 8615,
"mutability": "mutable",
"name": "B1",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 8627,
"src": "4063:10:25",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 8614,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "4063:7:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 8620,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 8618,
"name": "amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8605,
"src": "4092:6:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"id": 8616,
"name": "baseBalance",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8607,
"src": "4076:11:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 8617,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "add",
"nodeType": "MemberAccess",
"referencedDeclaration": 11582,
"src": "4076:15:25",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
"typeString": "function (uint256,uint256) pure returns (uint256)"
}
},
"id": 8619,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "4076:23:25",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "4063:36:25"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 8622,
"name": "targetBaseAmount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8609,
"src": "4133:16:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 8623,
"name": "B1",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8615,
"src": "4151:2:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 8624,
"name": "baseBalance",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8607,
"src": "4155:11:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 8621,
"name": "_RAboveIntegrate",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8852,
"src": "4116:16:25",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$_t_uint256_$_t_uint256_$_t_uint256_$returns$_t_uint256_$",
"typeString": "function (uint256,uint256,uint256) view returns (uint256)"
}
},
"id": 8625,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "4116:51:25",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"functionReturnParameters": 8613,
"id": 8626,
"nodeType": "Return",
"src": "4109:58:25"
}
]
},
"documentation": null,
"id": 8628,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "_RAboveSellBaseToken",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 8610,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 8605,
"mutability": "mutable",
"name": "amount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 8628,
"src": "3771:14:25",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 8604,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "3771:7:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 8607,
"mutability": "mutable",
"name": "baseBalance",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 8628,
"src": "3795:19:25",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 8606,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "3795:7:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 8609,
"mutability": "mutable",
"name": "targetBaseAmount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 8628,
"src": "3824:24:25",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 8608,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "3824:7:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "3761:93:25"
},
"returnParameters": {
"id": 8613,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 8612,
"mutability": "mutable",
"name": "receiveQuoteToken",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 8628,
"src": "3878:25:25",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 8611,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "3878:7:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "3877:27:25"
},
"scope": 8853,
"src": "3732:442:25",
"stateMutability": "view",
"virtual": false,
"visibility": "internal"
},
{
"body": {
"id": 8667,
"nodeType": "Block",
"src": "4253:509:25",
"statements": [
{
"assignments": [
8634
],
"declarations": [
{
"constant": false,
"id": 8634,
"mutability": "mutable",
"name": "spareQuote",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 8667,
"src": "4370:18:25",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 8633,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "4370:7:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 8639,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 8637,
"name": "_TARGET_QUOTE_TOKEN_AMOUNT_",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9463,
"src": "4411:27:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"id": 8635,
"name": "_QUOTE_BALANCE_",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9467,
"src": "4391:15:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 8636,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sub",
"nodeType": "MemberAccess",
"referencedDeclaration": 11557,
"src": "4391:19:25",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
"typeString": "function (uint256,uint256) pure returns (uint256)"
}
},
"id": 8638,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "4391:48:25",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "4370:69:25"
},
{
"assignments": [
8641
],
"declarations": [
{
"constant": false,
"id": 8641,
"mutability": "mutable",
"name": "price",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 8667,
"src": "4449:13:25",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 8640,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "4449:7:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 8644,
"initialValue": {
"argumentTypes": null,
"arguments": [],
"expression": {
"argumentTypes": [],
"id": 8642,
"name": "getOraclePrice",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9550,
"src": "4465:14:25",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$",
"typeString": "function () view returns (uint256)"
}
},
"id": 8643,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "4465:16:25",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "4449:32:25"
},
{
"assignments": [
8646
],
"declarations": [
{
"constant": false,
"id": 8646,
"mutability": "mutable",
"name": "fairAmount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 8667,
"src": "4491:18:25",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 8645,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "4491:7:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 8652,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 8649,
"name": "spareQuote",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8634,
"src": "4533:10:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 8650,
"name": "price",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8641,
"src": "4545:5:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"id": 8647,
"name": "DecimalMath",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 11078,
"src": "4512:11:25",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_DecimalMath_$11078_$",
"typeString": "type(library DecimalMath)"
}
},
"id": 8648,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "divFloor",
"nodeType": "MemberAccess",
"referencedDeclaration": 11059,
"src": "4512:20:25",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$",
"typeString": "function (uint256,uint256) pure returns (uint256)"
}
},
"id": 8651,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "4512:39:25",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "4491:60:25"
},
{
"assignments": [
8654
],
"declarations": [
{
"constant": false,
"id": 8654,
"mutability": "mutable",
"name": "newTargetBase",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 8667,
"src": "4561:21:25",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 8653,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "4561:7:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 8661,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 8657,
"name": "_BASE_BALANCE_",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9465,
"src": "4640:14:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 8658,
"name": "_K_",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9457,
"src": "4668:3:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 8659,
"name": "fairAmount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8646,
"src": "4685:10:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"id": 8655,
"name": "DODOMath",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 10992,
"src": "4585:8:25",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_DODOMath_$10992_$",
"typeString": "type(library DODOMath)"
}
},
"id": 8656,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "_SolveQuadraticFunctionForTarget",
"nodeType": "MemberAccess",
"referencedDeclaration": 10991,
"src": "4585:41:25",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$_t_uint256_$returns$_t_uint256_$",
"typeString": "function (uint256,uint256,uint256) pure returns (uint256)"
}
},
"id": 8660,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "4585:120:25",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "4561:144:25"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 8664,
"name": "_BASE_BALANCE_",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9465,
"src": "4740:14:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"id": 8662,
"name": "newTargetBase",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8654,
"src": "4722:13:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 8663,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sub",
"nodeType": "MemberAccess",
"referencedDeclaration": 11557,
"src": "4722:17:25",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
"typeString": "function (uint256,uint256) pure returns (uint256)"
}
},
"id": 8665,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "4722:33:25",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"functionReturnParameters": 8632,
"id": 8666,
"nodeType": "Return",
"src": "4715:40:25"
}
]
},
"documentation": null,
"id": 8668,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "_RAboveBackToOne",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 8629,
"nodeType": "ParameterList",
"parameters": [],
"src": "4205:2:25"
},
"returnParameters": {
"id": 8632,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 8631,
"mutability": "mutable",
"name": "payBaseToken",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 8668,
"src": "4231:20:25",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 8630,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "4231:7:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "4230:22:25"
},
"scope": 8853,
"src": "4180:582:25",
"stateMutability": "view",
"virtual": false,
"visibility": "internal"
},
{
"body": {
"id": 8732,
"nodeType": "Block",
"src": "4910:588:25",
"statements": [
{
"assignments": [
8676
],
"declarations": [
{
"constant": false,
"id": 8676,
"mutability": "mutable",
"name": "Q",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 8732,
"src": "4920:9:25",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 8675,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "4920:7:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 8678,
"initialValue": {
"argumentTypes": null,
"id": 8677,
"name": "_QUOTE_BALANCE_",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9467,
"src": "4932:15:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "4920:27:25"
},
{
"assignments": [
8680
],
"declarations": [
{
"constant": false,
"id": 8680,
"mutability": "mutable",
"name": "B",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 8732,
"src": "4957:9:25",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 8679,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "4957:7:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 8682,
"initialValue": {
"argumentTypes": null,
"id": 8681,
"name": "_BASE_BALANCE_",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9465,
"src": "4969:14:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "4957:26:25"
},
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_enum$_RStatus_$11630",
"typeString": "enum Types.RStatus"
},
"id": 8687,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 8683,
"name": "_R_STATUS_",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9459,
"src": "4997:10:25",
"typeDescriptions": {
"typeIdentifier": "t_enum$_RStatus_$11630",
"typeString": "enum Types.RStatus"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 8684,
"name": "Types",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 11631,
"src": "5011:5:25",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_Types_$11631_$",
"typeString": "type(library Types)"
}
},
"id": 8685,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "RStatus",
"nodeType": "MemberAccess",
"referencedDeclaration": 11630,
"src": "5011:13:25",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_enum$_RStatus_$11630_$",
"typeString": "type(enum Types.RStatus)"
}
},
"id": 8686,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"memberName": "ONE",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "5011:17:25",
"typeDescriptions": {
"typeIdentifier": "t_enum$_RStatus_$11630",
"typeString": "enum Types.RStatus"
}
},
"src": "4997:31:25",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": {
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_enum$_RStatus_$11630",
"typeString": "enum Types.RStatus"
},
"id": 8697,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 8693,
"name": "_R_STATUS_",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9459,
"src": "5129:10:25",
"typeDescriptions": {
"typeIdentifier": "t_enum$_RStatus_$11630",
"typeString": "enum Types.RStatus"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 8694,
"name": "Types",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 11631,
"src": "5143:5:25",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_Types_$11631_$",
"typeString": "type(library Types)"
}
},
"id": 8695,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "RStatus",
"nodeType": "MemberAccess",
"referencedDeclaration": 11630,
"src": "5143:13:25",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_enum$_RStatus_$11630_$",
"typeString": "type(enum Types.RStatus)"
}
},
"id": 8696,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"memberName": "BELOW_ONE",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "5143:23:25",
"typeDescriptions": {
"typeIdentifier": "t_enum$_RStatus_$11630",
"typeString": "enum Types.RStatus"
}
},
"src": "5129:37:25",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": {
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_enum$_RStatus_$11630",
"typeString": "enum Types.RStatus"
},
"id": 8715,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 8711,
"name": "_R_STATUS_",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9459,
"src": "5316:10:25",
"typeDescriptions": {
"typeIdentifier": "t_enum$_RStatus_$11630",
"typeString": "enum Types.RStatus"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 8712,
"name": "Types",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 11631,
"src": "5330:5:25",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_Types_$11631_$",
"typeString": "type(library Types)"
}
},
"id": 8713,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "RStatus",
"nodeType": "MemberAccess",
"referencedDeclaration": 11630,
"src": "5330:13:25",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_enum$_RStatus_$11630_$",
"typeString": "type(enum Types.RStatus)"
}
},
"id": 8714,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"memberName": "ABOVE_ONE",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "5330:23:25",
"typeDescriptions": {
"typeIdentifier": "t_enum$_RStatus_$11630",
"typeString": "enum Types.RStatus"
}
},
"src": "5316:37:25",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 8729,
"nodeType": "IfStatement",
"src": "5312:180:25",
"trueBody": {
"id": 8728,
"nodeType": "Block",
"src": "5355:137:25",
"statements": [
{
"assignments": [
8717
],
"declarations": [
{
"constant": false,
"id": 8717,
"mutability": "mutable",
"name": "payBaseToken",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 8728,
"src": "5369:20:25",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 8716,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "5369:7:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 8720,
"initialValue": {
"argumentTypes": null,
"arguments": [],
"expression": {
"argumentTypes": [],
"id": 8718,
"name": "_RAboveBackToOne",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8668,
"src": "5392:16:25",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$",
"typeString": "function () view returns (uint256)"
}
},
"id": 8719,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "5392:18:25",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "5369:41:25"
},
{
"expression": {
"argumentTypes": null,
"components": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 8723,
"name": "payBaseToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8717,
"src": "5438:12:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"id": 8721,
"name": "B",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8680,
"src": "5432:1:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 8722,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "add",
"nodeType": "MemberAccess",
"referencedDeclaration": 11582,
"src": "5432:5:25",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
"typeString": "function (uint256,uint256) pure returns (uint256)"
}
},
"id": 8724,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "5432:19:25",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 8725,
"name": "_TARGET_QUOTE_TOKEN_AMOUNT_",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9463,
"src": "5453:27:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"id": 8726,
"isConstant": false,
"isInlineArray": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "TupleExpression",
"src": "5431:50:25",
"typeDescriptions": {
"typeIdentifier": "t_tuple$_t_uint256_$_t_uint256_$",
"typeString": "tuple(uint256,uint256)"
}
},
"functionReturnParameters": 8674,
"id": 8727,
"nodeType": "Return",
"src": "5424:57:25"
}
]
}
},
"id": 8730,
"nodeType": "IfStatement",
"src": "5125:367:25",
"trueBody": {
"id": 8710,
"nodeType": "Block",
"src": "5168:138:25",
"statements": [
{
"assignments": [
8699
],
"declarations": [
{
"constant": false,
"id": 8699,
"mutability": "mutable",
"name": "payQuoteToken",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 8710,
"src": "5182:21:25",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 8698,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "5182:7:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 8702,
"initialValue": {
"argumentTypes": null,
"arguments": [],
"expression": {
"argumentTypes": [],
"id": 8700,
"name": "_RBelowBackToOne",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8571,
"src": "5206:16:25",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$",
"typeString": "function () view returns (uint256)"
}
},
"id": 8701,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "5206:18:25",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "5182:42:25"
},
{
"expression": {
"argumentTypes": null,
"components": [
{
"argumentTypes": null,
"id": 8703,
"name": "_TARGET_BASE_TOKEN_AMOUNT_",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9461,
"src": "5246:26:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 8706,
"name": "payQuoteToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8699,
"src": "5280:13:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"id": 8704,
"name": "Q",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8676,
"src": "5274:1:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 8705,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "add",
"nodeType": "MemberAccess",
"referencedDeclaration": 11582,
"src": "5274:5:25",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
"typeString": "function (uint256,uint256) pure returns (uint256)"
}
},
"id": 8707,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "5274:20:25",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"id": 8708,
"isConstant": false,
"isInlineArray": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "TupleExpression",
"src": "5245:50:25",
"typeDescriptions": {
"typeIdentifier": "t_tuple$_t_uint256_$_t_uint256_$",
"typeString": "tuple(uint256,uint256)"
}
},
"functionReturnParameters": 8674,
"id": 8709,
"nodeType": "Return",
"src": "5238:57:25"
}
]
}
},
"id": 8731,
"nodeType": "IfStatement",
"src": "4993:499:25",
"trueBody": {
"id": 8692,
"nodeType": "Block",
"src": "5030:89:25",
"statements": [
{
"expression": {
"argumentTypes": null,
"components": [
{
"argumentTypes": null,
"id": 8688,
"name": "_TARGET_BASE_TOKEN_AMOUNT_",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9461,
"src": "5052:26:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 8689,
"name": "_TARGET_QUOTE_TOKEN_AMOUNT_",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9463,
"src": "5080:27:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"id": 8690,
"isConstant": false,
"isInlineArray": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "TupleExpression",
"src": "5051:57:25",
"typeDescriptions": {
"typeIdentifier": "t_tuple$_t_uint256_$_t_uint256_$",
"typeString": "tuple(uint256,uint256)"
}
},
"functionReturnParameters": 8674,
"id": 8691,
"nodeType": "Return",
"src": "5044:64:25"
}
]
}
}
]
},
"documentation": null,
"functionSelector": "ffa64225",
"id": 8733,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "getExpectedTarget",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 8669,
"nodeType": "ParameterList",
"parameters": [],
"src": "4845:2:25"
},
"returnParameters": {
"id": 8674,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 8671,
"mutability": "mutable",
"name": "baseTarget",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 8733,
"src": "4869:18:25",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 8670,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "4869:7:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 8673,
"mutability": "mutable",
"name": "quoteTarget",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 8733,
"src": "4889:19:25",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 8672,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "4889:7:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "4868:41:25"
},
"scope": 8853,
"src": "4819:679:25",
"stateMutability": "view",
"virtual": false,
"visibility": "public"
},
{
"body": {
"id": 8825,
"nodeType": "Block",
"src": "5566:737:25",
"statements": [
{
"assignments": [
8739,
8741
],
"declarations": [
{
"constant": false,
"id": 8739,
"mutability": "mutable",
"name": "baseTarget",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 8825,
"src": "5577:18:25",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 8738,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "5577:7:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 8741,
"mutability": "mutable",
"name": "quoteTarget",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 8825,
"src": "5597:19:25",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 8740,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "5597:7:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 8744,
"initialValue": {
"argumentTypes": null,
"arguments": [],
"expression": {
"argumentTypes": [],
"id": 8742,
"name": "getExpectedTarget",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8733,
"src": "5620:17:25",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$_t_uint256_$",
"typeString": "function () view returns (uint256,uint256)"
}
},
"id": 8743,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "5620:19:25",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$_t_uint256_$_t_uint256_$",
"typeString": "tuple(uint256,uint256)"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "5576:63:25"
},
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_enum$_RStatus_$11630",
"typeString": "enum Types.RStatus"
},
"id": 8749,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 8745,
"name": "_R_STATUS_",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9459,
"src": "5653:10:25",
"typeDescriptions": {
"typeIdentifier": "t_enum$_RStatus_$11630",
"typeString": "enum Types.RStatus"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 8746,
"name": "Types",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 11631,
"src": "5667:5:25",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_Types_$11631_$",
"typeString": "type(library Types)"
}
},
"id": 8747,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "RStatus",
"nodeType": "MemberAccess",
"referencedDeclaration": 11630,
"src": "5667:13:25",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_enum$_RStatus_$11630_$",
"typeString": "type(enum Types.RStatus)"
}
},
"id": 8748,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"memberName": "BELOW_ONE",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "5667:23:25",
"typeDescriptions": {
"typeIdentifier": "t_enum$_RStatus_$11630",
"typeString": "enum Types.RStatus"
}
},
"src": "5653:37:25",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": {
"id": 8823,
"nodeType": "Block",
"src": "6002:295:25",
"statements": [
{
"assignments": [
8788
],
"declarations": [
{
"constant": false,
"id": 8788,
"mutability": "mutable",
"name": "R",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 8823,
"src": "6016:9:25",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 8787,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "6016:7:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 8800,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 8796,
"name": "_BASE_BALANCE_",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9465,
"src": "6097:14:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 8793,
"name": "baseTarget",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8739,
"src": "6081:10:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"id": 8791,
"name": "baseTarget",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8739,
"src": "6066:10:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 8792,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "mul",
"nodeType": "MemberAccess",
"referencedDeclaration": 11478,
"src": "6066:14:25",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
"typeString": "function (uint256,uint256) pure returns (uint256)"
}
},
"id": 8794,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "6066:26:25",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 8795,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "div",
"nodeType": "MemberAccess",
"referencedDeclaration": 11499,
"src": "6066:30:25",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
"typeString": "function (uint256,uint256) pure returns (uint256)"
}
},
"id": 8797,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "6066:46:25",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 8798,
"name": "_BASE_BALANCE_",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9465,
"src": "6130:14:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"id": 8789,
"name": "DecimalMath",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 11078,
"src": "6028:11:25",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_DecimalMath_$11078_$",
"typeString": "type(library DecimalMath)"
}
},
"id": 8790,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "divFloor",
"nodeType": "MemberAccess",
"referencedDeclaration": 11059,
"src": "6028:20:25",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$",
"typeString": "function (uint256,uint256) pure returns (uint256)"
}
},
"id": 8799,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "6028:130:25",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "6016:142:25"
},
{
"expression": {
"argumentTypes": null,
"id": 8814,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 8801,
"name": "R",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8788,
"src": "6172:1:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 8810,
"name": "_K_",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9457,
"src": "6221:3:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 8811,
"name": "R",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8788,
"src": "6226:1:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"id": 8808,
"name": "DecimalMath",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 11078,
"src": "6205:11:25",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_DecimalMath_$11078_$",
"typeString": "type(library DecimalMath)"
}
},
"id": 8809,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "mul",
"nodeType": "MemberAccess",
"referencedDeclaration": 11023,
"src": "6205:15:25",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$",
"typeString": "function (uint256,uint256) pure returns (uint256)"
}
},
"id": 8812,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "6205:23:25",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 8805,
"name": "_K_",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9457,
"src": "6196:3:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 8802,
"name": "DecimalMath",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 11078,
"src": "6176:11:25",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_DecimalMath_$11078_$",
"typeString": "type(library DecimalMath)"
}
},
"id": 8803,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "ONE",
"nodeType": "MemberAccess",
"referencedDeclaration": 11006,
"src": "6176:15:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 8804,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sub",
"nodeType": "MemberAccess",
"referencedDeclaration": 11557,
"src": "6176:19:25",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
"typeString": "function (uint256,uint256) pure returns (uint256)"
}
},
"id": 8806,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "6176:24:25",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 8807,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "add",
"nodeType": "MemberAccess",
"referencedDeclaration": 11582,
"src": "6176:28:25",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
"typeString": "function (uint256,uint256) pure returns (uint256)"
}
},
"id": 8813,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "6176:53:25",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "6172:57:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 8815,
"nodeType": "ExpressionStatement",
"src": "6172:57:25"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [],
"expression": {
"argumentTypes": [],
"id": 8818,
"name": "getOraclePrice",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9550,
"src": "6266:14:25",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$",
"typeString": "function () view returns (uint256)"
}
},
"id": 8819,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "6266:16:25",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 8820,
"name": "R",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8788,
"src": "6284:1:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"id": 8816,
"name": "DecimalMath",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 11078,
"src": "6250:11:25",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_DecimalMath_$11078_$",
"typeString": "type(library DecimalMath)"
}
},
"id": 8817,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "mul",
"nodeType": "MemberAccess",
"referencedDeclaration": 11023,
"src": "6250:15:25",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$",
"typeString": "function (uint256,uint256) pure returns (uint256)"
}
},
"id": 8821,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "6250:36:25",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"functionReturnParameters": 8737,
"id": 8822,
"nodeType": "Return",
"src": "6243:43:25"
}
]
},
"id": 8824,
"nodeType": "IfStatement",
"src": "5649:648:25",
"trueBody": {
"id": 8786,
"nodeType": "Block",
"src": "5692:304:25",
"statements": [
{
"assignments": [
8751
],
"declarations": [
{
"constant": false,
"id": 8751,
"mutability": "mutable",
"name": "R",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 8786,
"src": "5706:9:25",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 8750,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "5706:7:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 8763,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 8759,
"name": "_QUOTE_BALANCE_",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9467,
"src": "5789:15:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 8756,
"name": "quoteTarget",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8741,
"src": "5772:11:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"id": 8754,
"name": "quoteTarget",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8741,
"src": "5756:11:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 8755,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "mul",
"nodeType": "MemberAccess",
"referencedDeclaration": 11478,
"src": "5756:15:25",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
"typeString": "function (uint256,uint256) pure returns (uint256)"
}
},
"id": 8757,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "5756:28:25",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 8758,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "div",
"nodeType": "MemberAccess",
"referencedDeclaration": 11499,
"src": "5756:32:25",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
"typeString": "function (uint256,uint256) pure returns (uint256)"
}
},
"id": 8760,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "5756:49:25",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 8761,
"name": "_QUOTE_BALANCE_",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9467,
"src": "5823:15:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"id": 8752,
"name": "DecimalMath",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 11078,
"src": "5718:11:25",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_DecimalMath_$11078_$",
"typeString": "type(library DecimalMath)"
}
},
"id": 8753,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "divFloor",
"nodeType": "MemberAccess",
"referencedDeclaration": 11059,
"src": "5718:20:25",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$",
"typeString": "function (uint256,uint256) pure returns (uint256)"
}
},
"id": 8762,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "5718:134:25",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "5706:146:25"
},
{
"expression": {
"argumentTypes": null,
"id": 8777,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 8764,
"name": "R",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8751,
"src": "5866:1:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 8773,
"name": "_K_",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9457,
"src": "5915:3:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 8774,
"name": "R",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8751,
"src": "5920:1:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"id": 8771,
"name": "DecimalMath",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 11078,
"src": "5899:11:25",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_DecimalMath_$11078_$",
"typeString": "type(library DecimalMath)"
}
},
"id": 8772,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "mul",
"nodeType": "MemberAccess",
"referencedDeclaration": 11023,
"src": "5899:15:25",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$",
"typeString": "function (uint256,uint256) pure returns (uint256)"
}
},
"id": 8775,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "5899:23:25",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 8768,
"name": "_K_",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9457,
"src": "5890:3:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 8765,
"name": "DecimalMath",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 11078,
"src": "5870:11:25",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_DecimalMath_$11078_$",
"typeString": "type(library DecimalMath)"
}
},
"id": 8766,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "ONE",
"nodeType": "MemberAccess",
"referencedDeclaration": 11006,
"src": "5870:15:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 8767,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sub",
"nodeType": "MemberAccess",
"referencedDeclaration": 11557,
"src": "5870:19:25",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
"typeString": "function (uint256,uint256) pure returns (uint256)"
}
},
"id": 8769,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "5870:24:25",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 8770,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "add",
"nodeType": "MemberAccess",
"referencedDeclaration": 11582,
"src": "5870:28:25",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
"typeString": "function (uint256,uint256) pure returns (uint256)"
}
},
"id": 8776,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "5870:53:25",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "5866:57:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 8778,
"nodeType": "ExpressionStatement",
"src": "5866:57:25"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [],
"expression": {
"argumentTypes": [],
"id": 8781,
"name": "getOraclePrice",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9550,
"src": "5965:14:25",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$",
"typeString": "function () view returns (uint256)"
}
},
"id": 8782,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "5965:16:25",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 8783,
"name": "R",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8751,
"src": "5983:1:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"id": 8779,
"name": "DecimalMath",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 11078,
"src": "5944:11:25",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_DecimalMath_$11078_$",
"typeString": "type(library DecimalMath)"
}
},
"id": 8780,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "divFloor",
"nodeType": "MemberAccess",
"referencedDeclaration": 11059,
"src": "5944:20:25",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$",
"typeString": "function (uint256,uint256) pure returns (uint256)"
}
},
"id": 8784,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "5944:41:25",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"functionReturnParameters": 8737,
"id": 8785,
"nodeType": "Return",
"src": "5937:48:25"
}
]
}
}
]
},
"documentation": null,
"functionSelector": "ee27c689",
"id": 8826,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "getMidPrice",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 8734,
"nodeType": "ParameterList",
"parameters": [],
"src": "5524:2:25"
},
"returnParameters": {
"id": 8737,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 8736,
"mutability": "mutable",
"name": "midPrice",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 8826,
"src": "5548:16:25",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 8735,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "5548:7:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "5547:18:25"
},
"scope": 8853,
"src": "5504:799:25",
"stateMutability": "view",
"virtual": false,
"visibility": "public"
},
{
"body": {
"id": 8851,
"nodeType": "Block",
"src": "6433:108:25",
"statements": [
{
"assignments": [
8838
],
"declarations": [
{
"constant": false,
"id": 8838,
"mutability": "mutable",
"name": "i",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 8851,
"src": "6443:9:25",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 8837,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "6443:7:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 8841,
"initialValue": {
"argumentTypes": null,
"arguments": [],
"expression": {
"argumentTypes": [],
"id": 8839,
"name": "getOraclePrice",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9550,
"src": "6455:14:25",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$",
"typeString": "function () view returns (uint256)"
}
},
"id": 8840,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "6455:16:25",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "6443:28:25"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 8844,
"name": "B0",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8828,
"src": "6515:2:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 8845,
"name": "B1",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8830,
"src": "6519:2:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 8846,
"name": "B2",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8832,
"src": "6523:2:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 8847,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8838,
"src": "6527:1:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 8848,
"name": "_K_",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9457,
"src": "6530:3:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"id": 8842,
"name": "DODOMath",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 10992,
"src": "6488:8:25",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_DODOMath_$10992_$",
"typeString": "type(library DODOMath)"
}
},
"id": 8843,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "_GeneralIntegrate",
"nodeType": "MemberAccess",
"referencedDeclaration": 10751,
"src": "6488:26:25",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$_t_uint256_$_t_uint256_$_t_uint256_$returns$_t_uint256_$",
"typeString": "function (uint256,uint256,uint256,uint256,uint256) pure returns (uint256)"
}
},
"id": 8849,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "6488:46:25",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"functionReturnParameters": 8836,
"id": 8850,
"nodeType": "Return",
"src": "6481:53:25"
}
]
},
"documentation": null,
"id": 8852,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "_RAboveIntegrate",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 8833,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 8828,
"mutability": "mutable",
"name": "B0",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 8852,
"src": "6344:10:25",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 8827,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "6344:7:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 8830,
"mutability": "mutable",
"name": "B1",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 8852,
"src": "6364:10:25",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 8829,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "6364:7:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 8832,
"mutability": "mutable",
"name": "B2",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 8852,
"src": "6384:10:25",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 8831,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "6384:7:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "6334:66:25"
},
"returnParameters": {
"id": 8836,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 8835,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 8852,
"src": "6424:7:25",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 8834,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "6424:7:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "6423:9:25"
},
"scope": 8853,
"src": "6309:232:25",
"stateMutability": "view",
"virtual": false,
"visibility": "internal"
}
],
"scope": 8854,
"src": "444:6425:25"
}
],
"src": "78:6792:25"
},
"legacyAST": {
"absolutePath": "/Users/owen/Desktop/dodo/dodo-smart-contract/contracts/impl/Pricing.sol",
"exportedSymbols": {
"Pricing": [
8853
]
},
"id": 8854,
"license": "Apache-2.0",
"nodeType": "SourceUnit",
"nodes": [
{
"id": 8371,
"literals": [
"solidity",
"0.6",
".9"
],
"nodeType": "PragmaDirective",
"src": "78:22:25"
},
{
"id": 8372,
"literals": [
"experimental",
"ABIEncoderV2"
],
"nodeType": "PragmaDirective",
"src": "101:33:25"
},
{
"absolutePath": "/Users/owen/Desktop/dodo/dodo-smart-contract/contracts/lib/SafeMath.sol",
"file": "../lib/SafeMath.sol",
"id": 8374,
"nodeType": "ImportDirective",
"scope": 8854,
"sourceUnit": 11624,
"src": "136:45:25",
"symbolAliases": [
{
"foreign": {
"argumentTypes": null,
"id": 8373,
"name": "SafeMath",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": null,
"src": "144:8:25",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
},
"local": null
}
],
"unitAlias": ""
},
{
"absolutePath": "/Users/owen/Desktop/dodo/dodo-smart-contract/contracts/lib/DecimalMath.sol",
"file": "../lib/DecimalMath.sol",
"id": 8376,
"nodeType": "ImportDirective",
"scope": 8854,
"sourceUnit": 11079,
"src": "182:51:25",
"symbolAliases": [
{
"foreign": {
"argumentTypes": null,
"id": 8375,
"name": "DecimalMath",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": null,
"src": "190:11:25",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
},
"local": null
}
],
"unitAlias": ""
},
{
"absolutePath": "/Users/owen/Desktop/dodo/dodo-smart-contract/contracts/lib/DODOMath.sol",
"file": "../lib/DODOMath.sol",
"id": 8378,
"nodeType": "ImportDirective",
"scope": 8854,
"sourceUnit": 10993,
"src": "234:45:25",
"symbolAliases": [
{
"foreign": {
"argumentTypes": null,
"id": 8377,
"name": "DODOMath",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": null,
"src": "242:8:25",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
},
"local": null
}
],
"unitAlias": ""
},
{
"absolutePath": "/Users/owen/Desktop/dodo/dodo-smart-contract/contracts/lib/Types.sol",
"file": "../lib/Types.sol",
"id": 8380,
"nodeType": "ImportDirective",
"scope": 8854,
"sourceUnit": 11632,
"src": "280:39:25",
"symbolAliases": [
{
"foreign": {
"argumentTypes": null,
"id": 8379,
"name": "Types",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": null,
"src": "288:5:25",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
},
"local": null
}
],
"unitAlias": ""
},
{
"absolutePath": "/Users/owen/Desktop/dodo/dodo-smart-contract/contracts/impl/Storage.sol",
"file": "./Storage.sol",
"id": 8382,
"nodeType": "ImportDirective",
"scope": 8854,
"sourceUnit": 9614,
"src": "320:38:25",
"symbolAliases": [
{
"foreign": {
"argumentTypes": null,
"id": 8381,
"name": "Storage",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": null,
"src": "328:7:25",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
},
"local": null
}
],
"unitAlias": ""
},
{
"abstract": false,
"baseContracts": [
{
"arguments": null,
"baseName": {
"contractScope": null,
"id": 8384,
"name": "Storage",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 9613,
"src": "464:7:25",
"typeDescriptions": {
"typeIdentifier": "t_contract$_Storage_$9613",
"typeString": "contract Storage"
}
},
"id": 8385,
"nodeType": "InheritanceSpecifier",
"src": "464:7:25"
}
],
"contractDependencies": [
9613,
11166,
11296
],
"contractKind": "contract",
"documentation": {
"id": 8383,
"nodeType": "StructuredDocumentation",
"src": "361:82:25",
"text": " @title Pricing\n @author DODO Breeder\n @notice DODO Pricing model"
},
"fullyImplemented": true,
"id": 8853,
"linearizedBaseContracts": [
8853,
9613,
11296,
11166
],
"name": "Pricing",
"nodeType": "ContractDefinition",
"nodes": [
{
"id": 8388,
"libraryName": {
"contractScope": null,
"id": 8386,
"name": "SafeMath",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 11623,
"src": "484:8:25",
"typeDescriptions": {
"typeIdentifier": "t_contract$_SafeMath_$11623",
"typeString": "library SafeMath"
}
},
"nodeType": "UsingForDirective",
"src": "478:27:25",
"typeName": {
"id": 8387,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "497:7:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
},
{
"body": {
"id": 8422,
"nodeType": "Block",
"src": "711:466:25",
"statements": [
{
"assignments": [
8398
],
"declarations": [
{
"constant": false,
"id": 8398,
"mutability": "mutable",
"name": "i",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 8422,
"src": "721:9:25",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 8397,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "721:7:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 8401,
"initialValue": {
"argumentTypes": null,
"arguments": [],
"expression": {
"argumentTypes": [],
"id": 8399,
"name": "getOraclePrice",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9550,
"src": "733:14:25",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$",
"typeString": "function () view returns (uint256)"
}
},
"id": 8400,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "733:16:25",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "721:28:25"
},
{
"assignments": [
8403
],
"declarations": [
{
"constant": false,
"id": 8403,
"mutability": "mutable",
"name": "Q2",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 8422,
"src": "759:10:25",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 8402,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "759:7:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 8416,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 8406,
"name": "targetQuoteTokenAmount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8392,
"src": "826:22:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 8407,
"name": "targetQuoteTokenAmount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8392,
"src": "862:22:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 8410,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8398,
"src": "914:1:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 8411,
"name": "amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8390,
"src": "917:6:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"id": 8408,
"name": "DecimalMath",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 11078,
"src": "898:11:25",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_DecimalMath_$11078_$",
"typeString": "type(library DecimalMath)"
}
},
"id": 8409,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "mul",
"nodeType": "MemberAccess",
"referencedDeclaration": 11023,
"src": "898:15:25",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$",
"typeString": "function (uint256,uint256) pure returns (uint256)"
}
},
"id": 8412,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "898:26:25",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"hexValue": "66616c7365",
"id": 8413,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "bool",
"lValueRequested": false,
"nodeType": "Literal",
"src": "938:5:25",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"value": "false"
},
{
"argumentTypes": null,
"id": 8414,
"name": "_K_",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9457,
"src": "957:3:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"id": 8404,
"name": "DODOMath",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 10992,
"src": "772:8:25",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_DODOMath_$10992_$",
"typeString": "type(library DODOMath)"
}
},
"id": 8405,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "_SolveQuadraticFunctionForTrade",
"nodeType": "MemberAccess",
"referencedDeclaration": 10925,
"src": "772:40:25",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$_t_uint256_$_t_bool_$_t_uint256_$returns$_t_uint256_$",
"typeString": "function (uint256,uint256,uint256,bool,uint256) pure returns (uint256)"
}
},
"id": 8415,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "772:198:25",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "759:211:25"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 8419,
"name": "Q2",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8403,
"src": "1167:2:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"id": 8417,
"name": "targetQuoteTokenAmount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8392,
"src": "1140:22:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 8418,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sub",
"nodeType": "MemberAccess",
"referencedDeclaration": 11557,
"src": "1140:26:25",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
"typeString": "function (uint256,uint256) pure returns (uint256)"
}
},
"id": 8420,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1140:30:25",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"functionReturnParameters": 8396,
"id": 8421,
"nodeType": "Return",
"src": "1133:37:25"
}
]
},
"documentation": null,
"id": 8423,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "_ROneSellBaseToken",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 8393,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 8390,
"mutability": "mutable",
"name": "amount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 8423,
"src": "585:14:25",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 8389,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "585:7:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 8392,
"mutability": "mutable",
"name": "targetQuoteTokenAmount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 8423,
"src": "601:30:25",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 8391,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "601:7:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "584:48:25"
},
"returnParameters": {
"id": 8396,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 8395,
"mutability": "mutable",
"name": "receiveQuoteToken",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 8423,
"src": "680:25:25",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 8394,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "680:7:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "679:27:25"
},
"scope": 8853,
"src": "557:620:25",
"stateMutability": "view",
"virtual": false,
"visibility": "internal"
},
{
"body": {
"id": 8456,
"nodeType": "Block",
"src": "1331:266:25",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 8435,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 8433,
"name": "amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8425,
"src": "1349:6:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "<",
"rightExpression": {
"argumentTypes": null,
"id": 8434,
"name": "targetBaseTokenAmount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8427,
"src": "1358:21:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "1349:30:25",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"argumentTypes": null,
"hexValue": "444f444f5f424153455f42414c414e43455f4e4f545f454e4f554748",
"id": 8436,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1381:30:25",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_997068fbd59291c0e94aa73a95de3c076c00f04014e63bef27a7316bb88c0e69",
"typeString": "literal_string \"DODO_BASE_BALANCE_NOT_ENOUGH\""
},
"value": "DODO_BASE_BALANCE_NOT_ENOUGH"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_stringliteral_997068fbd59291c0e94aa73a95de3c076c00f04014e63bef27a7316bb88c0e69",
"typeString": "literal_string \"DODO_BASE_BALANCE_NOT_ENOUGH\""
}
],
"id": 8432,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
-18,
-18
],
"referencedDeclaration": -18,
"src": "1341:7:25",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 8437,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1341:71:25",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 8438,
"nodeType": "ExpressionStatement",
"src": "1341:71:25"
},
{
"assignments": [
8440
],
"declarations": [
{
"constant": false,
"id": 8440,
"mutability": "mutable",
"name": "B2",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 8456,
"src": "1422:10:25",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 8439,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "1422:7:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 8445,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 8443,
"name": "amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8425,
"src": "1461:6:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"id": 8441,
"name": "targetBaseTokenAmount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8427,
"src": "1435:21:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 8442,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sub",
"nodeType": "MemberAccess",
"referencedDeclaration": 11557,
"src": "1435:25:25",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
"typeString": "function (uint256,uint256) pure returns (uint256)"
}
},
"id": 8444,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1435:33:25",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "1422:46:25"
},
{
"expression": {
"argumentTypes": null,
"id": 8452,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 8446,
"name": "payQuoteToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8430,
"src": "1478:13:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 8448,
"name": "targetBaseTokenAmount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8427,
"src": "1511:21:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 8449,
"name": "targetBaseTokenAmount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8427,
"src": "1534:21:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 8450,
"name": "B2",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8440,
"src": "1557:2:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 8447,
"name": "_RAboveIntegrate",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8852,
"src": "1494:16:25",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$_t_uint256_$_t_uint256_$_t_uint256_$returns$_t_uint256_$",
"typeString": "function (uint256,uint256,uint256) view returns (uint256)"
}
},
"id": 8451,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1494:66:25",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "1478:82:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 8453,
"nodeType": "ExpressionStatement",
"src": "1478:82:25"
},
{
"expression": {
"argumentTypes": null,
"id": 8454,
"name": "payQuoteToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8430,
"src": "1577:13:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"functionReturnParameters": 8431,
"id": 8455,
"nodeType": "Return",
"src": "1570:20:25"
}
]
},
"documentation": null,
"id": 8457,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "_ROneBuyBaseToken",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 8428,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 8425,
"mutability": "mutable",
"name": "amount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 8457,
"src": "1210:14:25",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 8424,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "1210:7:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 8427,
"mutability": "mutable",
"name": "targetBaseTokenAmount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 8457,
"src": "1226:29:25",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 8426,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "1226:7:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "1209:47:25"
},
"returnParameters": {
"id": 8431,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 8430,
"mutability": "mutable",
"name": "payQuoteToken",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 8457,
"src": "1304:21:25",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 8429,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "1304:7:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "1303:23:25"
},
"scope": 8853,
"src": "1183:414:25",
"stateMutability": "view",
"virtual": false,
"visibility": "internal"
},
{
"body": {
"id": 8493,
"nodeType": "Block",
"src": "1823:288:25",
"statements": [
{
"assignments": [
8469
],
"declarations": [
{
"constant": false,
"id": 8469,
"mutability": "mutable",
"name": "i",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 8493,
"src": "1833:9:25",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 8468,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "1833:7:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 8472,
"initialValue": {
"argumentTypes": null,
"arguments": [],
"expression": {
"argumentTypes": [],
"id": 8470,
"name": "getOraclePrice",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9550,
"src": "1845:14:25",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$",
"typeString": "function () view returns (uint256)"
}
},
"id": 8471,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1845:16:25",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "1833:28:25"
},
{
"assignments": [
8474
],
"declarations": [
{
"constant": false,
"id": 8474,
"mutability": "mutable",
"name": "Q2",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 8493,
"src": "1871:10:25",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 8473,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "1871:7:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 8487,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 8477,
"name": "targetQuoteAmount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8463,
"src": "1938:17:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 8478,
"name": "quoteBalance",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8461,
"src": "1969:12:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 8481,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8469,
"src": "2011:1:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 8482,
"name": "amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8459,
"src": "2014:6:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"id": 8479,
"name": "DecimalMath",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 11078,
"src": "1995:11:25",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_DecimalMath_$11078_$",
"typeString": "type(library DecimalMath)"
}
},
"id": 8480,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "mul",
"nodeType": "MemberAccess",
"referencedDeclaration": 11023,
"src": "1995:15:25",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$",
"typeString": "function (uint256,uint256) pure returns (uint256)"
}
},
"id": 8483,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1995:26:25",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"hexValue": "66616c7365",
"id": 8484,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "bool",
"lValueRequested": false,
"nodeType": "Literal",
"src": "2035:5:25",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"value": "false"
},
{
"argumentTypes": null,
"id": 8485,
"name": "_K_",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9457,
"src": "2054:3:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"id": 8475,
"name": "DODOMath",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 10992,
"src": "1884:8:25",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_DODOMath_$10992_$",
"typeString": "type(library DODOMath)"
}
},
"id": 8476,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "_SolveQuadraticFunctionForTrade",
"nodeType": "MemberAccess",
"referencedDeclaration": 10925,
"src": "1884:40:25",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$_t_uint256_$_t_bool_$_t_uint256_$returns$_t_uint256_$",
"typeString": "function (uint256,uint256,uint256,bool,uint256) pure returns (uint256)"
}
},
"id": 8486,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1884:183:25",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "1871:196:25"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 8490,
"name": "Q2",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8474,
"src": "2101:2:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"id": 8488,
"name": "quoteBalance",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8461,
"src": "2084:12:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 8489,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sub",
"nodeType": "MemberAccess",
"referencedDeclaration": 11557,
"src": "2084:16:25",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
"typeString": "function (uint256,uint256) pure returns (uint256)"
}
},
"id": 8491,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "2084:20:25",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"functionReturnParameters": 8467,
"id": 8492,
"nodeType": "Return",
"src": "2077:27:25"
}
]
},
"documentation": null,
"id": 8494,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "_RBelowSellBaseToken",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 8464,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 8459,
"mutability": "mutable",
"name": "amount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 8494,
"src": "1688:14:25",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 8458,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "1688:7:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 8461,
"mutability": "mutable",
"name": "quoteBalance",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 8494,
"src": "1712:20:25",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 8460,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "1712:7:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 8463,
"mutability": "mutable",
"name": "targetQuoteAmount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 8494,
"src": "1742:25:25",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 8462,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "1742:7:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "1678:95:25"
},
"returnParameters": {
"id": 8467,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 8466,
"mutability": "mutable",
"name": "receieQuoteToken",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 8494,
"src": "1797:24:25",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 8465,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "1797:7:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "1796:26:25"
},
"scope": 8853,
"src": "1649:462:25",
"stateMutability": "view",
"virtual": false,
"visibility": "internal"
},
{
"body": {
"id": 8530,
"nodeType": "Block",
"src": "2287:443:25",
"statements": [
{
"assignments": [
8506
],
"declarations": [
{
"constant": false,
"id": 8506,
"mutability": "mutable",
"name": "i",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 8530,
"src": "2449:9:25",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 8505,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "2449:7:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 8509,
"initialValue": {
"argumentTypes": null,
"arguments": [],
"expression": {
"argumentTypes": [],
"id": 8507,
"name": "getOraclePrice",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9550,
"src": "2461:14:25",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$",
"typeString": "function () view returns (uint256)"
}
},
"id": 8508,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "2461:16:25",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "2449:28:25"
},
{
"assignments": [
8511
],
"declarations": [
{
"constant": false,
"id": 8511,
"mutability": "mutable",
"name": "Q2",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 8530,
"src": "2487:10:25",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 8510,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "2487:7:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 8524,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 8514,
"name": "targetQuoteAmount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8500,
"src": "2554:17:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 8515,
"name": "quoteBalance",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8498,
"src": "2585:12:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 8518,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8506,
"src": "2631:1:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 8519,
"name": "amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8496,
"src": "2634:6:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"id": 8516,
"name": "DecimalMath",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 11078,
"src": "2611:11:25",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_DecimalMath_$11078_$",
"typeString": "type(library DecimalMath)"
}
},
"id": 8517,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "mulCeil",
"nodeType": "MemberAccess",
"referencedDeclaration": 11041,
"src": "2611:19:25",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$",
"typeString": "function (uint256,uint256) pure returns (uint256)"
}
},
"id": 8520,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "2611:30:25",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"hexValue": "74727565",
"id": 8521,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "bool",
"lValueRequested": false,
"nodeType": "Literal",
"src": "2655:4:25",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"value": "true"
},
{
"argumentTypes": null,
"id": 8522,
"name": "_K_",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9457,
"src": "2673:3:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"id": 8512,
"name": "DODOMath",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 10992,
"src": "2500:8:25",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_DODOMath_$10992_$",
"typeString": "type(library DODOMath)"
}
},
"id": 8513,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "_SolveQuadraticFunctionForTrade",
"nodeType": "MemberAccess",
"referencedDeclaration": 10925,
"src": "2500:40:25",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$_t_uint256_$_t_bool_$_t_uint256_$returns$_t_uint256_$",
"typeString": "function (uint256,uint256,uint256,bool,uint256) pure returns (uint256)"
}
},
"id": 8523,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "2500:186:25",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "2487:199:25"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 8527,
"name": "quoteBalance",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8498,
"src": "2710:12:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"id": 8525,
"name": "Q2",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8511,
"src": "2703:2:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 8526,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sub",
"nodeType": "MemberAccess",
"referencedDeclaration": 11557,
"src": "2703:6:25",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
"typeString": "function (uint256,uint256) pure returns (uint256)"
}
},
"id": 8528,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "2703:20:25",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"functionReturnParameters": 8504,
"id": 8529,
"nodeType": "Return",
"src": "2696:27:25"
}
]
},
"documentation": null,
"id": 8531,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "_RBelowBuyBaseToken",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 8501,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 8496,
"mutability": "mutable",
"name": "amount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 8531,
"src": "2155:14:25",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 8495,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "2155:7:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 8498,
"mutability": "mutable",
"name": "quoteBalance",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 8531,
"src": "2179:20:25",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 8497,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "2179:7:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 8500,
"mutability": "mutable",
"name": "targetQuoteAmount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 8531,
"src": "2209:25:25",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 8499,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "2209:7:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "2145:95:25"
},
"returnParameters": {
"id": 8504,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 8503,
"mutability": "mutable",
"name": "payQuoteToken",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 8531,
"src": "2264:21:25",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 8502,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "2264:7:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "2263:23:25"
},
"scope": 8853,
"src": "2117:613:25",
"stateMutability": "view",
"virtual": false,
"visibility": "internal"
},
{
"body": {
"id": 8570,
"nodeType": "Block",
"src": "2810:504:25",
"statements": [
{
"assignments": [
8537
],
"declarations": [
{
"constant": false,
"id": 8537,
"mutability": "mutable",
"name": "spareBase",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 8570,
"src": "2927:17:25",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 8536,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "2927:7:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 8542,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 8540,
"name": "_TARGET_BASE_TOKEN_AMOUNT_",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9461,
"src": "2966:26:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"id": 8538,
"name": "_BASE_BALANCE_",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9465,
"src": "2947:14:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 8539,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sub",
"nodeType": "MemberAccess",
"referencedDeclaration": 11557,
"src": "2947:18:25",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
"typeString": "function (uint256,uint256) pure returns (uint256)"
}
},
"id": 8541,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "2947:46:25",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "2927:66:25"
},
{
"assignments": [
8544
],
"declarations": [
{
"constant": false,
"id": 8544,
"mutability": "mutable",
"name": "price",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 8570,
"src": "3003:13:25",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 8543,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "3003:7:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 8547,
"initialValue": {
"argumentTypes": null,
"arguments": [],
"expression": {
"argumentTypes": [],
"id": 8545,
"name": "getOraclePrice",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9550,
"src": "3019:14:25",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$",
"typeString": "function () view returns (uint256)"
}
},
"id": 8546,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "3019:16:25",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "3003:32:25"
},
{
"assignments": [
8549
],
"declarations": [
{
"constant": false,
"id": 8549,
"mutability": "mutable",
"name": "fairAmount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 8570,
"src": "3045:18:25",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 8548,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "3045:7:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 8555,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 8552,
"name": "spareBase",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8537,
"src": "3082:9:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 8553,
"name": "price",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8544,
"src": "3093:5:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"id": 8550,
"name": "DecimalMath",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 11078,
"src": "3066:11:25",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_DecimalMath_$11078_$",
"typeString": "type(library DecimalMath)"
}
},
"id": 8551,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "mul",
"nodeType": "MemberAccess",
"referencedDeclaration": 11023,
"src": "3066:15:25",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$",
"typeString": "function (uint256,uint256) pure returns (uint256)"
}
},
"id": 8554,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "3066:33:25",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "3045:54:25"
},
{
"assignments": [
8557
],
"declarations": [
{
"constant": false,
"id": 8557,
"mutability": "mutable",
"name": "newTargetQuote",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 8570,
"src": "3109:22:25",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 8556,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "3109:7:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 8564,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 8560,
"name": "_QUOTE_BALANCE_",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9467,
"src": "3189:15:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 8561,
"name": "_K_",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9457,
"src": "3218:3:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 8562,
"name": "fairAmount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8549,
"src": "3235:10:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"id": 8558,
"name": "DODOMath",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 10992,
"src": "3134:8:25",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_DODOMath_$10992_$",
"typeString": "type(library DODOMath)"
}
},
"id": 8559,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "_SolveQuadraticFunctionForTarget",
"nodeType": "MemberAccess",
"referencedDeclaration": 10991,
"src": "3134:41:25",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$_t_uint256_$returns$_t_uint256_$",
"typeString": "function (uint256,uint256,uint256) pure returns (uint256)"
}
},
"id": 8563,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "3134:121:25",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "3109:146:25"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 8567,
"name": "_QUOTE_BALANCE_",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9467,
"src": "3291:15:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"id": 8565,
"name": "newTargetQuote",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8557,
"src": "3272:14:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 8566,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sub",
"nodeType": "MemberAccess",
"referencedDeclaration": 11557,
"src": "3272:18:25",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
"typeString": "function (uint256,uint256) pure returns (uint256)"
}
},
"id": 8568,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "3272:35:25",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"functionReturnParameters": 8535,
"id": 8569,
"nodeType": "Return",
"src": "3265:42:25"
}
]
},
"documentation": null,
"id": 8571,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "_RBelowBackToOne",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 8532,
"nodeType": "ParameterList",
"parameters": [],
"src": "2761:2:25"
},
"returnParameters": {
"id": 8535,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 8534,
"mutability": "mutable",
"name": "payQuoteToken",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 8571,
"src": "2787:21:25",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 8533,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "2787:7:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "2786:23:25"
},
"scope": 8853,
"src": "2736:578:25",
"stateMutability": "view",
"virtual": false,
"visibility": "internal"
},
{
"body": {
"id": 8602,
"nodeType": "Block",
"src": "3534:192:25",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 8585,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 8583,
"name": "amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8573,
"src": "3552:6:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "<",
"rightExpression": {
"argumentTypes": null,
"id": 8584,
"name": "baseBalance",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8575,
"src": "3561:11:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "3552:20:25",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"argumentTypes": null,
"hexValue": "444f444f5f424153455f42414c414e43455f4e4f545f454e4f554748",
"id": 8586,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "3574:30:25",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_997068fbd59291c0e94aa73a95de3c076c00f04014e63bef27a7316bb88c0e69",
"typeString": "literal_string \"DODO_BASE_BALANCE_NOT_ENOUGH\""
},
"value": "DODO_BASE_BALANCE_NOT_ENOUGH"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_stringliteral_997068fbd59291c0e94aa73a95de3c076c00f04014e63bef27a7316bb88c0e69",
"typeString": "literal_string \"DODO_BASE_BALANCE_NOT_ENOUGH\""
}
],
"id": 8582,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
-18,
-18
],
"referencedDeclaration": -18,
"src": "3544:7:25",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 8587,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "3544:61:25",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 8588,
"nodeType": "ExpressionStatement",
"src": "3544:61:25"
},
{
"assignments": [
8590
],
"declarations": [
{
"constant": false,
"id": 8590,
"mutability": "mutable",
"name": "B2",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 8602,
"src": "3615:10:25",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 8589,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "3615:7:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 8595,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 8593,
"name": "amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8573,
"src": "3644:6:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"id": 8591,
"name": "baseBalance",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8575,
"src": "3628:11:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 8592,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sub",
"nodeType": "MemberAccess",
"referencedDeclaration": 11557,
"src": "3628:15:25",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
"typeString": "function (uint256,uint256) pure returns (uint256)"
}
},
"id": 8594,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "3628:23:25",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "3615:36:25"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 8597,
"name": "targetBaseAmount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8577,
"src": "3685:16:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 8598,
"name": "baseBalance",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8575,
"src": "3703:11:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 8599,
"name": "B2",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8590,
"src": "3716:2:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 8596,
"name": "_RAboveIntegrate",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8852,
"src": "3668:16:25",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$_t_uint256_$_t_uint256_$_t_uint256_$returns$_t_uint256_$",
"typeString": "function (uint256,uint256,uint256) view returns (uint256)"
}
},
"id": 8600,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "3668:51:25",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"functionReturnParameters": 8581,
"id": 8601,
"nodeType": "Return",
"src": "3661:58:25"
}
]
},
"documentation": null,
"id": 8603,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "_RAboveBuyBaseToken",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 8578,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 8573,
"mutability": "mutable",
"name": "amount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 8603,
"src": "3404:14:25",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 8572,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "3404:7:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 8575,
"mutability": "mutable",
"name": "baseBalance",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 8603,
"src": "3428:19:25",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 8574,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "3428:7:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 8577,
"mutability": "mutable",
"name": "targetBaseAmount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 8603,
"src": "3457:24:25",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 8576,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "3457:7:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "3394:93:25"
},
"returnParameters": {
"id": 8581,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 8580,
"mutability": "mutable",
"name": "payQuoteToken",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 8603,
"src": "3511:21:25",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 8579,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "3511:7:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "3510:23:25"
},
"scope": 8853,
"src": "3366:360:25",
"stateMutability": "view",
"virtual": false,
"visibility": "internal"
},
{
"body": {
"id": 8627,
"nodeType": "Block",
"src": "3905:269:25",
"statements": [
{
"assignments": [
8615
],
"declarations": [
{
"constant": false,
"id": 8615,
"mutability": "mutable",
"name": "B1",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 8627,
"src": "4063:10:25",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 8614,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "4063:7:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 8620,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 8618,
"name": "amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8605,
"src": "4092:6:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"id": 8616,
"name": "baseBalance",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8607,
"src": "4076:11:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 8617,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "add",
"nodeType": "MemberAccess",
"referencedDeclaration": 11582,
"src": "4076:15:25",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
"typeString": "function (uint256,uint256) pure returns (uint256)"
}
},
"id": 8619,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "4076:23:25",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "4063:36:25"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 8622,
"name": "targetBaseAmount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8609,
"src": "4133:16:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 8623,
"name": "B1",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8615,
"src": "4151:2:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 8624,
"name": "baseBalance",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8607,
"src": "4155:11:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 8621,
"name": "_RAboveIntegrate",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8852,
"src": "4116:16:25",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$_t_uint256_$_t_uint256_$_t_uint256_$returns$_t_uint256_$",
"typeString": "function (uint256,uint256,uint256) view returns (uint256)"
}
},
"id": 8625,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "4116:51:25",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"functionReturnParameters": 8613,
"id": 8626,
"nodeType": "Return",
"src": "4109:58:25"
}
]
},
"documentation": null,
"id": 8628,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "_RAboveSellBaseToken",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 8610,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 8605,
"mutability": "mutable",
"name": "amount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 8628,
"src": "3771:14:25",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 8604,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "3771:7:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 8607,
"mutability": "mutable",
"name": "baseBalance",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 8628,
"src": "3795:19:25",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 8606,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "3795:7:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 8609,
"mutability": "mutable",
"name": "targetBaseAmount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 8628,
"src": "3824:24:25",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 8608,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "3824:7:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "3761:93:25"
},
"returnParameters": {
"id": 8613,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 8612,
"mutability": "mutable",
"name": "receiveQuoteToken",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 8628,
"src": "3878:25:25",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 8611,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "3878:7:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "3877:27:25"
},
"scope": 8853,
"src": "3732:442:25",
"stateMutability": "view",
"virtual": false,
"visibility": "internal"
},
{
"body": {
"id": 8667,
"nodeType": "Block",
"src": "4253:509:25",
"statements": [
{
"assignments": [
8634
],
"declarations": [
{
"constant": false,
"id": 8634,
"mutability": "mutable",
"name": "spareQuote",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 8667,
"src": "4370:18:25",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 8633,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "4370:7:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 8639,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 8637,
"name": "_TARGET_QUOTE_TOKEN_AMOUNT_",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9463,
"src": "4411:27:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"id": 8635,
"name": "_QUOTE_BALANCE_",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9467,
"src": "4391:15:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 8636,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sub",
"nodeType": "MemberAccess",
"referencedDeclaration": 11557,
"src": "4391:19:25",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
"typeString": "function (uint256,uint256) pure returns (uint256)"
}
},
"id": 8638,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "4391:48:25",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "4370:69:25"
},
{
"assignments": [
8641
],
"declarations": [
{
"constant": false,
"id": 8641,
"mutability": "mutable",
"name": "price",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 8667,
"src": "4449:13:25",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 8640,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "4449:7:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 8644,
"initialValue": {
"argumentTypes": null,
"arguments": [],
"expression": {
"argumentTypes": [],
"id": 8642,
"name": "getOraclePrice",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9550,
"src": "4465:14:25",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$",
"typeString": "function () view returns (uint256)"
}
},
"id": 8643,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "4465:16:25",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "4449:32:25"
},
{
"assignments": [
8646
],
"declarations": [
{
"constant": false,
"id": 8646,
"mutability": "mutable",
"name": "fairAmount",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 8667,
"src": "4491:18:25",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 8645,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "4491:7:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 8652,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 8649,
"name": "spareQuote",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8634,
"src": "4533:10:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 8650,
"name": "price",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8641,
"src": "4545:5:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"id": 8647,
"name": "DecimalMath",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 11078,
"src": "4512:11:25",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_DecimalMath_$11078_$",
"typeString": "type(library DecimalMath)"
}
},
"id": 8648,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "divFloor",
"nodeType": "MemberAccess",
"referencedDeclaration": 11059,
"src": "4512:20:25",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$",
"typeString": "function (uint256,uint256) pure returns (uint256)"
}
},
"id": 8651,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "4512:39:25",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "4491:60:25"
},
{
"assignments": [
8654
],
"declarations": [
{
"constant": false,
"id": 8654,
"mutability": "mutable",
"name": "newTargetBase",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 8667,
"src": "4561:21:25",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 8653,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "4561:7:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 8661,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 8657,
"name": "_BASE_BALANCE_",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9465,
"src": "4640:14:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 8658,
"name": "_K_",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9457,
"src": "4668:3:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 8659,
"name": "fairAmount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8646,
"src": "4685:10:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"id": 8655,
"name": "DODOMath",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 10992,
"src": "4585:8:25",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_DODOMath_$10992_$",
"typeString": "type(library DODOMath)"
}
},
"id": 8656,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "_SolveQuadraticFunctionForTarget",
"nodeType": "MemberAccess",
"referencedDeclaration": 10991,
"src": "4585:41:25",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$_t_uint256_$returns$_t_uint256_$",
"typeString": "function (uint256,uint256,uint256) pure returns (uint256)"
}
},
"id": 8660,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "4585:120:25",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "4561:144:25"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 8664,
"name": "_BASE_BALANCE_",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9465,
"src": "4740:14:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"id": 8662,
"name": "newTargetBase",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8654,
"src": "4722:13:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 8663,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sub",
"nodeType": "MemberAccess",
"referencedDeclaration": 11557,
"src": "4722:17:25",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
"typeString": "function (uint256,uint256) pure returns (uint256)"
}
},
"id": 8665,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "4722:33:25",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"functionReturnParameters": 8632,
"id": 8666,
"nodeType": "Return",
"src": "4715:40:25"
}
]
},
"documentation": null,
"id": 8668,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "_RAboveBackToOne",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 8629,
"nodeType": "ParameterList",
"parameters": [],
"src": "4205:2:25"
},
"returnParameters": {
"id": 8632,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 8631,
"mutability": "mutable",
"name": "payBaseToken",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 8668,
"src": "4231:20:25",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 8630,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "4231:7:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "4230:22:25"
},
"scope": 8853,
"src": "4180:582:25",
"stateMutability": "view",
"virtual": false,
"visibility": "internal"
},
{
"body": {
"id": 8732,
"nodeType": "Block",
"src": "4910:588:25",
"statements": [
{
"assignments": [
8676
],
"declarations": [
{
"constant": false,
"id": 8676,
"mutability": "mutable",
"name": "Q",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 8732,
"src": "4920:9:25",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 8675,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "4920:7:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 8678,
"initialValue": {
"argumentTypes": null,
"id": 8677,
"name": "_QUOTE_BALANCE_",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9467,
"src": "4932:15:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "4920:27:25"
},
{
"assignments": [
8680
],
"declarations": [
{
"constant": false,
"id": 8680,
"mutability": "mutable",
"name": "B",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 8732,
"src": "4957:9:25",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 8679,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "4957:7:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 8682,
"initialValue": {
"argumentTypes": null,
"id": 8681,
"name": "_BASE_BALANCE_",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9465,
"src": "4969:14:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "4957:26:25"
},
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_enum$_RStatus_$11630",
"typeString": "enum Types.RStatus"
},
"id": 8687,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 8683,
"name": "_R_STATUS_",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9459,
"src": "4997:10:25",
"typeDescriptions": {
"typeIdentifier": "t_enum$_RStatus_$11630",
"typeString": "enum Types.RStatus"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 8684,
"name": "Types",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 11631,
"src": "5011:5:25",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_Types_$11631_$",
"typeString": "type(library Types)"
}
},
"id": 8685,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "RStatus",
"nodeType": "MemberAccess",
"referencedDeclaration": 11630,
"src": "5011:13:25",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_enum$_RStatus_$11630_$",
"typeString": "type(enum Types.RStatus)"
}
},
"id": 8686,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"memberName": "ONE",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "5011:17:25",
"typeDescriptions": {
"typeIdentifier": "t_enum$_RStatus_$11630",
"typeString": "enum Types.RStatus"
}
},
"src": "4997:31:25",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": {
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_enum$_RStatus_$11630",
"typeString": "enum Types.RStatus"
},
"id": 8697,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 8693,
"name": "_R_STATUS_",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9459,
"src": "5129:10:25",
"typeDescriptions": {
"typeIdentifier": "t_enum$_RStatus_$11630",
"typeString": "enum Types.RStatus"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 8694,
"name": "Types",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 11631,
"src": "5143:5:25",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_Types_$11631_$",
"typeString": "type(library Types)"
}
},
"id": 8695,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "RStatus",
"nodeType": "MemberAccess",
"referencedDeclaration": 11630,
"src": "5143:13:25",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_enum$_RStatus_$11630_$",
"typeString": "type(enum Types.RStatus)"
}
},
"id": 8696,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"memberName": "BELOW_ONE",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "5143:23:25",
"typeDescriptions": {
"typeIdentifier": "t_enum$_RStatus_$11630",
"typeString": "enum Types.RStatus"
}
},
"src": "5129:37:25",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": {
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_enum$_RStatus_$11630",
"typeString": "enum Types.RStatus"
},
"id": 8715,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 8711,
"name": "_R_STATUS_",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9459,
"src": "5316:10:25",
"typeDescriptions": {
"typeIdentifier": "t_enum$_RStatus_$11630",
"typeString": "enum Types.RStatus"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 8712,
"name": "Types",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 11631,
"src": "5330:5:25",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_Types_$11631_$",
"typeString": "type(library Types)"
}
},
"id": 8713,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "RStatus",
"nodeType": "MemberAccess",
"referencedDeclaration": 11630,
"src": "5330:13:25",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_enum$_RStatus_$11630_$",
"typeString": "type(enum Types.RStatus)"
}
},
"id": 8714,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"memberName": "ABOVE_ONE",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "5330:23:25",
"typeDescriptions": {
"typeIdentifier": "t_enum$_RStatus_$11630",
"typeString": "enum Types.RStatus"
}
},
"src": "5316:37:25",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 8729,
"nodeType": "IfStatement",
"src": "5312:180:25",
"trueBody": {
"id": 8728,
"nodeType": "Block",
"src": "5355:137:25",
"statements": [
{
"assignments": [
8717
],
"declarations": [
{
"constant": false,
"id": 8717,
"mutability": "mutable",
"name": "payBaseToken",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 8728,
"src": "5369:20:25",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 8716,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "5369:7:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 8720,
"initialValue": {
"argumentTypes": null,
"arguments": [],
"expression": {
"argumentTypes": [],
"id": 8718,
"name": "_RAboveBackToOne",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8668,
"src": "5392:16:25",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$",
"typeString": "function () view returns (uint256)"
}
},
"id": 8719,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "5392:18:25",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "5369:41:25"
},
{
"expression": {
"argumentTypes": null,
"components": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 8723,
"name": "payBaseToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8717,
"src": "5438:12:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"id": 8721,
"name": "B",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8680,
"src": "5432:1:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 8722,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "add",
"nodeType": "MemberAccess",
"referencedDeclaration": 11582,
"src": "5432:5:25",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
"typeString": "function (uint256,uint256) pure returns (uint256)"
}
},
"id": 8724,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "5432:19:25",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 8725,
"name": "_TARGET_QUOTE_TOKEN_AMOUNT_",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9463,
"src": "5453:27:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"id": 8726,
"isConstant": false,
"isInlineArray": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "TupleExpression",
"src": "5431:50:25",
"typeDescriptions": {
"typeIdentifier": "t_tuple$_t_uint256_$_t_uint256_$",
"typeString": "tuple(uint256,uint256)"
}
},
"functionReturnParameters": 8674,
"id": 8727,
"nodeType": "Return",
"src": "5424:57:25"
}
]
}
},
"id": 8730,
"nodeType": "IfStatement",
"src": "5125:367:25",
"trueBody": {
"id": 8710,
"nodeType": "Block",
"src": "5168:138:25",
"statements": [
{
"assignments": [
8699
],
"declarations": [
{
"constant": false,
"id": 8699,
"mutability": "mutable",
"name": "payQuoteToken",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 8710,
"src": "5182:21:25",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 8698,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "5182:7:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 8702,
"initialValue": {
"argumentTypes": null,
"arguments": [],
"expression": {
"argumentTypes": [],
"id": 8700,
"name": "_RBelowBackToOne",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8571,
"src": "5206:16:25",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$",
"typeString": "function () view returns (uint256)"
}
},
"id": 8701,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "5206:18:25",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "5182:42:25"
},
{
"expression": {
"argumentTypes": null,
"components": [
{
"argumentTypes": null,
"id": 8703,
"name": "_TARGET_BASE_TOKEN_AMOUNT_",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9461,
"src": "5246:26:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 8706,
"name": "payQuoteToken",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8699,
"src": "5280:13:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"id": 8704,
"name": "Q",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8676,
"src": "5274:1:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 8705,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "add",
"nodeType": "MemberAccess",
"referencedDeclaration": 11582,
"src": "5274:5:25",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
"typeString": "function (uint256,uint256) pure returns (uint256)"
}
},
"id": 8707,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "5274:20:25",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"id": 8708,
"isConstant": false,
"isInlineArray": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "TupleExpression",
"src": "5245:50:25",
"typeDescriptions": {
"typeIdentifier": "t_tuple$_t_uint256_$_t_uint256_$",
"typeString": "tuple(uint256,uint256)"
}
},
"functionReturnParameters": 8674,
"id": 8709,
"nodeType": "Return",
"src": "5238:57:25"
}
]
}
},
"id": 8731,
"nodeType": "IfStatement",
"src": "4993:499:25",
"trueBody": {
"id": 8692,
"nodeType": "Block",
"src": "5030:89:25",
"statements": [
{
"expression": {
"argumentTypes": null,
"components": [
{
"argumentTypes": null,
"id": 8688,
"name": "_TARGET_BASE_TOKEN_AMOUNT_",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9461,
"src": "5052:26:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 8689,
"name": "_TARGET_QUOTE_TOKEN_AMOUNT_",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9463,
"src": "5080:27:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"id": 8690,
"isConstant": false,
"isInlineArray": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "TupleExpression",
"src": "5051:57:25",
"typeDescriptions": {
"typeIdentifier": "t_tuple$_t_uint256_$_t_uint256_$",
"typeString": "tuple(uint256,uint256)"
}
},
"functionReturnParameters": 8674,
"id": 8691,
"nodeType": "Return",
"src": "5044:64:25"
}
]
}
}
]
},
"documentation": null,
"functionSelector": "ffa64225",
"id": 8733,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "getExpectedTarget",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 8669,
"nodeType": "ParameterList",
"parameters": [],
"src": "4845:2:25"
},
"returnParameters": {
"id": 8674,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 8671,
"mutability": "mutable",
"name": "baseTarget",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 8733,
"src": "4869:18:25",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 8670,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "4869:7:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 8673,
"mutability": "mutable",
"name": "quoteTarget",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 8733,
"src": "4889:19:25",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 8672,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "4889:7:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "4868:41:25"
},
"scope": 8853,
"src": "4819:679:25",
"stateMutability": "view",
"virtual": false,
"visibility": "public"
},
{
"body": {
"id": 8825,
"nodeType": "Block",
"src": "5566:737:25",
"statements": [
{
"assignments": [
8739,
8741
],
"declarations": [
{
"constant": false,
"id": 8739,
"mutability": "mutable",
"name": "baseTarget",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 8825,
"src": "5577:18:25",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 8738,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "5577:7:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 8741,
"mutability": "mutable",
"name": "quoteTarget",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 8825,
"src": "5597:19:25",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 8740,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "5597:7:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 8744,
"initialValue": {
"argumentTypes": null,
"arguments": [],
"expression": {
"argumentTypes": [],
"id": 8742,
"name": "getExpectedTarget",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8733,
"src": "5620:17:25",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$_t_uint256_$",
"typeString": "function () view returns (uint256,uint256)"
}
},
"id": 8743,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "5620:19:25",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$_t_uint256_$_t_uint256_$",
"typeString": "tuple(uint256,uint256)"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "5576:63:25"
},
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_enum$_RStatus_$11630",
"typeString": "enum Types.RStatus"
},
"id": 8749,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 8745,
"name": "_R_STATUS_",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9459,
"src": "5653:10:25",
"typeDescriptions": {
"typeIdentifier": "t_enum$_RStatus_$11630",
"typeString": "enum Types.RStatus"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 8746,
"name": "Types",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 11631,
"src": "5667:5:25",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_Types_$11631_$",
"typeString": "type(library Types)"
}
},
"id": 8747,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "RStatus",
"nodeType": "MemberAccess",
"referencedDeclaration": 11630,
"src": "5667:13:25",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_enum$_RStatus_$11630_$",
"typeString": "type(enum Types.RStatus)"
}
},
"id": 8748,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"memberName": "BELOW_ONE",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "5667:23:25",
"typeDescriptions": {
"typeIdentifier": "t_enum$_RStatus_$11630",
"typeString": "enum Types.RStatus"
}
},
"src": "5653:37:25",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": {
"id": 8823,
"nodeType": "Block",
"src": "6002:295:25",
"statements": [
{
"assignments": [
8788
],
"declarations": [
{
"constant": false,
"id": 8788,
"mutability": "mutable",
"name": "R",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 8823,
"src": "6016:9:25",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 8787,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "6016:7:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 8800,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 8796,
"name": "_BASE_BALANCE_",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9465,
"src": "6097:14:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 8793,
"name": "baseTarget",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8739,
"src": "6081:10:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"id": 8791,
"name": "baseTarget",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8739,
"src": "6066:10:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 8792,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "mul",
"nodeType": "MemberAccess",
"referencedDeclaration": 11478,
"src": "6066:14:25",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
"typeString": "function (uint256,uint256) pure returns (uint256)"
}
},
"id": 8794,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "6066:26:25",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 8795,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "div",
"nodeType": "MemberAccess",
"referencedDeclaration": 11499,
"src": "6066:30:25",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
"typeString": "function (uint256,uint256) pure returns (uint256)"
}
},
"id": 8797,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "6066:46:25",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 8798,
"name": "_BASE_BALANCE_",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9465,
"src": "6130:14:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"id": 8789,
"name": "DecimalMath",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 11078,
"src": "6028:11:25",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_DecimalMath_$11078_$",
"typeString": "type(library DecimalMath)"
}
},
"id": 8790,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "divFloor",
"nodeType": "MemberAccess",
"referencedDeclaration": 11059,
"src": "6028:20:25",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$",
"typeString": "function (uint256,uint256) pure returns (uint256)"
}
},
"id": 8799,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "6028:130:25",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "6016:142:25"
},
{
"expression": {
"argumentTypes": null,
"id": 8814,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 8801,
"name": "R",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8788,
"src": "6172:1:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 8810,
"name": "_K_",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9457,
"src": "6221:3:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 8811,
"name": "R",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8788,
"src": "6226:1:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"id": 8808,
"name": "DecimalMath",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 11078,
"src": "6205:11:25",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_DecimalMath_$11078_$",
"typeString": "type(library DecimalMath)"
}
},
"id": 8809,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "mul",
"nodeType": "MemberAccess",
"referencedDeclaration": 11023,
"src": "6205:15:25",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$",
"typeString": "function (uint256,uint256) pure returns (uint256)"
}
},
"id": 8812,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "6205:23:25",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 8805,
"name": "_K_",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9457,
"src": "6196:3:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 8802,
"name": "DecimalMath",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 11078,
"src": "6176:11:25",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_DecimalMath_$11078_$",
"typeString": "type(library DecimalMath)"
}
},
"id": 8803,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "ONE",
"nodeType": "MemberAccess",
"referencedDeclaration": 11006,
"src": "6176:15:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 8804,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sub",
"nodeType": "MemberAccess",
"referencedDeclaration": 11557,
"src": "6176:19:25",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
"typeString": "function (uint256,uint256) pure returns (uint256)"
}
},
"id": 8806,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "6176:24:25",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 8807,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "add",
"nodeType": "MemberAccess",
"referencedDeclaration": 11582,
"src": "6176:28:25",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
"typeString": "function (uint256,uint256) pure returns (uint256)"
}
},
"id": 8813,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "6176:53:25",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "6172:57:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 8815,
"nodeType": "ExpressionStatement",
"src": "6172:57:25"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [],
"expression": {
"argumentTypes": [],
"id": 8818,
"name": "getOraclePrice",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9550,
"src": "6266:14:25",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$",
"typeString": "function () view returns (uint256)"
}
},
"id": 8819,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "6266:16:25",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 8820,
"name": "R",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8788,
"src": "6284:1:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"id": 8816,
"name": "DecimalMath",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 11078,
"src": "6250:11:25",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_DecimalMath_$11078_$",
"typeString": "type(library DecimalMath)"
}
},
"id": 8817,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "mul",
"nodeType": "MemberAccess",
"referencedDeclaration": 11023,
"src": "6250:15:25",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$",
"typeString": "function (uint256,uint256) pure returns (uint256)"
}
},
"id": 8821,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "6250:36:25",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"functionReturnParameters": 8737,
"id": 8822,
"nodeType": "Return",
"src": "6243:43:25"
}
]
},
"id": 8824,
"nodeType": "IfStatement",
"src": "5649:648:25",
"trueBody": {
"id": 8786,
"nodeType": "Block",
"src": "5692:304:25",
"statements": [
{
"assignments": [
8751
],
"declarations": [
{
"constant": false,
"id": 8751,
"mutability": "mutable",
"name": "R",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 8786,
"src": "5706:9:25",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 8750,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "5706:7:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 8763,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 8759,
"name": "_QUOTE_BALANCE_",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9467,
"src": "5789:15:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 8756,
"name": "quoteTarget",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8741,
"src": "5772:11:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"id": 8754,
"name": "quoteTarget",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8741,
"src": "5756:11:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 8755,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "mul",
"nodeType": "MemberAccess",
"referencedDeclaration": 11478,
"src": "5756:15:25",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
"typeString": "function (uint256,uint256) pure returns (uint256)"
}
},
"id": 8757,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "5756:28:25",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 8758,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "div",
"nodeType": "MemberAccess",
"referencedDeclaration": 11499,
"src": "5756:32:25",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
"typeString": "function (uint256,uint256) pure returns (uint256)"
}
},
"id": 8760,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "5756:49:25",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 8761,
"name": "_QUOTE_BALANCE_",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9467,
"src": "5823:15:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"id": 8752,
"name": "DecimalMath",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 11078,
"src": "5718:11:25",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_DecimalMath_$11078_$",
"typeString": "type(library DecimalMath)"
}
},
"id": 8753,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "divFloor",
"nodeType": "MemberAccess",
"referencedDeclaration": 11059,
"src": "5718:20:25",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$",
"typeString": "function (uint256,uint256) pure returns (uint256)"
}
},
"id": 8762,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "5718:134:25",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "5706:146:25"
},
{
"expression": {
"argumentTypes": null,
"id": 8777,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 8764,
"name": "R",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8751,
"src": "5866:1:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 8773,
"name": "_K_",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9457,
"src": "5915:3:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 8774,
"name": "R",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8751,
"src": "5920:1:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"id": 8771,
"name": "DecimalMath",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 11078,
"src": "5899:11:25",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_DecimalMath_$11078_$",
"typeString": "type(library DecimalMath)"
}
},
"id": 8772,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "mul",
"nodeType": "MemberAccess",
"referencedDeclaration": 11023,
"src": "5899:15:25",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$",
"typeString": "function (uint256,uint256) pure returns (uint256)"
}
},
"id": 8775,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "5899:23:25",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 8768,
"name": "_K_",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9457,
"src": "5890:3:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 8765,
"name": "DecimalMath",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 11078,
"src": "5870:11:25",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_DecimalMath_$11078_$",
"typeString": "type(library DecimalMath)"
}
},
"id": 8766,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "ONE",
"nodeType": "MemberAccess",
"referencedDeclaration": 11006,
"src": "5870:15:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 8767,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sub",
"nodeType": "MemberAccess",
"referencedDeclaration": 11557,
"src": "5870:19:25",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
"typeString": "function (uint256,uint256) pure returns (uint256)"
}
},
"id": 8769,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "5870:24:25",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 8770,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "add",
"nodeType": "MemberAccess",
"referencedDeclaration": 11582,
"src": "5870:28:25",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
"typeString": "function (uint256,uint256) pure returns (uint256)"
}
},
"id": 8776,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "5870:53:25",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "5866:57:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 8778,
"nodeType": "ExpressionStatement",
"src": "5866:57:25"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [],
"expression": {
"argumentTypes": [],
"id": 8781,
"name": "getOraclePrice",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9550,
"src": "5965:14:25",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$",
"typeString": "function () view returns (uint256)"
}
},
"id": 8782,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "5965:16:25",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 8783,
"name": "R",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8751,
"src": "5983:1:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"id": 8779,
"name": "DecimalMath",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 11078,
"src": "5944:11:25",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_DecimalMath_$11078_$",
"typeString": "type(library DecimalMath)"
}
},
"id": 8780,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "divFloor",
"nodeType": "MemberAccess",
"referencedDeclaration": 11059,
"src": "5944:20:25",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$",
"typeString": "function (uint256,uint256) pure returns (uint256)"
}
},
"id": 8784,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "5944:41:25",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"functionReturnParameters": 8737,
"id": 8785,
"nodeType": "Return",
"src": "5937:48:25"
}
]
}
}
]
},
"documentation": null,
"functionSelector": "ee27c689",
"id": 8826,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "getMidPrice",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 8734,
"nodeType": "ParameterList",
"parameters": [],
"src": "5524:2:25"
},
"returnParameters": {
"id": 8737,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 8736,
"mutability": "mutable",
"name": "midPrice",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 8826,
"src": "5548:16:25",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 8735,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "5548:7:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "5547:18:25"
},
"scope": 8853,
"src": "5504:799:25",
"stateMutability": "view",
"virtual": false,
"visibility": "public"
},
{
"body": {
"id": 8851,
"nodeType": "Block",
"src": "6433:108:25",
"statements": [
{
"assignments": [
8838
],
"declarations": [
{
"constant": false,
"id": 8838,
"mutability": "mutable",
"name": "i",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 8851,
"src": "6443:9:25",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 8837,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "6443:7:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 8841,
"initialValue": {
"argumentTypes": null,
"arguments": [],
"expression": {
"argumentTypes": [],
"id": 8839,
"name": "getOraclePrice",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9550,
"src": "6455:14:25",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$",
"typeString": "function () view returns (uint256)"
}
},
"id": 8840,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "6455:16:25",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "6443:28:25"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 8844,
"name": "B0",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8828,
"src": "6515:2:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 8845,
"name": "B1",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8830,
"src": "6519:2:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 8846,
"name": "B2",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8832,
"src": "6523:2:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 8847,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8838,
"src": "6527:1:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 8848,
"name": "_K_",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9457,
"src": "6530:3:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"id": 8842,
"name": "DODOMath",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 10992,
"src": "6488:8:25",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_DODOMath_$10992_$",
"typeString": "type(library DODOMath)"
}
},
"id": 8843,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "_GeneralIntegrate",
"nodeType": "MemberAccess",
"referencedDeclaration": 10751,
"src": "6488:26:25",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$_t_uint256_$_t_uint256_$_t_uint256_$returns$_t_uint256_$",
"typeString": "function (uint256,uint256,uint256,uint256,uint256) pure returns (uint256)"
}
},
"id": 8849,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "6488:46:25",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"functionReturnParameters": 8836,
"id": 8850,
"nodeType": "Return",
"src": "6481:53:25"
}
]
},
"documentation": null,
"id": 8852,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "_RAboveIntegrate",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 8833,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 8828,
"mutability": "mutable",
"name": "B0",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 8852,
"src": "6344:10:25",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 8827,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "6344:7:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 8830,
"mutability": "mutable",
"name": "B1",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 8852,
"src": "6364:10:25",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 8829,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "6364:7:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 8832,
"mutability": "mutable",
"name": "B2",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 8852,
"src": "6384:10:25",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 8831,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "6384:7:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "6334:66:25"
},
"returnParameters": {
"id": 8836,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 8835,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 8852,
"src": "6424:7:25",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 8834,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "6424:7:25",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "6423:9:25"
},
"scope": 8853,
"src": "6309:232:25",
"stateMutability": "view",
"virtual": false,
"visibility": "internal"
}
],
"scope": 8854,
"src": "444:6425:25"
}
],
"src": "78:6792:25"
},
"compiler": {
"name": "solc",
"version": "0.6.9+commit.3e3065ac.Emscripten.clang"
},
"networks": {},
"schemaVersion": "3.2.3",
"updatedAt": "2020-11-06T08:03:35.692Z",
"devdoc": {
"author": "DODO Breeder",
"methods": {},
"title": "Pricing"
},
"userdoc": {
"methods": {},
"notice": "DODO Pricing model"
}
}