UNPKG

test-contracts-sovryn

Version:

Smart contracts for the Sovryn protocol and external integrations.

1,862 lines 124 kB
{ "_format": "hh-sol-artifact-1", "contractName": "LoanClosingsWith", "sourceName": "contracts/modules/LoanClosingsWith.sol", "abi": [ { "inputs": [], "payable": false, "stateMutability": "nonpayable", "type": "constructor" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "address", "name": "user", "type": "address" }, { "indexed": true, "internalType": "address", "name": "lender", "type": "address" }, { "indexed": true, "internalType": "bytes32", "name": "loanId", "type": "bytes32" }, { "indexed": false, "internalType": "address", "name": "closer", "type": "address" }, { "indexed": false, "internalType": "address", "name": "loanToken", "type": "address" }, { "indexed": false, "internalType": "address", "name": "collateralToken", "type": "address" }, { "indexed": false, "internalType": "uint256", "name": "repayAmount", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "collateralWithdrawAmount", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "collateralToLoanRate", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "currentMargin", "type": "uint256" } ], "name": "CloseWithDeposit", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "address", "name": "user", "type": "address" }, { "indexed": true, "internalType": "address", "name": "lender", "type": "address" }, { "indexed": true, "internalType": "bytes32", "name": "loanId", "type": "bytes32" }, { "indexed": false, "internalType": "address", "name": "collateralToken", "type": "address" }, { "indexed": false, "internalType": "address", "name": "loanToken", "type": "address" }, { "indexed": false, "internalType": "address", "name": "closer", "type": "address" }, { "indexed": false, "internalType": "uint256", "name": "positionCloseSize", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "loanCloseAmount", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "exitPrice", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "currentLeverage", "type": "uint256" } ], "name": "CloseWithSwap", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "address", "name": "receiver", "type": "address" }, { "indexed": true, "internalType": "address", "name": "token", "type": "address" }, { "indexed": true, "internalType": "bytes32", "name": "loanId", "type": "bytes32" }, { "indexed": false, "internalType": "uint256", "name": "feeRebatePercent", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "amount", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "basisPoint", "type": "uint256" } ], "name": "EarnReward", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "address", "name": "receiver", "type": "address" }, { "indexed": true, "internalType": "address", "name": "token", "type": "address" }, { "indexed": true, "internalType": "bytes32", "name": "loanId", "type": "bytes32" }, { "indexed": false, "internalType": "uint256", "name": "feeRebatePercent", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "amount", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "basisPoint", "type": "uint256" } ], "name": "EarnRewardFail", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "address", "name": "user", "type": "address" }, { "indexed": true, "internalType": "address", "name": "sourceToken", "type": "address" }, { "indexed": true, "internalType": "address", "name": "destToken", "type": "address" }, { "indexed": false, "internalType": "uint256", "name": "sourceAmount", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "destAmount", "type": "uint256" } ], "name": "ExternalSwap", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "address", "name": "user", "type": "address" }, { "indexed": true, "internalType": "address", "name": "liquidator", "type": "address" }, { "indexed": true, "internalType": "bytes32", "name": "loanId", "type": "bytes32" }, { "indexed": false, "internalType": "address", "name": "lender", "type": "address" }, { "indexed": false, "internalType": "address", "name": "loanToken", "type": "address" }, { "indexed": false, "internalType": "address", "name": "collateralToken", "type": "address" }, { "indexed": false, "internalType": "uint256", "name": "repayAmount", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "collateralWithdrawAmount", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "collateralToLoanRate", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "currentMargin", "type": "uint256" } ], "name": "Liquidate", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "bytes32", "name": "loanId", "type": "bytes32" }, { "indexed": true, "internalType": "address", "name": "sourceToken", "type": "address" }, { "indexed": true, "internalType": "address", "name": "destToken", "type": "address" }, { "indexed": false, "internalType": "address", "name": "borrower", "type": "address" }, { "indexed": false, "internalType": "uint256", "name": "sourceAmount", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "destAmount", "type": "uint256" } ], "name": "LoanSwap", "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": true, "internalType": "address", "name": "payer", "type": "address" }, { "indexed": true, "internalType": "address", "name": "token", "type": "address" }, { "indexed": true, "internalType": "bytes32", "name": "loanId", "type": "bytes32" }, { "indexed": false, "internalType": "uint256", "name": "amount", "type": "uint256" } ], "name": "PayBorrowingFee", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "address", "name": "interestToken", "type": "address" }, { "indexed": true, "internalType": "address", "name": "lender", "type": "address" }, { "indexed": false, "internalType": "uint256", "name": "effectiveInterest", "type": "uint256" } ], "name": "PayInterestTransfer", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "address", "name": "payer", "type": "address" }, { "indexed": true, "internalType": "address", "name": "token", "type": "address" }, { "indexed": false, "internalType": "uint256", "name": "amount", "type": "uint256" } ], "name": "PayLendingFee", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "address", "name": "payer", "type": "address" }, { "indexed": true, "internalType": "address", "name": "token", "type": "address" }, { "indexed": true, "internalType": "bytes32", "name": "loanId", "type": "bytes32" }, { "indexed": false, "internalType": "uint256", "name": "amount", "type": "uint256" } ], "name": "PayTradingFee", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "address", "name": "prevModuleContractAddress", "type": "address" }, { "indexed": true, "internalType": "address", "name": "newModuleContractAddress", "type": "address" }, { "indexed": true, "internalType": "bytes32", "name": "module", "type": "bytes32" } ], "name": "ProtocolModuleContractReplaced", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "address", "name": "asset", "type": "address" }, { "indexed": true, "internalType": "address", "name": "from", "type": "address" }, { "indexed": false, "internalType": "uint256", "name": "amount", "type": "uint256" } ], "name": "VaultDeposit", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "address", "name": "asset", "type": "address" }, { "indexed": true, "internalType": "address", "name": "to", "type": "address" }, { "indexed": false, "internalType": "uint256", "name": "amount", "type": "uint256" } ], "name": "VaultWithdraw", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": false, "internalType": "bool", "name": "shouldRefund", "type": "bool" }, { "indexed": false, "internalType": "uint256", "name": "amount", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "amountInRbtc", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "threshold", "type": "uint256" } ], "name": "swapExcess", "type": "event" }, { "payable": false, "stateMutability": "nonpayable", "type": "fallback" }, { "constant": true, "inputs": [], "name": "admin", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "affiliateFeePercent", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [ { "internalType": "address", "name": "", "type": "address" } ], "name": "affiliateRewardsHeld", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "affiliateTradingTokenFeePercent", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [ { "internalType": "address", "name": "", "type": "address" }, { "internalType": "address", "name": "", "type": "address" } ], "name": "affiliatesReferrerBalances", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [ { "internalType": "address", "name": "", "type": "address" } ], "name": "affiliatesUserReferrer", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [ { "internalType": "address", "name": "", "type": "address" } ], "name": "borrowerNonce", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [ { "internalType": "address", "name": "", "type": "address" }, { "internalType": "bytes32", "name": "", "type": "bytes32" } ], "name": "borrowerOrders", "outputs": [ { "internalType": "uint256", "name": "lockedAmount", "type": "uint256" }, { "internalType": "uint256", "name": "interestRate", "type": "uint256" }, { "internalType": "uint256", "name": "minLoanTerm", "type": "uint256" }, { "internalType": "uint256", "name": "maxLoanTerm", "type": "uint256" }, { "internalType": "uint256", "name": "createdTimestamp", "type": "uint256" }, { "internalType": "uint256", "name": "expirationTimestamp", "type": "uint256" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "borrowingFeePercent", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [ { "internalType": "address", "name": "", "type": "address" } ], "name": "borrowingFeeTokensHeld", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [ { "internalType": "address", "name": "", "type": "address" } ], "name": "borrowingFeeTokensPaid", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": false, "inputs": [ { "internalType": "bytes32", "name": "loanId", "type": "bytes32" }, { "internalType": "address", "name": "receiver", "type": "address" }, { "internalType": "uint256", "name": "depositAmount", "type": "uint256" } ], "name": "closeWithDeposit", "outputs": [ { "internalType": "uint256", "name": "loanCloseAmount", "type": "uint256" }, { "internalType": "uint256", "name": "withdrawAmount", "type": "uint256" }, { "internalType": "address", "name": "withdrawToken", "type": "address" } ], "payable": true, "stateMutability": "payable", "type": "function" }, { "constant": false, "inputs": [ { "internalType": "bytes32", "name": "loanId", "type": "bytes32" }, { "internalType": "address", "name": "receiver", "type": "address" }, { "internalType": "uint256", "name": "swapAmount", "type": "uint256" }, { "internalType": "bool", "name": "returnTokenIsCollateral", "type": "bool" }, { "internalType": "bytes", "name": "", "type": "bytes" } ], "name": "closeWithSwap", "outputs": [ { "internalType": "uint256", "name": "loanCloseAmount", "type": "uint256" }, { "internalType": "uint256", "name": "withdrawAmount", "type": "uint256" }, { "internalType": "address", "name": "withdrawToken", "type": "address" } ], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": true, "inputs": [ { "internalType": "bytes32", "name": "", "type": "bytes32" }, { "internalType": "address", "name": "", "type": "address" } ], "name": "delegatedManagers", "outputs": [ { "internalType": "bool", "name": "", "type": "bool" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "feeRebatePercent", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "feesController", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": false, "inputs": [ { "internalType": "address", "name": "target", "type": "address" } ], "name": "initialize", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": true, "inputs": [], "name": "isOwner", "outputs": [ { "internalType": "bool", "name": "", "type": "bool" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [ { "internalType": "address", "name": "", "type": "address" }, { "internalType": "address", "name": "", "type": "address" } ], "name": "lenderInterest", "outputs": [ { "internalType": "uint256", "name": "principalTotal", "type": "uint256" }, { "internalType": "uint256", "name": "owedPerDay", "type": "uint256" }, { "internalType": "uint256", "name": "owedTotal", "type": "uint256" }, { "internalType": "uint256", "name": "paidTotal", "type": "uint256" }, { "internalType": "uint256", "name": "updatedTimestamp", "type": "uint256" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [ { "internalType": "address", "name": "", "type": "address" }, { "internalType": "bytes32", "name": "", "type": "bytes32" } ], "name": "lenderOrders", "outputs": [ { "internalType": "uint256", "name": "lockedAmount", "type": "uint256" }, { "internalType": "uint256", "name": "interestRate", "type": "uint256" }, { "internalType": "uint256", "name": "minLoanTerm", "type": "uint256" }, { "internalType": "uint256", "name": "maxLoanTerm", "type": "uint256" }, { "internalType": "uint256", "name": "createdTimestamp", "type": "uint256" }, { "internalType": "uint256", "name": "expirationTimestamp", "type": "uint256" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "lendingFeePercent", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [ { "internalType": "address", "name": "", "type": "address" } ], "name": "lendingFeeTokensHeld", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [ { "internalType": "address", "name": "", "type": "address" } ], "name": "lendingFeeTokensPaid", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "liquidationIncentivePercent", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [ { "internalType": "bytes32", "name": "", "type": "bytes32" } ], "name": "loanInterest", "outputs": [ { "internalType": "uint256", "name": "owedPerDay", "type": "uint256" }, { "internalType": "uint256", "name": "depositTotal", "type": "uint256" }, { "internalType": "uint256", "name": "updatedTimestamp", "type": "uint256" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [ { "internalType": "bytes32", "name": "", "type": "bytes32" } ], "name": "loanParams", "outputs": [ { "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" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [ { "internalType": "address", "name": "", "type": "address" } ], "name": "loanPoolToUnderlying", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [ { "internalType": "bytes32", "name": "", "type": "bytes32" } ], "name": "loans", "outputs": [ { "internalType": "bytes32", "name": "id", "type": "bytes32" }, { "internalType": "bytes32", "name": "loanParamsId", "type": "bytes32" }, { "internalType": "bytes32", "name": "pendingTradesId", "type": "bytes32" }, { "internalType": "bool", "name": "active", "type": "bool" }, { "internalType": "uint256", "name": "principal", "type": "uint256" }, { "internalType": "uint256", "name": "collateral", "type": "uint256" }, { "internalType": "uint256", "name": "startTimestamp", "type": "uint256" }, { "internalType": "uint256", "name": "endTimestamp", "type": "uint256" }, { "internalType": "uint256", "name": "startMargin", "type": "uint256" }, { "internalType": "uint256", "name": "startRate", "type": "uint256" }, { "internalType": "address", "name": "borrower", "type": "address" }, { "internalType": "address", "name": "lender", "type": "address" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "lockedSOVAddress", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [ { "internalType": "bytes4", "name": "", "type": "bytes4" } ], "name": "logicTargets", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "maxDisagreement", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "maxSwapSize", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "minReferralsToPayout", "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": "pause", "outputs": [ { "internalType": "bool", "name": "", "type": "bool" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "paySwapExcessToBorrowerThreshold", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "priceFeeds", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "protocolAddress", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "protocolTokenAddress", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "protocolTokenHeld", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "protocolTokenPaid", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "rolloverBaseReward", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "rolloverFlexFeePercent", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "sourceBuffer", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "sovTokenAddress", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "sovrynSwapContractRegistryAddress", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [ { "internalType": "address", "name": "", "type": "address" }, { "internalType": "address", "name": "", "type": "address" } ], "name": "specialRebates", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [ { "internalType": "address", "name": "", "type": "address" } ], "name": "supportedTokens", "outputs": [ { "internalType": "bool", "name": "", "type": "bool" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "swapsImpl", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "tradingFeePercent", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [ { "internalType": "address", "name": "", "type": "address" } ], "name": "tradingFeeTokensHeld", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [ { "internalType": "address", "name": "", "type": "address" } ], "name": "tradingFeeTokensPaid", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": false, "inputs": [ { "internalType": "address", "name": "newOwner", "type": "address" } ], "name": "transferOwnership", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": true, "inputs": [ { "internalType": "address", "name": "", "type": "address" } ], "name": "underlyingToLoanPool", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [ { "internalType": "address", "name": "", "type": "address" } ], "name": "userNotFirstTradeFlag", "outputs": [ { "internalType": "bool", "name": "", "type": "bool" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "wrbtcToken", "outputs": [ { "internalType": "contract IWrbtcERC20", "name": "", "type": "address" } ], "payable": false, "stateMutability": "view", "type": "function" } ], "bytecode": "0x60806040526001600055678ac7230489e80000601555670214e8348c4f000060185567013fbe85edc90000601b55674563918244f40000602055674563918244f40000602155674563918244f400006027556127106028556802b5e3af16b1880000602955650f478e084000602b5567016345785d8a0000602c556802b5e3af16b1880000602f5560036035556801158e460913d00000603955348015620000a657600080fd5b506000620000bc6001600160e01b036200011016565b600180546001600160a01b0319166001600160a01b038316908117909155604051919250906000907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a35062000114565b3390565b6150fd80620001246000396000f3fe60806040526004361061036b5760003560e01c80638f32d59b116101c6578063cd5d808d116100f7578063f0e085f511610095578063f6ddc8b31161006f578063f6ddc8b31461099a578063f706b1f2146109af578063f851a440146109c4578063f8de21d2146109d95761036b565b8063f0e085f514610950578063f2fde38b14610965578063f589a3e7146109855761036b565b8063d485045e116100d1578063d485045e146108f1578063e8f6276414610911578063edab119f14610926578063ee54a4ec1461093b5761036b565b8063cd5d808d146108a7578063d288208c146108c7578063d473c2da146108dc5761036b565b8063b7e1524111610164578063bdee453c1161013e578063bdee453c146107f9578063c4a9081514610819578063c4d66de814610851578063cb6eacd1146108735761036b565b8063b7e15241146107af578063b9cffa3e146107cf578063ba4861e9146107e45761036b565b8063acc04348116101a0578063acc0434814610743578063ae0a853014610758578063afe840091461076d578063b30643d91461078f5761036b565b80638f32d59b146106f957806392d894f81461070e578063959083d31461072e5761036b565b80634699f846116102a05780637420ca3e1161023e5780637a8faeb8116102185780637a8faeb81461069a5780638456cb59146106af5780638da5cb5b146106c45780638dc48ba5146106d95761036b565b80637420ca3e1461065b578063742e67981461067057806378d849ed146106855761036b565b8063574442cc1161027a578063574442cc146105d557806362fff3f6146105ea57806368c4ac261461061b5780636e6637301461063b5761036b565b80634699f8461461057c5780634f28cac214610591578063569fc1fb146105a65761036b565b80632f4707641161030d578063366f513b116102e7578063366f513b146104fa5780633fca506e1461051c5780634115a2b61461053c5780634203e3951461055c5761036b565b80632f470764146104a55780633432423c146104ba5780633452d2d4146104da5761036b565b80631b7bde74116103495780631b7bde7414610416578063218b39c61461044357806324cc5749146104635780632a324027146104905761036b565b8063065d810f146103995780630676c1b7146103d457806317548b79146103f6575b34801561037757600080fd5b5060405162461bcd60e51b815260040161039090614e11565b60405180910390fd5b3480156103a557600080fd5b506103b96103b4366004614022565b6109f9565b6040516103cb96959493929190614f50565b60405180910390f35b3480156103e057600080fd5b506103e9610a39565b6040516103cb9190614971565b34801561040257600080fd5b506103e9610411366004614187565b610a48565b34801561042257600080fd5b50610436610431366004613fe8565b610a63565b6040516103cb9190614ef1565b34801561044f57600080fd5b506103e961045e366004613fca565b610a80565b34801561046f57600080fd5b5061048361047e366004613fca565b610a9b565b6040516103cb9190614b6f565b34801561049c57600080fd5b50610436610ab0565b3480156104b157600080fd5b50610436610ab6565b3480156104c657600080fd5b506103b96104d5366004614022565b610abc565b3480156104e657600080fd5b506104366104f5366004613fca565b610afc565b61050d6105083660046140ad565b610b0e565b6040516103cb93929190614eff565b34801561052857600080fd5b50610436610537366004613fca565b610b7c565b34801561054857600080fd5b5061048361055736600461408e565b610b8e565b34801561056857600080fd5b50610436610577366004613fca565b610bae565b34801561058857600080fd5b50610436610bc0565b34801561059d57600080fd5b50610436610bc6565b3480156105b257600080fd5b506105c66105c1366004614070565b610bcc565b6040516103cb93929190614f27565b3480156105e157600080fd5b50610436610bed565b3480156105f657600080fd5b5061060a610605366004613fe8565b610bf3565b6040516103cb959493929190614f35565b34801561062757600080fd5b50610483610636366004613fca565b610c2d565b34801561064757600080fd5b506103e9610656366004613fca565b610c42565b34801561066757600080fd5b506103e9610c5d565b34801561067c57600080fd5b50610436610c6c565b34801561069157600080fd5b506103e9610c72565b3480156106a657600080fd5b50610436610c81565b3480156106bb57600080fd5b50610483610c87565b3480156106d057600080fd5b506103e9610c90565b3480156106e557600080fd5b506103e96106f4366004613fca565b610c9f565b34801561070557600080fd5b50610483610cba565b34801561071a57600080fd5b50610436610729366004613fca565b610ce0565b34801561073a57600080fd5b50610436610cf2565b34801561074f57600080fd5b50610436610cf8565b34801561076457600080fd5b50610436610cfe565b34801561077957600080fd5b50610782610d04565b6040516103cb9190614cc2565b34801561079b57600080fd5b506104366107aa366004613fca565b610d13565b3480156107bb57600080fd5b506104366107ca366004613fca565b610d25565b3480156107db57600080fd5b506103e9610d37565b3480156107f057600080fd5b506103e9610d46565b34801561080557600080fd5b50610436610814366004613fca565b610d55565b34801561082557600080fd5b50610839610834366004614070565b610d67565b6040516103cb9c9b9a99989796959493929190614c0f565b34801561085d57600080fd5b5061087161086c366004613fca565b610dd9565b005b34801561087f57600080fd5b5061089361088e366004614070565b610eae565b6040516103cb989796959493929190614b98565b3480156108b357600080fd5b506104366108c2366004613fe8565b610f00565b3480156108d357600080fd5b506103e9610f1d565b3480156108e857600080fd5b50610436610f2c565b3480156108fd57600080fd5b5061043661090c366004613fca565b610f32565b34801561091d57600080fd5b506103e9610f44565b34801561093257600080fd5b50610436610f53565b34801561094757600080fd5b50610436610f59565b34801561095c57600080fd5b50610436610f63565b34801561097157600080fd5b50610871610980366004613fca565b610f69565b34801561099157600080fd5b50610436610f99565b3480156109a657600080fd5b50610436610f9f565b3480156109bb57600080fd5b506103e9610fa5565b3480156109d057600080fd5b506103e9610fb4565b3480156109e557600080fd5b5061050d6109f43660046140fa565b610fc3565b6009602090815260009283526040808420909152908252902080546001820154600283015460038401546004850154600590950154939492939192909186565b6031546001600160a01b031681565b6005602052600090815260409020546001600160a01b031681565b603b60209081526000928352604080842090915290825290205481565b6023602052600090815260409020546001600160a01b031681565b60326020526000908152604090205460ff1681565b60185481565b601f5481565b6008602090815260009283526040808420909152908252902080546001820154600283015460038401546004850154600590950154939492939192909186565b601a6020526000908152604090205481565b6000806000600160005414610b355760405162461bcd60e51b815260040161039090614e71565b6002600055603d5460ff1615610b5d5760405162461bcd60e51b815260040161039090614ce1565b610b68868686611044565b600160005591989097509095509350505050565b602a6020526000908152604090205481565b600a60209081526000928352604080842090915290825290205460ff1681565b60166020526000908152604090205481565b60155481565b60295481565b600c6020526000908152604090208054600182015460029092015490919083565b602b5481565b600b602090815260009283526040808420909152908252902080546001820154600283015460038401546004909401549293919290919085565b60266020526000908152604090205460ff1681565b6033602052600090815260409020546001600160a01b031681565b6003546001600160a01b031681565b60355481565b6002546001600160a01b031681565b601e5481565b603d5460ff1681565b6001546001600160a01b031690565b6022602052600090815260409020546001600160a01b031681565b6001546000906001600160a01b0316610cd1611503565b6001600160a01b031614905090565b60176020526000908152604090205481565b602c5481565b602f5481565b60205481565b602d546001600160a01b031681565b601d6020526000908152604090205481565b601c6020526000908152604090205481565b6037546001600160a01b031681565b6004546001600160a01b031681565b60366020526000908152604090205481565b600660208190526000918252604090912080546001820154600283015460038401546004850154600586015496860154600787015460088801546009890154600a8a0154600b909a0154989a9799969860ff909616979496949593949293919290916001600160a01b0391821691168c565b610de1610cba565b610dfd5760405162461bcd60e51b815260040161039090614dc1565b63366f513b60e01b600081905260056020527ff4ddf72383625730676ae80f4e72796030e502d9e3dce442215377f640213bd6546001600160a01b031690610e459083611507565b610e56637c6f10e960e11b83611507565b6f098dec2dc86d8dee6d2dccee6aed2e8d60831b826001600160a01b0316826001600160a01b03167f1420e3a2094d671bc2eb897941fa3d94ffa37f0cb6d530651946250a2151cb7f60405160405180910390a45050565b6007602052600090815260409020805460018201546002830154600384015460048501546005860154600690960154949560ff8516956101009095046001600160a01b03908116959481169493169288565b603c60209081526000928352604080842090915290825290205481565b6038546001600160a01b031681565b60275481565b60196020526000908152604090205481565b6014546001600160a01b031681565b601b5481565b6509184e72a00081565b60285481565b610f71610cba565b610f8d5760405162461bcd60e51b815260040161039090614dc1565b610f9681611583565b50565b60395481565b60215481565b602e546001600160a01b031681565b6030546001600160a01b031681565b6000806000600160005414610fea5760405162461bcd60e51b815260040161039090614e71565b6002600055603d5460ff16156110125760405162461bcd60e51b815260040161039090614ce1565b61102e8888888860405180602001604052806000815250611605565b6001600055919a90995090975095505050505050565b60008080836110655760405162461bcd60e51b815260040161039090614e01565b600060066000888152602001908152602001600020905060006007600083600101548152602001908152602001600020905061125c82604051806101800160405290816000820154815260200160018201548152602001600282015481526020016003820160009054906101000a900460ff16151515158152602001600482015481526020016005820154815260200160068201548152602001600782015481526020016008820154815260200160098201548152602001600a820160009054906101000a90046001600160a01b03166001600160a01b03166001600160a01b03168152602001600b820160009054906101000a90046001600160a01b03166001600160a01b03166001600160a01b0316815250508260405180610100016040529081600082015481526020016001820160009054906101000a900460ff161515151581526020016001820160019054906101000a90046001600160a01b0316600160