@omisego/omg-quasar-js
Version:
JavaScript Library to interact with OMG Network's Quasar
249 lines (248 loc) • 536 kB
JSON
{
"contractName": "QuasarPool",
"abi": [
{
"constant": true,
"inputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"name": "tokenData",
"outputs": [
{
"internalType": "address",
"name": "qTokenAddress",
"type": "address"
},
{
"internalType": "uint256",
"name": "exchangeRate",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "owedAmount",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "poolSupply",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "quasarFee",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "quasarMaintainer",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"name": "tokenUsableCapacity",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "address",
"name": "token",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "balance",
"type": "uint256"
}
],
"name": "QuasarTotalCapacityUpdated",
"type": "event"
},
{
"constant": false,
"inputs": [],
"name": "addEthCapacity",
"outputs": [],
"payable": true,
"stateMutability": "payable",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"internalType": "address",
"name": "token",
"type": "address"
},
{
"internalType": "uint256",
"name": "amount",
"type": "uint256"
}
],
"name": "addTokenCapacity",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"internalType": "address",
"name": "token",
"type": "address"
},
{
"internalType": "uint256",
"name": "amount",
"type": "uint256"
}
],
"name": "withdrawFunds",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"internalType": "address",
"name": "token",
"type": "address"
},
{
"internalType": "address",
"name": "qTokenContract",
"type": "address"
},
{
"internalType": "uint256",
"name": "quasarFee",
"type": "uint256"
}
],
"name": "registerQToken",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"internalType": "address",
"name": "token",
"type": "address"
},
{
"internalType": "uint256",
"name": "amount",
"type": "uint256"
}
],
"name": "repayOwedToken",
"outputs": [],
"payable": true,
"stateMutability": "payable",
"type": "function"
}
],
"metadata": "{\"compiler\":{\"version\":\"0.5.11+commit.c082d0b4\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"repayOwedToken\",\"outputs\":[],\"payable\":true,\"stateMutability\":\"payable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"tokenData\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"qTokenAddress\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"exchangeRate\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"owedAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"poolSupply\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"quasarFee\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"addTokenCapacity\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"quasarMaintainer\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[],\"name\":\"addEthCapacity\",\"outputs\":[],\"payable\":true,\"stateMutability\":\"payable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"qTokenContract\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"quasarFee\",\"type\":\"uint256\"}],\"name\":\"registerQToken\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"tokenUsableCapacity\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"withdrawFunds\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"balance\",\"type\":\"uint256\"}],\"name\":\"QuasarTotalCapacityUpdated\",\"type\":\"event\"}],\"devdoc\":{\"methods\":{\"addEthCapacity()\":{\"details\":\"Add Eth Liquid funds to the quasar\"},\"addTokenCapacity(address,uint256)\":{\"details\":\"Add ERC20 Liquid funds to the quasar\",\"params\":{\"amount\":\"value to supply\",\"token\":\"the token\"}},\"registerQToken(address,address,uint256)\":{\"details\":\"Register a token to be allowed, deploy qToken first\",\"params\":{\"qTokenContract\":\"the address of the qToken contract\",\"quasarFee\":\"amount (in token's denomination) to be used as a fee\",\"token\":\"the token\"}},\"repayOwedToken(address,uint256)\":{\"details\":\"Repay owed funds to the pool\",\"params\":{\"amount\":\"amount to repay\",\"token\":\"the token\"}},\"withdrawFunds(address,uint256)\":{\"details\":\"Withdraw funds from the contract\",\"params\":{\"amount\":\"amount (in number of qTokens) to withdraw\",\"token\":\"the token\"}}}},\"userdoc\":{\"methods\":{\"addEthCapacity()\":{\"notice\":\"Verify QToken contract before supplying\"},\"addTokenCapacity(address,uint256)\":{\"notice\":\"Verify QToken contract before supplying\"},\"registerQToken(address,address,uint256)\":{\"notice\":\"Higher decimal for erc20 preffered\"}}}},\"settings\":{\"compilationTarget\":{\"/Users/souradeep/Downloads/plasma-contracts/plasma_framework/contracts/poc/fast_exits/QuasarPool.sol\":\"QuasarPool\"},\"evmVersion\":\"petersburg\",\"libraries\":{},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"/Users/souradeep/Downloads/plasma-contracts/plasma_framework/contracts/poc/fast_exits/QuasarPool.sol\":{\"keccak256\":\"0x39b3a1a26cf7402d37d1297a188b6d2d6cb554058ddd1f74a6389e6caf59f7a0\",\"urls\":[\"bzz-raw://2d6fcf8cbcfd80d51b10dff2184707dd3a50c7cf8fbac2fe5f09dfa18a6f24ab\",\"dweb:/ipfs/QmYNNkRDD8WtvRKimBbQM99fjtaGwDeigasjy6cm54zogk\"]},\"/Users/souradeep/Downloads/plasma-contracts/plasma_framework/contracts/poc/fast_exits/interfaces/IQToken.sol\":{\"keccak256\":\"0x7b795043756f7d20b360eda5b6e076f5779ad14eea629608389726e870b29d24\",\"urls\":[\"bzz-raw://f43b19468588173d746130ead9d343007eda6a94600da00c9f06c6bde8c21ee5\",\"dweb:/ipfs/QmTwz3uWUmVLqNpPHBmkJZKZ3VU7nJ4k1vqfm5t9Nqi1a9\"]},\"/Users/souradeep/Downloads/plasma-contracts/plasma_framework/contracts/poc/fast_exits/utils/Exponential.sol\":{\"keccak256\":\"0x6b3c13c557c8ee2c9b8b60689a008dc82fd1764ace0677a43c7abc38e010d793\",\"urls\":[\"bzz-raw://7a37d55025f8bc4a0343e3a98bfa3d9acf4fa1dad8a61d02717e65f6c433e262\",\"dweb:/ipfs/QmX9Zwjxv6GTuVSrNJfSDZVRPea2MSv8UGxyoNiSnFKEFT\"]},\"/Users/souradeep/Downloads/plasma-contracts/plasma_framework/contracts/src/utils/SafeEthTransfer.sol\":{\"keccak256\":\"0xe707370228eea8c9c613472dd4d44df94ba631892bc74077cf5af24097944aad\",\"urls\":[\"bzz-raw://803b2c876f40f8d8dbcbca8b6cde233d73a98c4d2384c90e259da1c169225de9\",\"dweb:/ipfs/QmZkb1kHBmFb4jGgZepfAJsiZM6beQJiS9x319QZxExiB4\"]},\"openzeppelin-solidity/contracts/math/SafeMath.sol\":{\"keccak256\":\"0x4ccf2d7b51873db1ccfd54ca2adae5eac3b184f9699911ed4490438419f1c690\",\"urls\":[\"bzz-raw://d62d769b2219d5de39013093412623e624fa887f871826ea3bae6052ee893610\",\"dweb:/ipfs/QmV3yVktya1s617QmuzQR2CfuJgUi3dR2xEZY9ecmqZ2G1\"]},\"openzeppelin-solidity/contracts/token/ERC20/IERC20.sol\":{\"keccak256\":\"0x90e8c2521653bbb1768b05889c5760031e688d9cd361f167489b89215e201b95\",\"urls\":[\"bzz-raw://d0abb99bb8bfc2bc0a89902b8ed1dc0442ad08cc78cee64c291b3df6a27bcccc\",\"dweb:/ipfs/QmP5NaEwZthQeM2ESz4WTT3osrP7jhbvu7ocbttBi2JAw6\"]},\"openzeppelin-solidity/contracts/token/ERC20/SafeERC20.sol\":{\"keccak256\":\"0xf6f89424e17870561dc23c5933c55c5726b66a68d51ad2a2c00c569a5f02f507\",\"urls\":[\"bzz-raw://005657a7ffbf6d12726ac0167b55be965dc473d43f061b605f883a54cc00ab4f\",\"dweb:/ipfs/QmaBzyvDQyNnn6DXQYewEtN9Go85orikSnW9PwNWqUGPEX\"]},\"openzeppelin-solidity/contracts/utils/Address.sol\":{\"keccak256\":\"0xf3358e5819ca73357abd6c90bdfffd0474af54364897f6b3e3234c4b71fbe9a1\",\"urls\":[\"bzz-raw://75ae8d04454d1511a2ed986cc8585736f05c5c25280683b3d24712a9f414a4bf\",\"dweb:/ipfs/Qmb3kNCoBUZdah1AgBBD4zMk898j5Qw8ahT1w5cCMYp5Y3\"]}},\"version\":1}",
"bytecode": "0x608060405234801561001057600080fd5b5061130e806100206000396000f3fe60806040526004361061007b5760003560e01c80637cc8448e1161004e5780637cc8448e146101115780639069f192146101195780639132ccb214610139578063c1075329146101665761007b565b80630d4bf0701461008057806327e45c2c146100955780633c2568a9146100cf578063417a9726146100ef575b600080fd5b61009361008e366004610c58565b610186565b005b3480156100a157600080fd5b506100b56100b0366004610bed565b61023a565b6040516100c695949392919061110a565b60405180910390f35b3480156100db57600080fd5b506100936100ea366004610c58565b610274565b3480156100fb57600080fd5b5061010461029d565b6040516100c6919061109d565b6100936102ac565b34801561012557600080fd5b50610093610134366004610c0b565b6102b9565b34801561014557600080fd5b50610159610154366004610bed565b6103a4565b6040516100c69190611226565b34801561017257600080fd5b50610093610181366004610c58565b6103b6565b6001600160a01b03821661019b5750346101b6565b6101b66001600160a01b03831633308463ffffffff61064316565b6001600160a01b0382166000908152600260205260409020546101df908263ffffffff6106a416565b6001600160a01b038316600090815260026020818152604080842094909455600190529190200154610217908263ffffffff6106d216565b6001600160a01b0390921660009081526001602052604090206002019190915550565b6001602081905260009182526040909120805491810154600282015460038301546004909301546001600160a01b03909416939192909185565b61028f6001600160a01b03831633308463ffffffff61064316565b61029982826106fa565b5050565b6000546001600160a01b031681565b6102b76000346106fa565b565b6000546001600160a01b031633146102ec5760405162461bcd60e51b81526004016102e390611186565b60405180910390fd5b6001600160a01b0383811660009081526001602052604090205416156103245760405162461bcd60e51b81526004016102e3906111e6565b6040805160a0810182526001600160a01b03938416815266071afd498d00006020808301918252600083850181815260608501828152608086019788529888168252600192839052949020925183546001600160a01b03191696169590951782555193810193909355516002830155915160038201559051600490910155565b60026020526000908152604090205481565b6001600160a01b038083166000908152600160205260408082205490516370a0823160e01b815292169182906370a08231906103f69033906004016110ab565b60206040518083038186803b15801561040e57600080fd5b505afa158015610422573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506104469190810190610cb0565b9050808311156104685760405162461bcd60e51b81526004016102e3906111f6565b60408051602080820183526001600160a01b0387166000908152600191829052928320015481526104999085610899565b6001600160a01b0386166000908152600260205260409020549091508111156104d45760405162461bcd60e51b81526004016102e390611196565b6001600160a01b0385166000908152600260205260409020546104fd908263ffffffff6106d216565b6001600160a01b038616600090815260026020908152604080832093909355600190522060030154610535908263ffffffff6106d216565b6001600160a01b0380871660009081526001602052604090819020600301929092559051632770a7eb60e21b815290841690639dc29fac9061057d90339088906004016110b9565b600060405180830381600087803b15801561059757600080fd5b505af11580156105ab573d6000803e3d6000fd5b505050506001600160a01b0385166105cf576105ca33826108fc6108c0565b6105e9565b6105e96001600160a01b038616338363ffffffff6108ec16565b6001600160a01b038516600090815260026020526040908190205490517f295117b46583975aa628030f075db55be810827e0213ee4e1f8d02c1c7f16efd91610634918891906110fc565b60405180910390a15050505050565b60405161069e9085906323b872dd60e01b90610667908790879087906024016110d4565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152610913565b50505050565b6000828201838110156106c95760405162461bcd60e51b81526004016102e390611156565b90505b92915050565b6000828211156106f45760405162461bcd60e51b81526004016102e390611176565b50900390565b6001600160a01b03828116600090815260016020526040902054166107315760405162461bcd60e51b81526004016102e3906111c6565b6001600160a01b03821660009081526002602052604090205461075a908263ffffffff6106a416565b6001600160a01b038316600090815260026020908152604080832093909355600190522060030154610792908263ffffffff6106a416565b6001600160a01b03831660009081526001602081815260408084206003810195909555805191820190529201548252906107cd9083906109f8565b6001600160a01b03808516600090815260016020526040908190205490516340c10f1960e01b815292935016906340c10f199061081090339085906004016110b9565b600060405180830381600087803b15801561082a57600080fd5b505af115801561083e573d6000803e3d6000fd5b5050506001600160a01b038416600090815260026020526040908190205490517f295117b46583975aa628030f075db55be810827e0213ee4e1f8d02c1c7f16efd925061088c9186916110fc565b60405180910390a1505050565b60006108a3610bae565b6108ad8484610a0c565b90506108b881610a3f565b949350505050565b60006108cd848484610a4e565b90508061069e5760405162461bcd60e51b81526004016102e3906111b6565b60405161090e90849063a9059cbb60e01b9061066790869086906024016110fc565b505050565b610925826001600160a01b0316610aba565b6109415760405162461bcd60e51b81526004016102e390611216565b60006060836001600160a01b03168360405161095d9190611086565b6000604051808303816000865af19150503d806000811461099a576040519150601f19603f3d011682016040523d82523d6000602084013e61099f565b606091505b5091509150816109c15760405162461bcd60e51b81526004016102e390611166565b80511561069e57808060200190516109dc9190810190610c92565b61069e5760405162461bcd60e51b81526004016102e390611206565b6000610a02610bae565b6108ad8484610ac0565b610a14610bae565b8251600090610a29908463ffffffff610af216565b6040805160208101909152908152949350505050565b51670de0b6b3a7640000900490565b600080846001600160a01b03168385604051610a6990611092565b600060405180830381858888f193505050503d8060008114610aa7576040519150601f19603f3d011682016040523d82523d6000602084013e610aac565b606091505b5090925050505b9392505050565b3b151590565b610ac8610bae565b6000610ae2670de0b6b3a76400008563ffffffff610af216565b90506108b8818460000151610b2c565b600082610b01575060006106cc565b82820282848281610b0e57fe5b04146106c95760405162461bcd60e51b81526004016102e3906111d6565b610b34610bae565b6000610b4e84670de0b6b3a764000063ffffffff610af216565b90506000610b62828563ffffffff610b7916565b604080516020810190915290815295945050505050565b6000808211610b9a5760405162461bcd60e51b81526004016102e3906111a6565b6000828481610ba557fe5b04949350505050565b6040518060200160405280600081525090565b80356106cc816112a2565b80516106cc816112b9565b80356106cc816112c2565b80516106cc816112c2565b600060208284031215610bff57600080fd5b60006108b88484610bc1565b600080600060608486031215610c2057600080fd5b6000610c2c8686610bc1565b9350506020610c3d86828701610bc1565b9250506040610c4e86828701610bd7565b9150509250925092565b60008060408385031215610c6b57600080fd5b6000610c778585610bc1565b9250506020610c8885828601610bd7565b9150509250929050565b600060208284031215610ca457600080fd5b60006108b88484610bcc565b600060208284031215610cc257600080fd5b60006108b88484610be2565b610cd781611265565b82525050565b610cd781611246565b6000610cf182611234565b610cfb8185611238565b9350610d0b818560208601611276565b9290920192915050565b6000610d22601b8361123d565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000815260200192915050565b6000610d5b60208361123d565b7f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815260200192915050565b6000610d94601e8361123d565b7f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815260200192915050565b6000610dcd60318361123d565b7f4f6e6c792074686520517561736172204d61696e7461696e65722063616e20698152701b9d9bdad9481d1a1a5cc81b595d1a1bd9607a1b602082015260400192915050565b6000610e20602b8361123d565b7f416d6f756e742073686f756c64206265206c6f776572207468616e20636c616981526a6d61626c652066756e647360a81b602082015260400192915050565b6000610e6d601a8361123d565b7f536166654d6174683a206469766973696f6e206279207a65726f000000000000815260200192915050565b6000610ea660278361123d565b7f536166654574685472616e736665723a206661696c656420746f207472616e738152660cccae4408aa8960cb1b602082015260400192915050565b6000610eef60268361123d565b7f51546f6b656e206973206e6f74207265676973746572656420666f7220746865815265103a37b5b2b760d11b602082015260400192915050565b6000610f3760218361123d565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f8152607760f81b602082015260400192915050565b60006106cc600083611238565b6000610f8760238361123d565b7f51546f6b656e20666f722074686520746f6b656e20616c72656164792065786981526273747360e81b602082015260400192915050565b6000610fcc60198361123d565b7f4e6f7420656e6f7567682071546f6b656e2042616c616e636500000000000000815260200192915050565b6000611005602a8361123d565b7f5361666545524332303a204552433230206f7065726174696f6e20646964206e8152691bdd081cdd58d8d9595960b21b602082015260400192915050565b6000611051601f8361123d565b7f5361666545524332303a2063616c6c20746f206e6f6e2d636f6e747261637400815260200192915050565b610cd781611262565b6000610ab38284610ce6565b60006106cc82610f6d565b602081016106cc8284610cdd565b602081016106cc8284610cce565b604081016110c78285610cce565b610ab3602083018461107d565b606081016110e28286610cdd565b6110ef6020830185610cdd565b6108b8604083018461107d565b604081016110c78285610cdd565b60a081016111188288610cdd565b611125602083018761107d565b611132604083018661107d565b61113f606083018561107d565b61114c608083018461107d565b9695505050505050565b602080825281016106cc81610d15565b602080825281016106cc81610d4e565b602080825281016106cc81610d87565b602080825281016106cc81610dc0565b602080825281016106cc81610e13565b602080825281016106cc81610e60565b602080825281016106cc81610e99565b602080825281016106cc81610ee2565b602080825281016106cc81610f2a565b602080825281016106cc81610f7a565b602080825281016106cc81610fbf565b602080825281016106cc81610ff8565b602080825281016106cc81611044565b602081016106cc828461107d565b5190565b919050565b90815260200190565b60006106cc82611256565b151590565b6001600160a01b031690565b90565b60006106cc8260006106cc82611246565b60005b83811015611291578181015183820152602001611279565b8381111561069e5750506000910152565b6112ab81611246565b81146112b657600080fd5b50565b6112ab81611251565b6112ab8161126256fea365627a7a7231582033edb36afccbdb9d2f482c3a101b3803c4a5dc76dd8518233ceb4d117bd2b6956c6578706572696d656e74616cf564736f6c634300050b0040",
"deployedBytecode": "0x60806040526004361061007b5760003560e01c80637cc8448e1161004e5780637cc8448e146101115780639069f192146101195780639132ccb214610139578063c1075329146101665761007b565b80630d4bf0701461008057806327e45c2c146100955780633c2568a9146100cf578063417a9726146100ef575b600080fd5b61009361008e366004610c58565b610186565b005b3480156100a157600080fd5b506100b56100b0366004610bed565b61023a565b6040516100c695949392919061110a565b60405180910390f35b3480156100db57600080fd5b506100936100ea366004610c58565b610274565b3480156100fb57600080fd5b5061010461029d565b6040516100c6919061109d565b6100936102ac565b34801561012557600080fd5b50610093610134366004610c0b565b6102b9565b34801561014557600080fd5b50610159610154366004610bed565b6103a4565b6040516100c69190611226565b34801561017257600080fd5b50610093610181366004610c58565b6103b6565b6001600160a01b03821661019b5750346101b6565b6101b66001600160a01b03831633308463ffffffff61064316565b6001600160a01b0382166000908152600260205260409020546101df908263ffffffff6106a416565b6001600160a01b038316600090815260026020818152604080842094909455600190529190200154610217908263ffffffff6106d216565b6001600160a01b0390921660009081526001602052604090206002019190915550565b6001602081905260009182526040909120805491810154600282015460038301546004909301546001600160a01b03909416939192909185565b61028f6001600160a01b03831633308463ffffffff61064316565b61029982826106fa565b5050565b6000546001600160a01b031681565b6102b76000346106fa565b565b6000546001600160a01b031633146102ec5760405162461bcd60e51b81526004016102e390611186565b60405180910390fd5b6001600160a01b0383811660009081526001602052604090205416156103245760405162461bcd60e51b81526004016102e3906111e6565b6040805160a0810182526001600160a01b03938416815266071afd498d00006020808301918252600083850181815260608501828152608086019788529888168252600192839052949020925183546001600160a01b03191696169590951782555193810193909355516002830155915160038201559051600490910155565b60026020526000908152604090205481565b6001600160a01b038083166000908152600160205260408082205490516370a0823160e01b815292169182906370a08231906103f69033906004016110ab565b60206040518083038186803b15801561040e57600080fd5b505afa158015610422573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506104469190810190610cb0565b9050808311156104685760405162461bcd60e51b81526004016102e3906111f6565b60408051602080820183526001600160a01b0387166000908152600191829052928320015481526104999085610899565b6001600160a01b0386166000908152600260205260409020549091508111156104d45760405162461bcd60e51b81526004016102e390611196565b6001600160a01b0385166000908152600260205260409020546104fd908263ffffffff6106d216565b6001600160a01b038616600090815260026020908152604080832093909355600190522060030154610535908263ffffffff6106d216565b6001600160a01b0380871660009081526001602052604090819020600301929092559051632770a7eb60e21b815290841690639dc29fac9061057d90339088906004016110b9565b600060405180830381600087803b15801561059757600080fd5b505af11580156105ab573d6000803e3d6000fd5b505050506001600160a01b0385166105cf576105ca33826108fc6108c0565b6105e9565b6105e96001600160a01b038616338363ffffffff6108ec16565b6001600160a01b038516600090815260026020526040908190205490517f295117b46583975aa628030f075db55be810827e0213ee4e1f8d02c1c7f16efd91610634918891906110fc565b60405180910390a15050505050565b60405161069e9085906323b872dd60e01b90610667908790879087906024016110d4565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152610913565b50505050565b6000828201838110156106c95760405162461bcd60e51b81526004016102e390611156565b90505b92915050565b6000828211156106f45760405162461bcd60e51b81526004016102e390611176565b50900390565b6001600160a01b03828116600090815260016020526040902054166107315760405162461bcd60e51b81526004016102e3906111c6565b6001600160a01b03821660009081526002602052604090205461075a908263ffffffff6106a416565b6001600160a01b038316600090815260026020908152604080832093909355600190522060030154610792908263ffffffff6106a416565b6001600160a01b03831660009081526001602081815260408084206003810195909555805191820190529201548252906107cd9083906109f8565b6001600160a01b03808516600090815260016020526040908190205490516340c10f1960e01b815292935016906340c10f199061081090339085906004016110b9565b600060405180830381600087803b15801561082a57600080fd5b505af115801561083e573d6000803e3d6000fd5b5050506001600160a01b038416600090815260026020526040908190205490517f295117b46583975aa628030f075db55be810827e0213ee4e1f8d02c1c7f16efd925061088c9186916110fc565b60405180910390a1505050565b60006108a3610bae565b6108ad8484610a0c565b90506108b881610a3f565b949350505050565b60006108cd848484610a4e565b90508061069e5760405162461bcd60e51b81526004016102e3906111b6565b60405161090e90849063a9059cbb60e01b9061066790869086906024016110fc565b505050565b610925826001600160a01b0316610aba565b6109415760405162461bcd60e51b81526004016102e390611216565b60006060836001600160a01b03168360405161095d9190611086565b6000604051808303816000865af19150503d806000811461099a576040519150601f19603f3d011682016040523d82523d6000602084013e61099f565b606091505b5091509150816109c15760405162461bcd60e51b81526004016102e390611166565b80511561069e57808060200190516109dc9190810190610c92565b61069e5760405162461bcd60e51b81526004016102e390611206565b6000610a02610bae565b6108ad8484610ac0565b610a14610bae565b8251600090610a29908463ffffffff610af216565b6040805160208101909152908152949350505050565b51670de0b6b3a7640000900490565b600080846001600160a01b03168385604051610a6990611092565b600060405180830381858888f193505050503d8060008114610aa7576040519150601f19603f3d011682016040523d82523d6000602084013e610aac565b606091505b5090925050505b9392505050565b3b151590565b610ac8610bae565b6000610ae2670de0b6b3a76400008563ffffffff610af216565b90506108b8818460000151610b2c565b600082610b01575060006106cc565b82820282848281610b0e57fe5b04146106c95760405162461bcd60e51b81526004016102e3906111d6565b610b34610bae565b6000610b4e84670de0b6b3a764000063ffffffff610af216565b90506000610b62828563ffffffff610b7916565b604080516020810190915290815295945050505050565b6000808211610b9a5760405162461bcd60e51b81526004016102e3906111a6565b6000828481610ba557fe5b04949350505050565b6040518060200160405280600081525090565b80356106cc816112a2565b80516106cc816112b9565b80356106cc816112c2565b80516106cc816112c2565b600060208284031215610bff57600080fd5b60006108b88484610bc1565b600080600060608486031215610c2057600080fd5b6000610c2c8686610bc1565b9350506020610c3d86828701610bc1565b9250506040610c4e86828701610bd7565b9150509250925092565b60008060408385031215610c6b57600080fd5b6000610c778585610bc1565b9250506020610c8885828601610bd7565b9150509250929050565b600060208284031215610ca457600080fd5b60006108b88484610bcc565b600060208284031215610cc257600080fd5b60006108b88484610be2565b610cd781611265565b82525050565b610cd781611246565b6000610cf182611234565b610cfb8185611238565b9350610d0b818560208601611276565b9290920192915050565b6000610d22601b8361123d565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000815260200192915050565b6000610d5b60208361123d565b7f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815260200192915050565b6000610d94601e8361123d565b7f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815260200192915050565b6000610dcd60318361123d565b7f4f6e6c792074686520517561736172204d61696e7461696e65722063616e20698152701b9d9bdad9481d1a1a5cc81b595d1a1bd9607a1b602082015260400192915050565b6000610e20602b8361123d565b7f416d6f756e742073686f756c64206265206c6f776572207468616e20636c616981526a6d61626c652066756e647360a81b602082015260400192915050565b6000610e6d601a8361123d565b7f536166654d6174683a206469766973696f6e206279207a65726f000000000000815260200192915050565b6000610ea660278361123d565b7f536166654574685472616e736665723a206661696c656420746f207472616e738152660cccae4408aa8960cb1b602082015260400192915050565b6000610eef60268361123d565b7f51546f6b656e206973206e6f74207265676973746572656420666f7220746865815265103a37b5b2b760d11b602082015260400192915050565b6000610f3760218361123d565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f8152607760f81b602082015260400192915050565b60006106cc600083611238565b6000610f8760238361123d565b7f51546f6b656e20666f722074686520746f6b656e20616c72656164792065786981526273747360e81b602082015260400192915050565b6000610fcc60198361123d565b7f4e6f7420656e6f7567682071546f6b656e2042616c616e636500000000000000815260200192915050565b6000611005602a8361123d565b7f5361666545524332303a204552433230206f7065726174696f6e20646964206e8152691bdd081cdd58d8d9595960b21b602082015260400192915050565b6000611051601f8361123d565b7f5361666545524332303a2063616c6c20746f206e6f6e2d636f6e747261637400815260200192915050565b610cd781611262565b6000610ab38284610ce6565b60006106cc82610f6d565b602081016106cc8284610cdd565b602081016106cc8284610cce565b604081016110c78285610cce565b610ab3602083018461107d565b606081016110e28286610cdd565b6110ef6020830185610cdd565b6108b8604083018461107d565b604081016110c78285610cdd565b60a081016111188288610cdd565b611125602083018761107d565b611132604083018661107d565b61113f606083018561107d565b61114c608083018461107d565b9695505050505050565b602080825281016106cc81610d15565b602080825281016106cc81610d4e565b602080825281016106cc81610d87565b602080825281016106cc81610dc0565b602080825281016106cc81610e13565b602080825281016106cc81610e60565b602080825281016106cc81610e99565b602080825281016106cc81610ee2565b602080825281016106cc81610f2a565b602080825281016106cc81610f7a565b602080825281016106cc81610fbf565b602080825281016106cc81610ff8565b602080825281016106cc81611044565b602081016106cc828461107d565b5190565b919050565b90815260200190565b60006106cc82611256565b151590565b6001600160a01b031690565b90565b60006106cc8260006106cc82611246565b60005b83811015611291578181015183820152602001611279565b8381111561069e5750506000910152565b6112ab81611246565b81146112b657600080fd5b50565b6112ab81611251565b6112ab8161126256fea365627a7a7231582033edb36afccbdb9d2f482c3a101b3803c4a5dc76dd8518233ceb4d117bd2b6956c6578706572696d656e74616cf564736f6c634300050b0040",
"sourceMap": "368:4600:47:-;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;368:4600:47;;;;;;;",
"deployedSourceMap": "368:4600:47:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4556:410;;;;;;;;;:::i;:::-;;965:43;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;965:43:47;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;1531:183;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;1531:183:47;;;;;;;;:::i;644:31::-;;8:9:-1;5:2;;;30:1;27;20:12;5:2;644:31:47;;;:::i;:::-;;;;;;;;1255:92;;;:::i;4109:318::-;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;4109:318:47;;;;;;;;:::i;1014:55::-;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;1014:55:47;;;;;;;;:::i;:::-;;;;;;;;2683:1128;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;2683:1128:47;;;;;;;;:::i;4556:410::-;-1:-1:-1;;;;;4640:19:47;;4636:164;;-1:-1:-1;4684:9:47;4636:164;;;4724:65;-1:-1:-1;;;;;4724:30:47;;4755:10;4775:4;4782:6;4724:65;:30;:65;:::i;:::-;-1:-1:-1;;;;;4839:26:47;;;;;;:19;:26;;;;;;:38;;4870:6;4839:38;:30;:38;:::i;:::-;-1:-1:-1;;;;;4810:26:47;;;;;;:19;:26;;;;;;;;:67;;;;4917:9;:16;;;;;:27;;:39;;4949:6;4917:39;:31;:39;:::i;:::-;-1:-1:-1;;;;;4887:16:47;;;;;;;:9;:16;;;;;:27;;:69;;;;-1:-1:-1;4556:410:47:o;965:43::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;965:43:47;;;;;;;;;:::o;1531:183::-;1605:65;-1:-1:-1;;;;;1605:30:47;;1636:10;1656:4;1663:6;1605:65;:30;:65;:::i;:::-;1681:26;1693:5;1700:6;1681:11;:26::i;:::-;1531:183;;:::o;644:31::-;;;-1:-1:-1;;;;;644:31:47;;:::o;1255:92::-;1306:34;1326:1;1330:9;1306:11;:34::i;:::-;1255:92::o;4109:318::-;867:16;;-1:-1:-1;;;;;867:16:47;853:10;:30;845:92;;;;-1:-1:-1;;;845:92:47;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;4239:16:47;;;4281:1;4239:16;;;:9;:16;;;;;:30;;:44;4231:92;;;;-1:-1:-1;;;4231:92:47;;;;;;;;;4352:68;;;;;;;;-1:-1:-1;;;;;4352:68:47;;;;;792:4;4352:68;;;;;;;-1:-1:-1;4352:68:47;;;;;;;;;;;;;;;;;;4333:16;;;;;:9;:16;;;;;;;:87;;;;-1:-1:-1;;;;;;4333:87:47;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4109:318::o;1014:55::-;;;;;;;;;;;;;:::o;2683:1128::-;-1:-1:-1;;;;;2771:16:47;;;2754:14;2771:16;;;:9;:16;;;;;;:30;2835:36;;-1:-1:-1;;;2835:36:47;;2771:30;;;;;2835:24;;:36;;2860:10;;2835:36;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;2835:36:47;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;2835:36:47;;;;;;;101:4:-1;97:9;90:4;84;80:15;76:31;69:5;65:43;126:6;120:4;113:20;0:138;2835:36:47;;;;;;;;;2811:60;;2899:13;2889:6;:23;;2881:61;;;;-1:-1:-1;;;2881:61:47;;;;;;;;;3059:46;;;;;;;;;-1:-1:-1;;;;;3074:16:47;;3001:25;3074:16;;;:9;:16;;;;;;;:29;;3059:46;;3029:85;;3107:6;3029:29;:85::i;:::-;-1:-1:-1;;;;;3153:26:47;;;;;;:19;:26;;;;;;3001:113;;-1:-1:-1;3132:47:47;;;3124:103;;;;-1:-1:-1;;;3124:103:47;;;;;;;;;-1:-1:-1;;;;;3267:26:47;;;;;;:19;:26;;;;;;:49;;3298:17;3267:49;:30;:49;:::i;:::-;-1:-1:-1;;;;;3238:26:47;;;;;;:19;:26;;;;;;;;:78;;;;3356:9;:16;;;:27;;;:50;;3388:17;3356:50;:31;:50;:::i;:::-;-1:-1:-1;;;;;3326:16:47;;;;;;;:9;:16;;;;;;;:27;;:80;;;;3453:40;;-1:-1:-1;;;3453:40:47;;:20;;;;;;:40;;3474:10;;3486:6;;3453:40;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;3453:40:47;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;-1:-1;;;;;;;;;3508:19:47;;3504:224;;3543:86;3581:10;3593:17;726:4;3543:37;:86::i;:::-;3504:224;;;3660:57;-1:-1:-1;;;;;3660:26:47;;3687:10;3699:17;3660:57;:26;:57;:::i;:::-;-1:-1:-1;;;;;3777:26:47;;;;;;:19;:26;;;;;;;;3743:61;;;;;;3770:5;;3777:26;3743:61;;;;;;;;;;2683:1128;;;;;:::o;842:202:123:-;968:68;;942:95;;961:5;;-1:-1:-1;;;991:27:123;968:68;;1020:4;;1026:2;;1030:5;;968:68;;;;;;;;-1:-1:-1;;26:21;;;22:32;6:49;;968:68:123;;;49:4:-1;25:18;;61:17;;-1:-1;;;;;182:15;-1:-1;;;;;;968:68:123;;;179:29:-1;;;;160:49;;;942:18:123;:95::i;:::-;842:202;;;;:::o;834:176:117:-;892:7;923:5;;;946:6;;;;938:46;;;;-1:-1:-1;;;938:46:117;;;;;;;;;1002:1;-1:-1:-1;834:176:117;;;;;:::o;1274:179::-;1332:7;1364:1;1359;:6;;1351:49;;;;-1:-1:-1;;;1351:49:117;;;;;;;;;-1:-1:-1;1422:5:117;;;1274:179::o;1872:652:47:-;-1:-1:-1;;;;;1950:16:47;;;1992:1;1950:16;;;:9;:16;;;;;:30;;1942:95;;;;-1:-1:-1;;;1942:95:47;;;;;;;;;-1:-1:-1;;;;;2077:26:47;;;;;;:19;:26;;;;;;:38;;2108:6;2077:38;:30;:38;:::i;:::-;-1:-1:-1;;;;;2048:26:47;;;;;;:19;:26;;;;;;;;:67;;;;2155:9;:16;;;:27;;;:39;;2187:6;2155:39;:31;:39;:::i;:::-;-1:-1:-1;;;;;2125:16:47;;;;;;:9;:16;;;;;;;;:27;;;:69;;;;2309:46;;;;;;;2324:29;;;2309:46;;2125:16;2266:90;;2301:6;;2266:34;:90::i;:::-;-1:-1:-1;;;;;2374:16:47;;;;;;;:9;:16;;;;;;;:30;2366:74;;-1:-1:-1;;;2366:74:47;;2239:117;;-1:-1:-1;2374:30:47;;2366:44;;:74;;2411:10;;2239:117;;2366:74;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;2366:74:47;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;-1:-1;;;;;;;;2490:26:47;;;;;;:19;:26;;;;;;;;2456:61;;;;-1:-1:-1;2456:61:47;;2483:5;;2456:61;;;;;;;;;;1872:652;;;:::o;1029:181:49:-;1109:4;1125:18;;:::i;:::-;1146:20;1156:1;1159:6;1146:9;:20::i;:::-;1125:41;;1185:17;1194:7;1185:8;:17::i;:::-;1177:26;1029:181;-1:-1:-1;;;;1029:181:49:o;824:265:102:-;948:12;963:50;984:8;994:6;1002:10;963:20;:50::i;:::-;948:65;;1031:7;1023:59;;;;-1:-1:-1;;;1023:59:102;;;;;;;;662:174:123;770:58;;744:85;;763:5;;-1:-1:-1;;;793:23:123;770:58;;818:2;;822:5;;770:58;;;;744:85;662:174;;;:::o;2621:1095::-;3216:27;3224:5;-1:-1:-1;;;;;3216:25:123;;:27::i;:::-;3208:71;;;;-1:-1:-1;;;3208:71:123;;;;;;;;;3350:12;3364:23;3399:5;-1:-1:-1;;;;;3391:19:123;3411:4;3391:25;;;;;;;;;;;;;;;;;;;;;;;14:1:-1;21;16:31;;;;75:4;69:11;64:16;;144:4;140:9;133:4;115:16;111:27;107:43;104:1;100:51;94:4;87:65;169:16;166:1;159:27;225:16;222:1;215:4;212:1;208:12;193:49;7:242;;16:31;36:4;31:9;;7:242;;3349:67:123;;;;3434:7;3426:52;;;;-1:-1:-1;;;3426:52:123;;;;;;;;;3493:17;;:21;3489:221;;3633:10;3622:30;;;;;;;;;;;;;;3614:85;;;;-1:-1:-1;;;3614:85:123;;;;;;;;1601:202:49;1689:4;1705:19;;:::i;:::-;1727:31;1742:6;1750:7;1727:14;:31::i;722:199::-;794:10;;:::i;:::-;841;;816:22;;841;;856:6;841:22;:14;:22;:::i;:::-;882:31;;;;;;;;;;;;;722:199;-1:-1:-1;;;;722:199:49:o;1956:111::-;2036:12;247:4;2036:24;;;1956:111::o;1610:243:102:-;1736:4;1757:12;1775:8;-1:-1:-1;;;;;1775:13:102;1793:10;1811:6;1775:47;;;;;;;;;;;;;;;;;;;;;;;;14:1:-1;21;16:31;;;;75:4;69:11;64:16;;144:4;140:9;133:4;115:16;111:27;107:43;104:1;100:51;94:4;87:65;169:16;166:1;159:27;225:16;222:1;215:4;212:1;208:12;193:49;7:242;;16:31;36:4;31:9;;7:242;-1:-1;1756:66:102;;-1:-1:-1;;;1610:243:102;;;;;;:::o;542:413:132:-;902:20;940:8;;;542:413::o;1292:203:49:-;1375:10;;:::i;:::-;1397:14;1414:21;247:4;1428:6;1414:21;:13;:21;:::i;:::-;1397:38;;1453:35;1460:9;1471:7;:16;;;1453:6;:35::i;1693:458:117:-;1751:7;1991:6;1987:45;;-1:-1:-1;2020:1:117;2013:8;;1987:45;2054:5;;;2058:1;2054;:5;:1;2077:5;;;;;:10;2069:56;;;;-1:-1:-1;;;2069:56:117;;;;;;;;397:241:49;464:10;;:::i;:::-;486:23;512:18;:3;247:4;512:18;:7;:18;:::i;:::-;486:44;-1:-1:-1;541:16:49;560:26;486:44;580:5;560:26;:19;:26;:::i;:::-;605:25;;;;;;;;;;;;;397:241;-1:-1:-1;;;;;397:241:49:o;2606:326:117:-;2664:7;2761:1;2757;:5;2749:44;;;;-1:-1:-1;;;2749:44:117;;;;;;;;;2803:9;2819:1;2815;:5;;;;;;;2606:326;-1:-1:-1;;;;2606:326:117:o;368:4600:47:-;;;;;;;;;;;;;;:::o;5:130:-1:-;72:20;;97:33;72:20;97:33;;142:128;217:13;;235:30;217:13;235:30;;277:130;344:20;;369:33;344:20;369:33;;414:134;492:13;;510:33;492:13;510:33;;555:241;;659:2;647:9;638:7;634:23;630:32;627:2;;;675:1;672;665:12;627:2;710:1;727:53;772:7;752:9;727:53;;803:491;;;;941:2;929:9;920:7;916:23;912:32;909:2;;;957:1;954;947:12;909:2;992:1;1009:53;1054:7;1034:9;1009:53;;;999:63;;971:97;1099:2;1117:53;1162:7;1153:6;1142:9;1138:22;1117:53;;;1107:63;;1078:98;1207:2;1225:53;1270:7;1261:6;1250:9;1246:22;1225:53;;;1215:63;;1186:98;903:391;;;;;;1301:366;;;1422:2;1410:9;1401:7;1397:23;1393:32;1390:2;;;1438:1;1435;1428:12;1390:2;1473:1;1490:53;1535:7;1515:9;1490:53;;;1480:63;;1452:97;1580:2;1598:53;1643:7;1634:6;1623:9;1619:22;1598:53;;;1588:63;;1559:98;1384:283;;;;;;1674:257;;1786:2;1774:9;1765:7;1761:23;1757:32;1754:2;;;1802:1;1799;1792:12;1754:2;1837:1;1854:61;1907:7;1887:9;1854:61;;1938:263;;2053:2;2041:9;2032:7;2028:23;2024:32;2021:2;;;2069:1;2066;2059:12;2021:2;2104:1;2121:64;2177:7;2157:9;2121:64;;2208:142;2299:45;2338:5;2299:45;;;2294:3;2287:58;2281:69;;;2357:113;2440:24;2458:5;2440:24;;2477:356;;2605:38;2637:5;2605:38;;;2655:88;2736:6;2731:3;2655:88;;;2648:95;;2748:52;2793:6;2788:3;2781:4;2774:5;2770:16;2748:52;;;2812:16;;;;;2585:248;-1:-1;;2585:248;2841:364;;3001:67;3065:2;3060:3;3001:67;;;3101:66;3081:87;;3196:2;3187:12;;2987:218;-1:-1;;2987:218;3214:364;;3374:67;3438:2;3433:3;3374:67;;;3474:66;3454:87;;3569:2;3560:12;;3360:218;-1:-1;;3360:218;3587:364;;3747:67;3811:2;3806:3;3747:67;;;3847:66;3827:87;;3942:2;3933:12;;3733:218;-1:-1;;3733:218;3960:465;;4120:67;4184:2;4179:3;4120:67;;;4220:66;4200:87;;-1:-1;;;4316:2;4307:12;;4300:88;4416:2;4407:12;;4106:319;-1:-1;;4106:319;4434:465;;4594:67;4658:2;4653:3;4594:67;;;4694:66;4674:87;;-1:-1;;;4790:2;4781:12;;4774:88;4890:2;4881:12;;4580:319;-1:-1;;4580:319;4908:364;;5068:67;5132:2;5127:3;5068:67;;;5168:66;5148:87;;5263:2;5254:12;;5054:218;-1:-1;;5054:218;5281:465;;5441:67;5505:2;5500:3;5441:67;;;5541:66;5521:87;;-1:-1;;;5637:2;5628:12;;5621:88;5737:2;5728:12;;5427:319;-1:-1;;5427:319;5755:465;;5915:67;5979:2;5974:3;5915:67;;;6015:66;5995:87;;-1:-1;;;6111:2;6102:12;;6095:88;6211:2;6202:12;;5901:319;-1:-1;;5901:319;6229:465;;6389:67;6453:2;6448:3;6389:67;;;6489:66;6469:87;;-1:-1;;;6585:2;6576:12;;6569:88;6685:2;6676:12;;6375:319;-1:-1;;6375:319;6703:296;;6880:83;6961:1;6956:3;6880:83;;7008:465;;7168:67;7232:2;7227:3;7168:67;;;7268:66;7248:87;;-1:-1;;;7364:2;7355:12;;7348:88;7464:2;7455:12;;7154:319;-1:-1;;7154:319;7482:364;;7642:67;7706:2;7701:3;7642:67;;;7742:66;7722:87;;7837:2;7828:12;;7628:218;-1:-1;;7628:218;7855:465;;8015:67;8079:2;8074:3;8015:67;;;8115:66;8095:87;;-1:-1;;;8211:2;8202:12;;8195:88;8311:2;8302:12;;8001:319;-1:-1;;8001:319;8329:364;;8489:67;8553:2;8548:3;8489:67;;;8589:66;8569:87;;8684:2;8675:12;;8475:218;-1:-1;;8475:218;8701:113;8784:24;8802:5;8784:24;;8821:262;;8965:93;9054:3;9045:6;8965:93;;9090:370;;9288:147;9431:3;9288:147;;9467:213;9585:2;9570:18;;9599:71;9574:9;9643:6;9599:71;;9687:229;9813:2;9798:18;;9827:79;9802:9;9879:6;9827:79;;9923:340;10077:2;10062:18;;10091:79;10066:9;10143:6;10091:79;;;10181:72;10249:2;10238:9;10234:18;10225:6;10181:72;;10270:435;10444:2;10429:18;;10458:71;10433:9;10502:6;10458:71;;;10540:72;10608:2;10597:9;10593:18;10584:6;10540:72;;;10623;10691:2;10680:9;10676:18;10667:6;10623:72;;10712:324;10858:2;10843:18;;10872:71;10847:9;10916:6;10872:71;;11043:659;11273:3;11258:19;;11288:71;11262:9;11332:6;11288:71;;;11370:72;11438:2;11427:9;11423:18;11414:6;11370:72;;;11453;11521:2;11510:9;11506:18;11497:6;11453:72;;;11536;11604:2;11593:9;11589:18;11580:6;11536:72;;;11619:73;11687:3;11676:9;11672:19;11663:6;11619:73;;;11244:458;;;;;;;;;11709:407;11900:2;11914:47;;;11885:18;;11975:131;11885:18;11975:131;;12123:407;12314:2;12328:47;;;12299:18;;12389:131;12299:18;12389:131;;12537:407;12728:2;12742:47;;;12713:18;;12803:131;12713:18;12803:131;;12951:407;13142:2;13156:47;;;13127:18;;13217:131;13127:18;13217:131;;13365:407;13556:2;13570:47;;;13541:18;;13631:131;13541:18;13631:131;;13779:407;13970:2;13984:47;;;13955:18;;14045:131;13955:18;14045:131;;14193:407;14384:2;14398:47;;;14369:18;;14459:131;14369:18;14459:131;;14607:407;14798:2;14812:47;;;14783:18;;14873:131;14783:18;14873:131;;15021:407;15212:2;15226:47;;;15197:18;;15287:131;15197:18;15287:131;;15435:407;15626:2;15640:47;;;15611:18;;15701:131;15611:18;15701:131;;15849:407;16040:2;16054:47;;;16025:18;;16115:131;16025:18;16115:131;;16263:407;16454:2;16468:47;;;16439:18;;16529:131;16439:18;16529:131;;16677:407;16868:2;16882:47;;;16853:18;;16943:131;16853:18;16943:131;;17091:213;17209:2;17194:18;;17223:71;17198:9;17267:6;17223:71;;17311:121;17398:12;;17369:63;17440:144;17575:3;17553:31;-1:-1;17553:31;17593:163;17696:19;;;17745:4;17736:14;;17689:67;17764:91;;17826:24;17844:5;17826:24;;17862:85;17928:13;17921:21;;17904:43;17954:121;-1:-1;;;;;18016:54;;17999:76;18082:72;18144:5;18127:27;18161:129;;18248:37;18279:5;18297:121;18376:37;18407:5;18376:37;;18541:268;18606:1;18613:101;18627:6;18624:1;18621:13;18613:101;;;18694:11;;;18688:18;18675:11;;;18668:39;18649:2;18642:10;18613:101;;;18729:6;18726:1;18723:13;18720:2;;;-1:-1;;18794:1;18776:16;;18769:27;18590:219;18817:117;18886:24;18904:5;18886:24;;;18879:5;18876:35;18866:2;;18925:1;18922;18915:12;18866:2;18860:74;;18941:111;19007:21;19022:5;19007:21;;19059:117;19128:24;19146:5;19128:24;",
"source": "pragma solidity 0.5.11;\npragma experimental ABIEncoderV2;\n\nimport \"../../src/utils/SafeEthTransfer.sol\";\nimport \"./utils/Exponential.sol\";\nimport \"./interfaces/IQToken.sol\";\nimport \"openzeppelin-solidity/contracts/math/SafeMath.sol\";\nimport \"openzeppelin-solidity/contracts/token/ERC20/IERC20.sol\";\nimport \"openzeppelin-solidity/contracts/token/ERC20/SafeERC20.sol\";\n\ncontract QuasarPool is Exponential {\n using SafeMath for uint256;\n using SafeERC20 for IERC20;\n\n struct Token {\n address qTokenAddress;\n uint256 exchangeRate;\n uint256 owedAmount;\n uint256 poolSupply;\n uint256 quasarFee;\n }\n\n address public quasarMaintainer;\n uint256 constant internal SAFE_GAS_STIPEND = 2300;\n uint256 constant private INITIAL_EXCHANGE_RATE_SCALED = 2e15;\n\n modifier onlyQuasarMaintainer() {\n require(msg.sender == quasarMaintainer, \"Only the Quasar Maintainer can invoke this method\");\n _;\n }\n \n mapping (address => Token) public tokenData;\n mapping (address => uint256) public tokenUsableCapacity;\n event QuasarTotalCapacityUpdated(address token, uint256 balance);\n\n /**\n * Verify QToken contract before supplying\n * @dev Add Eth Liquid funds to the quasar\n */\n function addEthCapacity() public payable {\n mintQTokens(address(0), msg.value);\n }\n\n /**\n * Verify QToken contract before supplying\n * @dev Add ERC20 Liquid funds to the quasar\n * @param token the token\n * @param amount value to supply\n */\n function addTokenCapacity(address token, uint256 amount) public {\n IERC20(token).safeTransferFrom(msg.sender, address(this), amount);\n\n mintQTokens(token, amount);\n }\n\n /**\n * @dev Internal function, determine and mint tokens for supplier\n * @param token the token\n * @param amount value to supply\n */\n function mintQTokens(address token, uint256 amount) private {\n require(tokenData[token].qTokenAddress != address(0), \"QToken is not registered for the token\");\n\n tokenUsableCapacity[token] = tokenUsableCapacity[token].add(amount);\n tokenData[token].poolSupply = tokenData[token].poolSupply.add(amount);\n\n // derive qTokens to mint\n uint256 qTokenMintAmount = Exponential.divScalarByExpTruncate(amount, Exp({mantissa: tokenData[token].exchangeRate}));\n IQToken(tokenData[token].qTokenAddress).mint(msg.sender, qTokenMintAmount);\n\n emit QuasarTotalCapacityUpdated(token, tokenUsableCapacity[token]);\n }\n\n /**\n * @dev Withdraw funds from the contract\n * @param token the token\n * @param amount amount (in number of qTokens) to withdraw\n */\n function withdrawFunds(address token, uint256 amount) public {\n address qToken = tokenData[token].qTokenAddress;\n uint256 qTokenBalance = IERC20(qToken).balanceOf(msg.sender);\n require(amount <= qTokenBalance, \"Not enough qToken Balance\");\n\n // derive amount from number of qTokens\n uint256 tokenWithdrawable = Exponential.mulScalarTruncate(Exp({mantissa: tokenData[token].exchangeRate}), amount);\n require(tokenWithdrawable <= tokenUsableCapacity[token], \"Amount should be lower than claimable funds\");\n\n tokenUsableCapacity[token] = tokenUsableCapacity[token].sub(tokenWithdrawable);\n tokenData[token].poolSupply = tokenData[token].poolSupply.sub(tokenWithdrawable);\n\n // burn qTokens from supply\n IQToken(qToken).burn(msg.sender, amount);\n\n if (token == address(0)) {\n SafeEthTransfer.transferRevertOnError(msg.sender, tokenWithdrawable, SAFE_GAS_STIPEND);\n } else {\n IERC20(token).safeTransfer(msg.sender, tokenWithdrawable);\n }\n\n emit QuasarTotalCapacityUpdated(token, tokenUsableCapacity[token]);\n }\n\n /**\n * Higher decimal for erc20 preffered\n * @dev Register a token to be allowed, deploy qToken first\n * @param token the token\n * @param qTokenContract the address of the qToken contract\n * @param quasarFee amount (in token's denomination) to be used as a fee\n */\n function registerQToken(address token, address qTokenContract, uint256 quasarFee) public onlyQuasarMaintainer() {\n require(tokenData[token].qTokenAddress == address(0), \"QToken for the token already exists\");\n tokenData[token] = Token(qTokenContract, INITIAL_EXCHANGE_RATE_SCALED, 0, 0, quasarFee);\n }\n\n /**\n * @dev Repay owed funds to the pool\n * @param token the token\n * @param amount amount to repay\n */\n function repayOwedToken(address token, uint256 amount) public payable {\n if (token == address(0)) {\n amount = msg.value;\n } else {\n IERC20(token).safeTransferFrom(msg.sender, address(this), amount);\n }\n\n tokenUsableCapacity[token] = tokenUsableCapacity[token].add(amount);\n tokenData[token].owedAmount = tokenData[token].owedAmount.sub(amount); \n }\n}\n",
"sourcePath": "/Users/souradeep/Downloads/plasma-contracts/plasma_framework/contracts/poc/fast_exits/QuasarPool.sol",
"ast": {
"absolutePath": "/Users/souradeep/Downloads/plasma-contracts/plasma_framework/contracts/poc/fast_exits/QuasarPool.sol",
"exportedSymbols": {
"QuasarPool": [
5830
]
},
"id": 5831,
"nodeType": "SourceUnit",
"nodes": [
{
"id": 5443,
"literals": [
"solidity",
"0.5",
".11"
],
"nodeType": "PragmaDirective",
"src": "0:23:47"
},
{
"id": 5444,
"literals": [
"experimental",
"ABIEncoderV2"
],
"nodeType": "PragmaDirective",
"src": "24:33:47"
},
{
"absolutePath": "/Users/souradeep/Downloads/plasma-contracts/plasma_framework/contracts/src/utils/SafeEthTransfer.sol",
"file": "../../src/utils/SafeEthTransfer.sol",
"id": 5445,
"nodeType": "ImportDirective",
"scope": 5831,
"sourceUnit": 17708,
"src": "59:45:47",
"symbolAliases": [],
"unitAlias": ""
},
{
"absolutePath": "/Users/souradeep/Downloads/plasma-contracts/plasma_framework/contracts/poc/fast_exits/utils/Exponential.sol",
"file": "./utils/Exponential.sol",
"id": 5446,
"nodeType": "ImportDirective",
"scope": 5831,
"sourceUnit": 5993,