UNPKG

test-contracts-sovryn

Version:

Smart contracts for the Sovryn protocol and external integrations.

1,707 lines 131 kB
{ "_format": "hh-sol-artifact-1", "contractName": "LoanTokenLogicTest", "sourceName": "contracts/testhelpers/LoanTokenLogicTest.sol", "abi": [ { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "address", "name": "owner", "type": "address" }, { "indexed": true, "internalType": "address", "name": "spender", "type": "address" }, { "indexed": false, "internalType": "uint256", "name": "value", "type": "uint256" } ], "name": "Approval", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "address", "name": "burner", "type": "address" }, { "indexed": false, "internalType": "uint256", "name": "tokenAmount", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "assetAmount", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "price", "type": "uint256" } ], "name": "Burn", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": false, "internalType": "address", "name": "borrower", "type": "address" }, { "indexed": false, "internalType": "address", "name": "target", "type": "address" }, { "indexed": false, "internalType": "address", "name": "loanToken", "type": "address" }, { "indexed": false, "internalType": "uint256", "name": "loanAmount", "type": "uint256" } ], "name": "FlashBorrow", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "address", "name": "minter", "type": "address" }, { "indexed": false, "internalType": "uint256", "name": "tokenAmount", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "assetAmount", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "price", "type": "uint256" } ], "name": "Mint", "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" }, { "anonymous": false, "inputs": [ { "indexed": false, "internalType": "address[]", "name": "addresses", "type": "address[]" }, { "indexed": false, "internalType": "uint256[]", "name": "limits", "type": "uint256[]" } ], "name": "SetTransactionLimits", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "address", "name": "from", "type": "address" }, { "indexed": true, "internalType": "address", "name": "to", "type": "address" }, { "indexed": false, "internalType": "uint256", "name": "value", "type": "uint256" } ], "name": "Transfer", "type": "event" }, { "payable": false, "stateMutability": "nonpayable", "type": "fallback" }, { "constant": true, "inputs": [], "name": "VERSION", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [ { "internalType": "uint256", "name": "assetBorrow", "type": "uint256" }, { "internalType": "uint256", "name": "assetSupply", "type": "uint256" } ], "name": "_supplyInterestRate", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "admin", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [ { "internalType": "address", "name": "_owner", "type": "address" }, { "internalType": "address", "name": "_spender", "type": "address" } ], "name": "allowance", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": false, "inputs": [ { "internalType": "address", "name": "_spender", "type": "address" }, { "internalType": "uint256", "name": "_value", "type": "uint256" } ], "name": "approve", "outputs": [ { "internalType": "bool", "name": "", "type": "bool" } ], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": true, "inputs": [ { "internalType": "address", "name": "_owner", "type": "address" } ], "name": "assetBalanceOf", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "avgBorrowInterestRate", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [ { "internalType": "address", "name": "_owner", "type": "address" } ], "name": "balanceOf", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "baseRate", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": false, "inputs": [ { "internalType": "bytes32", "name": "loanId", "type": "bytes32" }, { "internalType": "uint256", "name": "withdrawAmount", "type": "uint256" }, { "internalType": "uint256", "name": "initialLoanDuration", "type": "uint256" }, { "internalType": "uint256", "name": "collateralTokenSent", "type": "uint256" }, { "internalType": "address", "name": "collateralTokenAddress", "type": "address" }, { "internalType": "address", "name": "borrower", "type": "address" }, { "internalType": "address", "name": "receiver", "type": "address" }, { "internalType": "bytes", "name": "", "type": "bytes" } ], "name": "borrow", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" }, { "internalType": "uint256", "name": "", "type": "uint256" } ], "payable": true, "stateMutability": "payable", "type": "function" }, { "constant": true, "inputs": [], "name": "borrowInterestRate", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": false, "inputs": [ { "internalType": "address", "name": "receiver", "type": "address" }, { "internalType": "uint256", "name": "burnAmount", "type": "uint256" }, { "internalType": "bool", "name": "useLM", "type": "bool" } ], "name": "burn", "outputs": [ { "internalType": "uint256", "name": "redeemed", "type": "uint256" } ], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": false, "inputs": [ { "internalType": "address", "name": "receiver", "type": "address" }, { "internalType": "uint256", "name": "burnAmount", "type": "uint256" } ], "name": "burn", "outputs": [ { "internalType": "uint256", "name": "loanAmountPaid", "type": "uint256" } ], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": true, "inputs": [ { "internalType": "string", "name": "funcId", "type": "string" } ], "name": "checkPause", "outputs": [ { "internalType": "bool", "name": "isPaused", "type": "bool" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [ { "internalType": "uint256", "name": "leverageAmount", "type": "uint256" }, { "internalType": "uint256", "name": "loanTokenSent", "type": "uint256" }, { "internalType": "uint256", "name": "collateralTokenSent", "type": "uint256" }, { "internalType": "address", "name": "collateralTokenAddress", "type": "address" }, { "internalType": "uint256", "name": "minReturn", "type": "uint256" } ], "name": "checkPriceDivergence", "outputs": [], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [ { "internalType": "address", "name": "_user", "type": "address" } ], "name": "checkpointPrice", "outputs": [ { "internalType": "uint256", "name": "price", "type": "uint256" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "checkpointSupply", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "decimals", "outputs": [ { "internalType": "uint8", "name": "", "type": "uint8" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": false, "inputs": [ { "internalType": "address[]", "name": "collateralTokens", "type": "address[]" }, { "internalType": "bool[]", "name": "isTorqueLoans", "type": "bool[]" } ], "name": "disableLoanParams", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": true, "inputs": [], "name": "earlyAccessToken", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [ { "internalType": "uint256", "name": "depositAmount", "type": "uint256" }, { "internalType": "uint256", "name": "initialLoanDuration", "type": "uint256" }, { "internalType": "address", "name": "collateralTokenAddress", "type": "address" } ], "name": "getBorrowAmountForDeposit", "outputs": [ { "internalType": "uint256", "name": "borrowAmount", "type": "uint256" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [ { "internalType": "uint256", "name": "borrowAmount", "type": "uint256" }, { "internalType": "uint256", "name": "initialLoanDuration", "type": "uint256" }, { "internalType": "address", "name": "collateralTokenAddress", "type": "address" } ], "name": "getDepositAmountForBorrow", "outputs": [ { "internalType": "uint256", "name": "depositAmount", "type": "uint256" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [ { "internalType": "uint256", "name": "leverageAmount", "type": "uint256" }, { "internalType": "uint256", "name": "loanTokenSent", "type": "uint256" }, { "internalType": "uint256", "name": "collateralTokenSent", "type": "uint256" }, { "internalType": "address", "name": "collateralTokenAddress", "type": "address" } ], "name": "getEstimatedMarginDetails", "outputs": [ { "internalType": "uint256", "name": "principal", "type": "uint256" }, { "internalType": "uint256", "name": "collateral", "type": "uint256" }, { "internalType": "uint256", "name": "interestRate", "type": "uint256" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [ { "internalType": "uint256", "name": "leverageAmount", "type": "uint256" }, { "internalType": "uint256", "name": "depositAmount", "type": "uint256" } ], "name": "getMarginBorrowAmountAndRate", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" }, { "internalType": "uint256", "name": "", "type": "uint256" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [ { "internalType": "uint256", "name": "leverageAmount", "type": "uint256" } ], "name": "getMaxEscrowAmount", "outputs": [ { "internalType": "uint256", "name": "maxEscrowAmount", "type": "uint256" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "initialPrice", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "isOwner", "outputs": [ { "internalType": "bool", "name": "", "type": "bool" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "kinkLevel", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "liquidityMiningAddress", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "name": "loanParamsIds", "outputs": [ { "internalType": "bytes32", "name": "", "type": "bytes32" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "loanTokenAddress", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "lowUtilBaseRate", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "lowUtilRateMultiplier", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": false, "inputs": [ { "internalType": "bytes32", "name": "loanId", "type": "bytes32" }, { "internalType": "uint256", "name": "leverageAmount", "type": "uint256" }, { "internalType": "uint256", "name": "loanTokenSent", "type": "uint256" }, { "internalType": "uint256", "name": "collateralTokenSent", "type": "uint256" }, { "internalType": "address", "name": "collateralTokenAddress", "type": "address" }, { "internalType": "address", "name": "trader", "type": "address" }, { "internalType": "uint256", "name": "minReturn", "type": "uint256" }, { "internalType": "bytes", "name": "loanDataBytes", "type": "bytes" } ], "name": "marginTrade", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" }, { "internalType": "uint256", "name": "", "type": "uint256" } ], "payable": true, "stateMutability": "payable", "type": "function" }, { "constant": false, "inputs": [ { "internalType": "bytes32", "name": "loanId", "type": "bytes32" }, { "internalType": "uint256", "name": "leverageAmount", "type": "uint256" }, { "internalType": "uint256", "name": "loanTokenSent", "type": "uint256" }, { "internalType": "uint256", "name": "collateralTokenSent", "type": "uint256" }, { "internalType": "address", "name": "collateralTokenAddress", "type": "address" }, { "internalType": "address", "name": "trader", "type": "address" }, { "internalType": "uint256", "name": "minReturn", "type": "uint256" }, { "internalType": "address", "name": "affiliateReferrer", "type": "address" }, { "internalType": "bytes", "name": "loanDataBytes", "type": "bytes" } ], "name": "marginTradeAffiliate", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" }, { "internalType": "uint256", "name": "", "type": "uint256" } ], "payable": true, "stateMutability": "payable", "type": "function" }, { "constant": true, "inputs": [], "name": "marketLiquidity", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "maxScaleRate", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": false, "inputs": [ { "internalType": "address", "name": "receiver", "type": "address" }, { "internalType": "uint256", "name": "depositAmount", "type": "uint256" } ], "name": "mint", "outputs": [ { "internalType": "uint256", "name": "mintAmount", "type": "uint256" } ], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": false, "inputs": [ { "internalType": "address", "name": "receiver", "type": "address" }, { "internalType": "uint256", "name": "depositAmount", "type": "uint256" }, { "internalType": "bool", "name": "useLM", "type": "bool" } ], "name": "mint", "outputs": [ { "internalType": "uint256", "name": "minted", "type": "uint256" } ], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": true, "inputs": [], "name": "name", "outputs": [ { "internalType": "string", "name": "", "type": "string" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [ { "internalType": "uint256", "name": "borrowAmount", "type": "uint256" } ], "name": "nextBorrowInterestRate", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [ { "internalType": "uint256", "name": "supplyAmount", "type": "uint256" } ], "name": "nextSupplyInterestRate", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "owner", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "pauser", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [ { "internalType": "address", "name": "user", "type": "address" } ], "name": "profitOf", "outputs": [ { "internalType": "int256", "name": "", "type": "int256" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "rateMultiplier", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": false, "inputs": [ { "internalType": "address", "name": "_admin", "type": "address" } ], "name": "setAdmin", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": false, "inputs": [ { "internalType": "uint256", "name": "_baseRate", "type": "uint256" }, { "internalType": "uint256", "name": "_rateMultiplier", "type": "uint256" }, { "internalType": "uint256", "name": "_lowUtilBaseRate", "type": "uint256" }, { "internalType": "uint256", "name": "_lowUtilRateMultiplier", "type": "uint256" }, { "internalType": "uint256", "name": "_targetLevel", "type": "uint256" }, { "internalType": "uint256", "name": "_kinkLevel", "type": "uint256" }, { "internalType": "uint256", "name": "_maxScaleRate", "type": "uint256" } ], "name": "setDemandCurve", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": false, "inputs": [ { "internalType": "address", "name": "LMAddress", "type": "address" } ], "name": "setLiquidityMiningAddress", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": false, "inputs": [ { "internalType": "address", "name": "_pauser", "type": "address" } ], "name": "setPauser", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": false, "inputs": [ { "components": [ { "internalType": "bytes32", "name": "id", "type": "bytes32" }, { "internalType": "bool", "name": "active", "type": "bool" }, { "internalType": "address", "name": "owner", "type": "address" }, { "internalType": "address", "name": "loanToken", "type": "address" }, { "internalType": "address", "name": "collateralToken", "type": "address" }, { "internalType": "uint256", "name": "minInitialMargin", "type": "uint256" }, { "internalType": "uint256", "name": "maintenanceMargin", "type": "uint256" }, { "internalType": "uint256", "name": "maxLoanTerm", "type": "uint256" } ], "internalType": "struct LoanParamsStruct.LoanParams[]", "name": "loanParamsList", "type": "tuple[]" }, { "internalType": "bool", "name": "areTorqueLoans", "type": "bool" } ], "name": "setupLoanParams", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": true, "inputs": [], "name": "sovrynContractAddress", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "supplyInterestRate", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "symbol", "outputs": [ { "internalType": "string", "name": "", "type": "string" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "targetLevel", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "target_", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": false, "inputs": [ { "internalType": "string", "name": "funcId", "type": "string" }, { "internalType": "bool", "name": "isPaused", "type": "bool" } ], "name": "toggleFunctionPause", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": true, "inputs": [], "name": "tokenPrice", "outputs": [ { "internalType": "uint256", "name": "price", "type": "uint256" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "totalAssetBorrow", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "totalAssetSupply", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "totalSupply", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [ { "internalType": "uint256", "name": "assetSupply", "type": "uint256" } ], "name": "totalSupplyInterestRate", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [ { "internalType": "address", "name": "", "type": "address" } ], "name": "transactionLimit", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": false, "inputs": [ { "internalType": "address", "name": "_to", "type": "address" }, { "internalType": "uint256", "name": "_value", "type": "uint256" } ], "name": "transfer", "outputs": [ { "internalType": "bool", "name": "", "type": "bool" } ], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": false, "inputs": [ { "internalType": "address", "name": "_from", "type": "address" }, { "internalType": "address", "name": "_to", "type": "address" }, { "internalType": "uint256", "name": "_value", "type": "uint256" } ], "name": "transferFrom", "outputs": [ { "internalType": "bool", "name": "", "type": "bool" } ], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": false, "inputs": [ { "internalType": "address", "name": "newOwner", "type": "address" } ], "name": "transferOwnership", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": true, "inputs": [], "name": "wrbtcTokenAddress", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "payable": false, "stateMutability": "view", "type": "function" } ], "bytecode": "0x6080604052600160009081556200001e6001600160e01b036200007216565b600180546001600160a01b0319166001600160a01b038316908117909155604051919250906000907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a35062000076565b3390565b615ba380620000866000396000f3fe6080604052600436106103e45760003560e01c80637e37c08c11610208578063ca37e66611610118578063e3cded61116100ab578063ef2b0b391161007a578063ef2b0b3914610ace578063f2fde38b14610ae3578063f6b69f9914610b03578063f851a44014610b16578063ffa1ad7414610b2b576103e4565b8063e3cded6114610a4e578063e41b07e314610a6e578063e697d2ee14610a8e578063eebc508114610aae576103e4565b8063d759dbeb116100e7578063d759dbeb146109d9578063d8f06c83146109ee578063d97206a414610a0e578063dd62ed3e14610a2e576103e4565b8063ca37e66614610964578063cb926cb314610979578063d1a1beb414610999578063d65a5021146109b9576103e4565b80638fb807c51161019b5780639fd0506d1161016a5780639fd0506d146108da578063a9059cbb146108ef578063b9fe1a8f1461090f578063ba0e43bf1461092f578063be19421714610944576103e4565b80638fb807c51461087b57806395d89b41146108905780639bda3a98146108a55780639dc29fac146108ba576103e4565b80638d875e3c116101d75780638d875e3c1461081c5780638da5cb5b1461083c5780638ee6c4e6146108515780638f32d59b14610866576103e4565b80637e37c08c146107bd5780637ff9b596146107d2578063829b38f4146107e75780638325a1c014610807576103e4565b80632f6b600d11610303578063612ef80b1161029657806370a082311161026557806370a08231146107335780637288b3441461075357806376fd4fdf14610773578063797bf385146107935780637b7933b4146107a8576103e4565b8063612ef80b146106af578063631a3ef8146106c45780636b40cd40146106e4578063704b6c0214610713576103e4565b806340c10f19116102d257806340c10f191461064557806344a4a0031461066557806354198ce91461067a57806356e07d701461069a576103e4565b80632f6b600d146105d9578063313ce567146105ee5780633291c11a14610610578063330691ac14610630576103e4565b806318498b1d1161037b57806323b872dd1161034a57806323b872dd1461056557806328a02f19146105855780632d88af4a146105a65780632ea295fa146105c6576103e4565b806318498b1d146105045780631d0806ae146105265780631f68f20a1461053b57806320f6d07c14610550576103e4565b8063095ea7b3116103b7578063095ea7b31461048d57806309ec6b6b146104ba57806312416898146104cf57806318160ddd146104ef576103e4565b806304797930146103f357806306947a3a1461042957806306b3efd61461044b57806306fdde031461046b575b3480156103f057600080fd5b50005b3480156103ff57600080fd5b5061041361040e366004614ac6565b610b40565b604051610420919061573d565b60405180910390f35b34801561043557600080fd5b5061043e610ce9565b60405161042091906155b4565b34801561045757600080fd5b50610413610466366004614542565b610cf8565b34801561047757600080fd5b50610480610de4565b60405161042091906157bc565b34801561049957600080fd5b506104ad6104a8366004614605565b610e6f565b604051610420919061572f565b3480156104c657600080fd5b50610413610eda565b3480156104db57600080fd5b506104136104ea366004614a3b565b610eef565b3480156104fb57600080fd5b50610413610f1a565b34801561051057600080fd5b5061052461051f366004614b6a565b610f20565b005b34801561053257600080fd5b50610413610f63565b34801561054757600080fd5b50610413610f69565b34801561055c57600080fd5b50610413610f6f565b34801561057157600080fd5b506104ad6105803660046145b8565b610ffe565b610598610593366004614943565b6110c7565b6040516104209291906159bd565b3480156105b257600080fd5b506105246105c1366004614542565b6112ec565b6105986105d436600461479c565b611332565b3480156105e557600080fd5b5061043e611612565b3480156105fa57600080fd5b50610603611621565b60405161042091906159e6565b34801561061c57600080fd5b5061041361062b366004614a3b565b61162a565b34801561063c57600080fd5b5061041361163c565b34801561065157600080fd5b50610413610660366004614605565b611642565b34801561067157600080fd5b50610413611683565b34801561068657600080fd5b50610413610695366004614542565b611695565b3480156106a657600080fd5b50610413611736565b3480156106bb57600080fd5b5061041361173c565b3480156106d057600080fd5b506104136106df366004614ac6565b61176d565b3480156106f057600080fd5b506107046106ff366004614b09565b61190d565b604051610420939291906159cb565b34801561071f57600080fd5b5061052461072e366004614542565b611a1e565b34801561073f57600080fd5b5061041361074e366004614542565b611a64565b34801561075f57600080fd5b5061041361076e366004614a77565b611a7f565b34801561077f57600080fd5b5061041361078e366004614635565b611b62565b34801561079f57600080fd5b5061043e611c0d565b3480156107b457600080fd5b50610413611c21565b3480156107c957600080fd5b50610413611c27565b3480156107de57600080fd5b50610413611c2d565b3480156107f357600080fd5b50610413610802366004614a3b565b611c6b565b34801561081357600080fd5b50610413611ceb565b34801561082857600080fd5b50610598610837366004614a77565b611cf7565b34801561084857600080fd5b5061043e611d10565b34801561085d57600080fd5b5061043e611d1f565b34801561087257600080fd5b506104ad611d2e565b34801561088757600080fd5b50610413611d54565b34801561089c57600080fd5b50610480611d84565b3480156108b157600080fd5b5061043e611ddf565b3480156108c657600080fd5b506104136108d5366004614605565b611dee565b3480156108e657600080fd5b5061043e611e62565b3480156108fb57600080fd5b506104ad61090a366004614605565b611e71565b34801561091b57600080fd5b5061041361092a366004614a3b565b611e81565b34801561093b57600080fd5b50610413611e8c565b34801561095057600080fd5b506104ad61095f3660046149d2565b611e92565b34801561097057600080fd5b5061043e611f14565b34801561098557600080fd5b50610524610994366004614542565b611f23565b3480156109a557600080fd5b506104136109b4366004614635565b611f69565b3480156109c557600080fd5b506104136109d4366004614a3b565b611fb3565b3480156109e557600080fd5b50610413611fc6565b3480156109fa57600080fd5b50610524610a0936600461471a565b611fcc565b348015610a1a57600080fd5b50610524610a29366004614c66565b61219b565b348015610a3a57600080fd5b50610413610a4936600461457e565b6122a2565b348015610a5a57600080fd5b50610524610a69366004614a06565b6122cd565b348015610a7a57600080fd5b50610413610a89366004614542565b612372565b348015610a9a57600080fd5b50610524610aa9366004614678565b612384565b348015610aba57600080fd5b50610413610ac9366004614542565b612535565b348015610ada57600080fd5b50610413612550565b348015610aef57600080fd5b50610524610afe366004614542565b612556565b610598610b11366004614863565b612586565b348015610b2257600080fd5b5061043e612656565b348015610b3757600080fd5b50610413612665565b60008315610ce2576001600160a01b038216610b65576017546001600160a01b031691505b600060106000846001604051602001610b7f929190615540565b60408051601f19818403018152918152815160209283012083529082019290925281016000205460165460048054935163ca74a5d960e01b81529294506001600160a01b039182169363e762319f936101009091049092169187918a91869163ca74a5d991610bf0918a910161573d565b60206040518083038186803b158015610c0857600080fd5b505afa158015610c1c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610c409190810190614a59565b60016040518663ffffffff1660e01b8152600401610c6295949392919061562e565b60206040518083038186803b158015610c7a57600080fd5b505afa158015610c8e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610cb29190810190614a59565b9150610cc682610cc0611d54565b8661266a565b9350610cd491506126e39050565b821115610ce057600091505b505b9392505050565b6016546001600160a01b031681565b601c5460009081906001600160a01b031615610d9357601c54604051636822955360e11b81526001600160a01b039091169063d0452aa690610d4090309087906004016155d0565b60206040518083038186803b158015610d5857600080fd5b505afa158015610d6c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610d909190810190614a59565b90505b610ddb670de0b6b3a7640000610dcf610daa611c2d565b610dc385610db789611a64565b9063ffffffff61271916565b9063ffffffff61273e16565b9063ffffffff61277816565b9150505b919050565b6002805460408051602060018416156101000260001901909316849004601f81018490048402820184019092528181529291830182828015610e675780601f10610e3c57610100808354040283529160200191610e67565b820191906000526020600020905b815481529060010190602001808311610e4a57829003601f168201915b505050505081565b3360008181526014602090815260408083206001600160a01b038716808552925280832085905551919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92590610ec890869061573d565b60405180910390a35060015b92915050565b6000610ee96104ea60006127ba565b90505b90565b600080610efa610f6f565b90508015610f1457610f0c8184611a7f565b915050610ddf565b50919050565b60155490565b6000610f2e8686868661190d565b5091505081811015610f5b5760405162461bcd60e51b8152600401610f52906157cd565b60405180910390fd5b505050505050565b600e5481565b60055481565b6016546004805460405163250f447f60e11b81526000936001600160a01b0390811693634a1e88fe93610fae93309361010090920490911691016155d0565b60206040518083038186803b158015610fc657600080fd5b505afa158015610fda573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610ee99190810190614a59565b60165460405163115dd4b160e01b81526000916110bf918691869186916001600160a01b03169063115dd4b1906110399033906004016155c2565b60206040518083038186803b15801561105157600080fd5b505afa158015611065573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250611089919081019061477e565b6110b6576001600160a01b03881660009081526014602090815260408083203384529091529020546110ba565b6000195b6127f4565b949350505050565b6000806001600054146110ec5760405162461bcd60e51b8152600401610f529061596d565b60026000556110f96129c7565b6111068989898988610f20565b6001600160a01b038616611123576017546001600160a01b031695505b6004546001600160a01b038781166101009092041614156111565760405162461bcd60e51b8152600401610f529061587d565b89158061116b5750336001600160a01b038616145b6111875760405162461bcd60e51b8152600401610f529061598d565b6001600160a01b038616600090815260126020526040902054156111ca576001600160a01b0386166000908152601260205260409020548711156111ca57600080fd5b60045461010090046001600160a01b03166000908152601260205260409020541561121b5760045461010090046001600160a01b031660009081526012602052604090205488111561121b57600080fd5b600061122887898b612a47565b9050806112475760405162461bcd60e51b8152600401610f52906158ad565b61124f614249565b611257614267565b3082526001600160a01b038816602080840182905260408401919091528101839052606081018b9052608081018a905261128f612c74565b6112a08c8260016020020151612d1a565b825260208201526112c16f4b3b4ca85a86c47a098a2240000000008d612778565b9b506112d38d60008e8c86868c612d69565b6001600055909e909d509b505050505050505050505050565b6112f4611d2e565b6113105760405162461bcd60e51b8152600401610f529061590d565b601b80546001600160a01b0319166001600160a01b0392909216919091179055565b6000806001600054146113575760405162461bcd60e51b8152600401610f529061596d565b6002600055886113795760405162461bcd60e51b8152600401610f529061599d565b6113816129c7565b6001600160a01b038616600090815260126020526040902054156113c4576001600160a01b0386166000908152601260205260409020548711156113c457600080fd5b3415806113d057508634145b80156113e45750861515806113e457508915155b801561140b57506001600160a01b03861615158061140157503415155b8061140b57508915155b801561142757508915806114275750336001600160a01b038616145b6114435760405162461bcd60e51b8152600401610f529061583d565b6001600160a01b038616611460576017546001600160a01b031695505b6004546001600160a01b038781166101009092041614156114935760405162461bcd60e51b8152600401610f52906157dd565b61149b612c74565b6114a3614249565b6114ab614267565b3082526001600160a01b03878116602080850191909152908716604084015281018b90526114e38b6114dd60006127ba565b8c61266a565b8360006020020184600260200201856001602002019290925291905252888160046020020181815250506115fa8c8c601660009054906101000a90046001600160a01b03166001600160a01b031663ca74a5d9601060008e600160405160200161154e929190615540565b6040516020818303038152906040528051906020012060001c8152602001908152602001600020546040518263ffffffff1660e01b8152600401611592919061573d565b60206040518083038186803b1580156115aa57600080fd5b505afa1580156115be573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506115e29190810190614a59565b8b868660405180602001604052806000815250612d69565b6001600055909d909c509a5050505050505050505050565b6017546001600160a01b031681565b60045460ff1681565b60106020526000908152604090205481565b60065481565b60006001600054146116665760405162461bcd60e51b8152600401610f529061596d565b60026000556116758383612fc8565b90505b600160005592915050565b6000610ee9611690610f6f565b6130d4565b600080827f37aa2b7d583612f016e4a4de4292cb015139b3d7762663d06a53964912ea2fb660001b6040516020016116ce929190615566565b604051602081830303815290604052805190602001209050610ddb8160136000866001600160a01b03166001600160a01b0316815260200190815260200160002054611718611c2d565b6001600160a01b03871660009081526011602052604090205461310c565b600a5481565b60008061174960006127ba565b90506000611755610f6f565b9050808211156117685790039050610eec565b505090565b60008315610ce257600061178385610cc0611d54565b9250505061178f6126e3565b8111610ce0576001600160a01b0383166117b2576017546001600160a01b031692505b6000601060008560016040516020016117cc929190615540565b60408051601f19818403018152918152815160209283012083529082019290925281016000205460165460048054935163ca74a5d960e01b815292945061190493600a936001600160a01b03938416936325decac09361010090930416918a918991869163ca74a5d991611842918c910161573d565b60206040518083038186803b15801561185a57600080fd5b505afa15801561186e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506118929190810190614a59565b60016040518663ffffffff1660e01b81526004016118b495949392919061562e565b60206040518083038186803b1580156118cc57600080fd5b505afa1580156118e0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610db79190810190614a59565b92505050610ce2565b600080806001600160a01b03841661192e576017546001600160a01b031693505b600061193b858789612a47565b90506119478882612d1a565b90945091506119546126e3565b84111561196b5750600