test-contracts-sovryn
Version:
Smart contracts for the Sovryn protocol and external integrations.
1,915 lines • 122 kB
JSON
{
"_format": "hh-sol-artifact-1",
"contractName": "LoanOpenings",
"sourceName": "contracts/modules/LoanOpenings.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": "loanToken",
"type": "address"
},
{
"indexed": false,
"internalType": "address",
"name": "collateralToken",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "newPrincipal",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "newCollateral",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "interestRate",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "interestDuration",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "collateralToLoanRate",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "currentMargin",
"type": "uint256"
}
],
"name": "Borrow",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "bytes32",
"name": "loanId",
"type": "bytes32"
},
{
"indexed": true,
"internalType": "address",
"name": "delegator",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "delegated",
"type": "address"
},
{
"indexed": false,
"internalType": "bool",
"name": "isActive",
"type": "bool"
}
],
"name": "DelegatedManagerSet",
"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": "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": "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": "uint256",
"name": "positionSize",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "borrowedAmount",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "interestRate",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "settlementDate",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "entryPrice",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "entryLeverage",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "currentLeverage",
"type": "uint256"
}
],
"name": "Trade",
"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"
},
{
"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": false,
"inputs": [
{
"internalType": "bytes32",
"name": "loanParamsId",
"type": "bytes32"
},
{
"internalType": "bytes32",
"name": "loanId",
"type": "bytes32"
},
{
"internalType": "bool",
"name": "isTorqueLoan",
"type": "bool"
},
{
"internalType": "uint256",
"name": "initialMargin",
"type": "uint256"
},
{
"internalType": "address[4]",
"name": "sentAddresses",
"type": "address[4]"
},
{
"internalType": "uint256[5]",
"name": "sentValues",
"type": "uint256[5]"
},
{
"internalType": "bytes",
"name": "loanDataBytes",
"type": "bytes"
}
],
"name": "borrowOrTradeFromPool",
"outputs": [
{
"internalType": "uint256",
"name": "newPrincipal",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "newCollateral",
"type": "uint256"
}
],
"payable": true,
"stateMutability": "payable",
"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": 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": true,
"inputs": [
{
"internalType": "address",
"name": "loanToken",
"type": "address"
},
{
"internalType": "address",
"name": "collateralToken",
"type": "address"
},
{
"internalType": "uint256",
"name": "collateralTokenAmount",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "marginAmount",
"type": "uint256"
},
{
"internalType": "bool",
"name": "isTorqueLoan",
"type": "bool"
}
],
"name": "getBorrowAmount",
"outputs": [
{
"internalType": "uint256",
"name": "borrowAmount",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"internalType": "address",
"name": "loanToken",
"type": "address"
},
{
"internalType": "address",
"name": "collateralToken",
"type": "address"
},
{
"internalType": "uint256",
"name": "loanTokenSent",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "collateralTokenSent",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "interestRate",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "newPrincipal",
"type": "uint256"
}
],
"name": "getEstimatedMarginExposure",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"internalType": "address",
"name": "loanToken",
"type": "address"
},
{
"internalType": "address",
"name": "collateralToken",
"type": "address"
},
{
"internalType": "uint256",
"name": "newPrincipal",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "marginAmount",
"type": "uint256"
},
{
"internalType": "bool",
"name": "isTorqueLoan",
"type": "bool"
}
],
"name": "getRequiredCollateral",
"outputs": [
{
"internalType": "uint256",
"name": "collateralAmountRequired",
"type": "uint256"
}
],
"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": "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": false,
"inputs": [
{
"internalType": "bytes32",
"name": "loanId",
"type": "bytes32"
},
{
"internalType": "address",
"name": "delegated",
"type": "address"
},
{
"internalType": "bool",
"name": "toggle",
"type": "bool"
}
],
"name": "setDelegatedManager",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"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": "0x60806040526001600055678ac7230489e80000601555670214e8348c4f000060185567013fbe85edc90000601b55674563918244f40000602055674563918244f40000602155674563918244f400006027556127106028556802b5e3af16b1880000602955650f478e084000602b5567016345785d8a0000602c556802b5e3af16b1880000602f5560036035556801158e460913d00000603955348015620000a657600080fd5b506000620000bc6001600160e01b036200011016565b600180546001600160a01b0319166001600160a01b038316908117909155604051919250906000907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a35062000114565b3390565b614de880620001246000396000f3fe6080604052600436106103815760003560e01c80638dc48ba5116101d1578063cb6eacd111610102578063e8f62764116100a0578063f589a3e71161006f578063f589a3e714610a05578063f6ddc8b314610a1a578063f706b1f214610a2f578063f851a44014610a4457610381565b8063e8f62764146109a6578063edab119f146109bb578063f0e085f5146109d0578063f2fde38b146109e557610381565b8063d473c2da116100dc578063d473c2da14610931578063d485045e14610946578063d67f707714610966578063e762319f1461098657610381565b8063cb6eacd1146108c8578063cd5d808d146108fc578063d288208c1461091c57610381565b8063b30643d91161016f578063ba4861e911610149578063ba4861e91461083b578063bdee453c14610850578063c4a9081514610870578063c4d66de8146108a857610381565b8063b30643d9146107e6578063b7e1524114610806578063b9cffa3e1461082657610381565b8063959083d3116101ab578063959083d314610785578063acc043481461079a578063ae0a8530146107af578063afe84009146107c457610381565b80638dc48ba5146107305780638f32d59b1461075057806392d894f81461076557610381565b80634203e395116102b657806368c4ac261161025457806378d849ed1161022357806378d849ed146106dc5780637a8faeb8146106f15780638456cb59146107065780638da5cb5b1461071b57610381565b806368c4ac26146106725780636e663730146106925780637420ca3e146106b2578063742e6798146106c757610381565b8063569fc1fb11610290578063569fc1fb146105dc578063574442cc1461060b578063585314cf1461062057806362fff3f61461064157610381565b80634203e395146105925780634699f846146105b25780634f28cac2146105c757610381565b80632a324027116103235780633432423c116102fd5780633432423c146105125780633452d2d4146105325780633fca506e146105525780634115a2b61461057257610381565b80632a324027146104c65780632f470764146104db57806333d8991f146104f057610381565b80631b7bde741161035f5780631b7bde741461042c578063218b39c61461045957806324cc57491461047957806325decac0146104a657610381565b8063065d810f146103af5780630676c1b7146103ea57806317548b791461040c575b34801561038d57600080fd5b5060405162461bcd60e51b81526004016103a690614b91565b60405180910390fd5b3480156103bb57600080fd5b506103cf6103ca366004613c4a565b610a59565b6040516103e196959493929190614c86565b60405180910390f35b3480156103f657600080fd5b506103ff610a99565b6040516103e1919061462e565b34801561041857600080fd5b506103ff610427366004613ddd565b610aa8565b34801561043857600080fd5b5061044c610447366004613b14565b610ac3565b6040516103e19190614c41565b34801561046557600080fd5b506103ff610474366004613af6565b610ae0565b34801561048557600080fd5b50610499610494366004613af6565b610afb565b6040516103e191906148ee565b3480156104b257600080fd5b5061044c6104c1366004613b4e565b610b10565b3480156104d257600080fd5b5061044c610b6b565b3480156104e757600080fd5b5061044c610b71565b3480156104fc57600080fd5b5061051061050b366004613cd5565b610b77565b005b34801561051e57600080fd5b506103cf61052d366004613c4a565b610be4565b34801561053e57600080fd5b5061044c61054d366004613af6565b610c24565b34801561055e57600080fd5b5061044c61056d366004613af6565b610c36565b34801561057e57600080fd5b5061049961058d366004613cb6565b610c48565b34801561059e57600080fd5b5061044c6105ad366004613af6565b610c68565b3480156105be57600080fd5b5061044c610c7a565b3480156105d357600080fd5b5061044c610c80565b3480156105e857600080fd5b506105fc6105f7366004613c98565b610c86565b6040516103e193929190614c5d565b34801561061757600080fd5b5061044c610ca7565b61063361062e366004613d22565b610cad565b6040516103e1929190614c4f565b34801561064d57600080fd5b5061066161065c366004613b14565b610eee565b6040516103e1959493929190614c6b565b34801561067e57600080fd5b5061049961068d366004613af6565b610f28565b34801561069e57600080fd5b506103ff6106ad366004613af6565b610f3d565b3480156106be57600080fd5b506103ff610f58565b3480156106d357600080fd5b5061044c610f67565b3480156106e857600080fd5b506103ff610f6d565b3480156106fd57600080fd5b5061044c610f7c565b34801561071257600080fd5b50610499610f82565b34801561072757600080fd5b506103ff610f8b565b34801561073c57600080fd5b506103ff61074b366004613af6565b610f9a565b34801561075c57600080fd5b50610499610fb5565b34801561077157600080fd5b5061044c610780366004613af6565b610fdb565b34801561079157600080fd5b5061044c610fed565b3480156107a657600080fd5b5061044c610ff3565b3480156107bb57600080fd5b5061044c610ff9565b3480156107d057600080fd5b506107d9610fff565b6040516103e191906149f2565b3480156107f257600080fd5b5061044c610801366004613af6565b61100e565b34801561081257600080fd5b5061044c610821366004613af6565b611020565b34801561083257600080fd5b506103ff611032565b34801561084757600080fd5b506103ff611041565b34801561085c57600080fd5b5061044c61086b366004613af6565b611050565b34801561087c57600080fd5b5061089061088b366004613c98565b611062565b6040516103e19c9b9a9998979695949392919061493f565b3480156108b457600080fd5b506105106108c3366004613af6565b6110d4565b3480156108d457600080fd5b506108e86108e3366004613c98565b6111d7565b6040516103e19897969594939291906148fc565b34801561090857600080fd5b5061044c610917366004613b14565b611229565b34801561092857600080fd5b506103ff611246565b34801561093d57600080fd5b5061044c611255565b34801561095257600080fd5b5061044c610961366004613af6565b61125b565b34801561097257600080fd5b5061044c610981366004613bc3565b61126d565b34801561099257600080fd5b5061044c6109a1366004613b4e565b61133b565b3480156109b257600080fd5b506103ff6114af565b3480156109c757600080fd5b5061044c6114be565b3480156109dc57600080fd5b5061044c6114c4565b3480156109f157600080fd5b50610510610a00366004613af6565b6114ca565b348015610a1157600080fd5b5061044c6114fa565b348015610a2657600080fd5b5061044c611500565b348015610a3b57600080fd5b506103ff611506565b348015610a5057600080fd5b506103ff611515565b6009602090815260009283526040808420909152908252902080546001820154600283015460038401546004850154600590950154939492939192909186565b6031546001600160a01b031681565b6005602052600090815260409020546001600160a01b031681565b603b60209081526000928352604080842090915290825290205481565b6023602052600090815260409020546001600160a01b031681565b60326020526000908152604090205460ff1681565b60008215610b6257610b258686868686611524565b9050600082610b3c57610b378261165d565b610b45565b610b4582611693565b90508015610b6057610b5d828263ffffffff6116b716565b91505b505b95945050505050565b60185481565b601f5481565b603d5460ff1615610b9a5760405162461bcd60e51b81526004016103a690614a21565b6000838152600660205260409020600a01546001600160a01b03163314610bd35760405162461bcd60e51b81526004016103a690614b51565b610bdf833384846116e3565b505050565b6008602090815260009283526040808420909152908252902080546001820154600283015460038401546004850154600590950154939492939192909186565b601a6020526000908152604090205481565b602a6020526000908152604090205481565b600a60209081526000928352604080842090915290825290205460ff1681565b60166020526000908152604090205481565b60155481565b60295481565b600c6020526000908152604090208054600182015460029092015490919083565b602b5481565b600080600160005414610cd25760405162461bcd60e51b81526004016103a690614bc1565b6002600055603d5460ff1615610cfa5760405162461bcd60e51b81526004016103a690614a21565b341580610d0657508215155b610d225760405162461bcd60e51b81526004016103a690614bf1565b336000908152602260205260409020546001600160a01b0316610d575760405162461bcd60e51b81526004016103a690614b31565b610d5f6139a1565b5060008a815260076020908152604091829020825161010080820185528254808352600184015460ff811615159584019590955293046001600160a01b039081169482019490945260028201548416606082015260038201549093166080840152600481015460a0840152600581015460c08401526006015460e0830152610df95760405162461bcd60e51b81526004016103a690614b81565b60608101516080820151600091610e169160208a01358c8e611524565b905080610e355760405162461bcd60e51b81526004016103a690614b21565b610ed6828c8c848d8d6004806020026040519081016040528092919082600460200280828437600092019190915250506040805160a081810190925291508f906005908390839080828437600081840152601f19601f8201169050808301925050505050508d8d8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061175892505050565b6001600055909d909c509a5050505050505050505050565b600b602090815260009283526040808420909152908252902080546001820154600283015460038401546004909401549293919290919085565b60266020526000908152604090205460ff1681565b6033602052600090815260409020546001600160a01b031681565b6003546001600160a01b031681565b60355481565b6002546001600160a01