test-contracts-sovryn
Version:
Smart contracts for the Sovryn protocol and external integrations.
1,717 lines • 85 kB
JSON
{
"_format": "hh-sol-artifact-1",
"contractName": "Affiliates",
"sourceName": "contracts/modules/Affiliates.sol",
"abi": [
{
"inputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"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": "referrer",
"type": "address"
},
{
"indexed": false,
"internalType": "address",
"name": "trader",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "token",
"type": "address"
},
{
"indexed": true,
"internalType": "bool",
"name": "isHeld",
"type": "bool"
},
{
"indexed": false,
"internalType": "uint256",
"name": "tradingFeeTokenAmount",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "tokenBonusAmount",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "sovBonusAmount",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "sovBonusAmountPaid",
"type": "uint256"
}
],
"name": "PayTradingFeeToAffiliate",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "referrer",
"type": "address"
},
{
"indexed": false,
"internalType": "address",
"name": "trader",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "token",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "tradingFeeTokenAmount",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "tokenBonusAmount",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "sovBonusAmount",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "sovBonusAmountTryingToPaid",
"type": "uint256"
}
],
"name": "PayTradingFeeToAffiliateFail",
"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": "referrer",
"type": "address"
}
],
"name": "SetAffiliatesReferrer",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "user",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "referrer",
"type": "address"
},
{
"indexed": false,
"internalType": "bool",
"name": "alreadySet",
"type": "bool"
},
{
"indexed": false,
"internalType": "bool",
"name": "userNotFirstTrade",
"type": "bool"
}
],
"name": "SetAffiliatesReferrerFail",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "user",
"type": "address"
}
],
"name": "SetUserNotFirstTradeFlag",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "referrer",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "receiver",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "tokenAddress",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "amount",
"type": "uint256"
}
],
"name": "WithdrawAffiliatesReferrerTokenFees",
"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": 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": "referrer",
"type": "address"
}
],
"name": "getAffiliateRewardsHeld",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "getAffiliateTradingTokenFeePercent",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"internalType": "address",
"name": "referrer",
"type": "address"
}
],
"name": "getAffiliatesReferrerBalances",
"outputs": [
{
"internalType": "address[]",
"name": "referrerTokensList",
"type": "address[]"
},
{
"internalType": "uint256[]",
"name": "referrerTokensBalances",
"type": "uint256[]"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"internalType": "address",
"name": "referrer",
"type": "address"
},
{
"internalType": "address",
"name": "token",
"type": "address"
}
],
"name": "getAffiliatesReferrerTokenBalance",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"internalType": "address",
"name": "referrer",
"type": "address"
}
],
"name": "getAffiliatesReferrerTokensList",
"outputs": [
{
"internalType": "address[]",
"name": "tokensList",
"type": "address[]"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"internalType": "address",
"name": "referrer",
"type": "address"
}
],
"name": "getAffiliatesTokenRewardsValueInRbtc",
"outputs": [
{
"internalType": "uint256",
"name": "rbtcTotalAmount",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"internalType": "address",
"name": "user",
"type": "address"
}
],
"name": "getAffiliatesUserReferrer",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "getMinReferralsToPayout",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"internalType": "address",
"name": "referrer",
"type": "address"
}
],
"name": "getReferralsList",
"outputs": [
{
"internalType": "address[]",
"name": "refList",
"type": "address[]"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"internalType": "address",
"name": "user",
"type": "address"
}
],
"name": "getUserNotFirstTradeFlag",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"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": false,
"inputs": [
{
"internalType": "address",
"name": "referrer",
"type": "address"
},
{
"internalType": "address",
"name": "trader",
"type": "address"
},
{
"internalType": "address",
"name": "token",
"type": "address"
},
{
"internalType": "uint256",
"name": "tradingFeeTokenBaseAmount",
"type": "uint256"
}
],
"name": "payTradingFeeToAffiliatesReferrer",
"outputs": [
{
"internalType": "uint256",
"name": "referrerBonusSovAmount",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "referrerBonusTokenAmount",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "nonpayable",
"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": "address",
"name": "user",
"type": "address"
},
{
"internalType": "address",
"name": "referrer",
"type": "address"
}
],
"name": "setAffiliatesReferrer",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"internalType": "address",
"name": "user",
"type": "address"
}
],
"name": "setUserNotFirstTradeFlag",
"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": false,
"inputs": [
{
"internalType": "address",
"name": "token",
"type": "address"
},
{
"internalType": "address",
"name": "receiver",
"type": "address"
},
{
"internalType": "uint256",
"name": "amount",
"type": "uint256"
}
],
"name": "withdrawAffiliatesReferrerTokenFees",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"internalType": "address",
"name": "receiver",
"type": "address"
}
],
"name": "withdrawAllAffiliatesReferrerTokenFees",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "wrbtcToken",
"outputs": [
{
"internalType": "contract IWrbtcERC20",
"name": "",
"type": "address"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
}
],
"bytecode": "0x60806040526001600055678ac7230489e80000601555670214e8348c4f000060185567013fbe85edc90000601b55674563918244f40000602055674563918244f40000602155674563918244f400006027556127106028556802b5e3af16b1880000602955650f478e084000602b5567016345785d8a0000602c556802b5e3af16b1880000602f5560036035556801158e460913d000006039553480156100a557600080fd5b5060006100b96001600160e01b0361010c16565b600180546001600160a01b0319166001600160a01b038316908117909155604051919250906000907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a350610110565b3390565b612e6c80620001206000396000f3fe608060405234801561001057600080fd5b50600436106103fc5760003560e01c806392d894f811610215578063c9ddf44811610125578063edab119f116100b8578063f2fde38b11610087578063f2fde38b14610872578063f589a3e714610885578063f6ddc8b31461088d578063f706b1f214610895578063f851a4401461089d576103fc565b8063edab119f1461082e578063f06a9c6b14610836578063f0e085f514610849578063f19ece6f14610851576103fc565b8063d473c2da116100f4578063d473c2da146107f8578063d485045e14610800578063d80100ea14610813578063e8f6276414610826576103fc565b8063c9ddf448146107a3578063cb6eacd1146107b6578063cd5d808d146107dd578063d288208c146107f0576103fc565b8063b05f6570116101a8578063b9cffa3e11610177578063b9cffa3e14610742578063ba4861e91461074a578063bdee453c14610752578063c4a9081514610765578063c4d66de814610790576103fc565b8063b05f657014610701578063b30643d914610714578063b41263b614610727578063b7e152411461072f576103fc565b8063acc04348116101e4578063acc04348146106c9578063adfcbc98146106d1578063ae0a8530146106e4578063afe84009146106ec576103fc565b806392d894f814610686578063959083d314610699578063a22473a2146106a1578063ac92fd8e146106b4576103fc565b80634699f84611610310578063742e6798116102a35780638417a2ae116102725780638417a2ae146106485780638456cb591461065b5780638da5cb5b146106635780638dc48ba51461066b5780638f32d59b1461067e576103fc565b8063742e67981461062857806378d849ed146106305780637a8faeb814610638578063824fcdc914610640576103fc565b806362fff3f6116102df57806362fff3f6146105d657806368c4ac26146105fa5780636e6637301461060d5780637420ca3e14610620576103fc565b80634699f8461461059c5780634f28cac2146105a4578063569fc1fb146105ac578063574442cc146105ce576103fc565b8063249556fb116103935780633432423c116103625780633432423c1461053d5780633452d2d4146105505780633fca506e146105635780634115a2b6146105765780634203e39514610589576103fc565b8063249556fb146104fa57806324cc57491461050d5780632a3240271461052d5780632f47076414610535576103fc565b806317548b79116103cf57806317548b79146104945780631b7bde74146104a75780631c9f66c2146104c7578063218b39c6146104e7576103fc565b8063065d810f1461041d5780630676c1b71461044b5780630d4d11fe14610460578063115cc0ce14610481575b60405162461bcd60e51b815260040161041490612c56565b60405180910390fd5b61043061042b366004612482565b6108a5565b60405161044296959493929190612d1b565b60405180910390f35b6104536108e5565b60405161044291906129c1565b61047361046e3660046123d4565b6108f4565b604051610442929190612ce4565b61045361048f36600461237c565b610ccf565b6104536104a236600461250d565b610ced565b6104ba6104b536600461239a565b610d08565b6040516104429190612cd6565b6104da6104d536600461237c565b610d25565b6040516104429190612a5e565b6104536104f536600461237c565b610d4f565b6104da61050836600461237c565b610d6a565b61052061051b36600461237c565b610d8e565b6040516104429190612a94565b6104ba610da3565b6104ba610da9565b61043061054b366004612482565b610daf565b6104ba61055e36600461237c565b610def565b6104ba61057136600461237c565b610e01565b6105206105843660046124ee565b610e13565b6104ba61059736600461237c565b610e33565b6104ba610e45565b6104ba610e4b565b6105bf6105ba3660046124d0565b610e51565b60405161044293929190612cf2565b6104ba610e72565b6105e96105e436600461239a565b610e78565b604051610442959493929190612d0d565b61052061060836600461237c565b610eb2565b61045361061b36600461237c565b610ec7565b610453610ee2565b6104ba610ef1565b610453610ef7565b6104ba610f06565b6104ba610f0c565b6104ba61065636600461237c565b610f12565b610520610f2d565b610453610f36565b61045361067936600461237c565b610f45565b610520610f60565b6104ba61069436600461237c565b610f86565b6104ba610f98565b6104ba6106af36600461239a565b610f9e565b6106c76106c2366004612435565b610fc9565b005b6104ba611178565b6106c76106df36600461237c565b61117e565b6104ba61126b565b6106f4611271565b6040516104429190612be7565b61052061070f36600461237c565b611280565b6104ba61072236600461237c565b61129e565b6104ba6112b0565b6104ba61073d36600461237c565b6112b6565b6104536112c8565b6104536112d7565b6104ba61076036600461237c565b6112e6565b6107786107733660046124d0565b6112f8565b6040516104429c9b9a99989796959493929190612b34565b6106c761079e36600461237c565b61136a565b6106c76107b136600461239a565b611516565b6107c96107c43660046124d0565b6116c0565b604051610442989796959493929190612abd565b6104ba6107eb36600461239a565b611712565b61045361172f565b6104ba61173e565b6104ba61080e36600461237c565b611744565b6104ba61082136600461237c565b611756565b6104536118da565b6104ba6118e9565b6106c761084436600461237c565b6118ef565b6104ba6119b4565b61086461085f36600461237c565b6119ba565b604051610442929190612a6f565b6106c761088036600461237c565b611a44565b6104ba611a71565b6104ba611a77565b610453611a7d565b610453611a8c565b6009602090815260009283526040808420909152908252902080546001820154600283015460038401546004850154600590950154939492939192909186565b6031546001600160a01b031681565b60315460009081906001600160a01b031633146109235760405162461bcd60e51b815260040161041490612c76565b603d5460ff16156109465760405162461bcd60e51b815260040161041490612c16565b60006109506112b0565b6001600160a01b038816600090815260346020526040902061097190611a9b565b1090506001600061098186611aa2565b6001600160a01b038a166000908152603a602052604090209094506109ac908863ffffffff611ad516565b6109da576001600160a01b0389166000908152603a602052604090206109d8908863ffffffff611af316565b505b6001600160a01b03808a166000908152603b60209081526040808320938b1683529290522054610a10908563ffffffff611b5316565b6001600160a01b03808b166000908152603b60209081526040808320938c1683529290522055610a408787611b7f565b6001600160a01b038a166000908152603660205260409020549095508315610a9057610a72818763ffffffff611b5316565b6001600160a01b038b16600090815260366020526040902055610c0d565b6001600160a01b038a1660009081526036602052604090205415610ac8576001600160a01b038a166000908152603660205260408120555b610ad8868263ffffffff611b5316565b60375460385460405163095ea7b360e01b81529294506001600160a01b039182169263095ea7b392610b1092169086906004016129f7565b602060405180830381600087803b158015610b2a57600080fd5b505af1158015610b3e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610b6291908101906124b2565b506038546040516000916001600160a01b031690610b86908d9086906024016129f7565b60408051601f198184030181529181526020820180516001600160e01b031663f33bf9a160e01b17905251610bbb91906129b5565b6000604051808303816000865af19150503d8060008114610bf8576040519150601f19603f3d011682016040523d82523d6000602084013e610bfd565b606091505b5050905080610c0b57600093505b505b8215610c6e57831515886001600160a01b03168b6001600160a01b03167f956d8d442c76f1bedc4178cda59c4ad17c135bd6ec5a603a39fbfe5a320dbbc08c8b8a8c89604051610c61959493929190612a12565b60405180910390a4610cc2565b876001600160a01b03168a6001600160a01b03167f0909aef8097f3ad1e03459f173d44656bde668485239e8d83d9dcbc8af63d1408b8a898b88604051610cb9959493929190612a12565b60405180910390a35b5050505094509492505050565b6001600160a01b039081166000908152603360205260409020541690565b6005602052600090815260409020546001600160a01b031681565b603b60209081526000928352604080842090915290825290205481565b6001600160a01b0381166000908152603a60205260409020606090610d4990611c7f565b92915050565b6023602052600090815260409020546001600160a01b031681565b6001600160a01b0381166000908152603460205260409020606090610d4990611c7f565b60326020526000908152604090205460ff1681565b60185481565b601f5481565b6008602090815260009283526040808420909152908252902080546001820154600283015460038401546004850154600590950154939492939192909186565b601a6020526000908152604090205481565b602a6020526000908152604090205481565b600a60209081526000928352604080842090915290825290205460ff1681565b60166020526000908152604090205481565b60155481565b60295481565b600c6020526000908152604090208054600182015460029092015490919083565b602b5481565b600b602090815260009283526040808420909152908252902080546001820154600283015460038401546004909401549293919290919085565b60266020526000908152604090205460ff1681565b6033602052600090815260409020546001600160a01b031681565b6003546001600160a01b031681565b60355481565b6002546001600160a01b031681565b601e5481565b60395490565b6001600160a01b031660009081526036602052604090205490565b603d5460ff1681565b6001546001600160a01b031690565b6022602052600090815260409020546001600160a01b031681565b6001546000906001600160a01b0316610f77611d25565b6001600160a01b031614905090565b60176020526000908152604090205481565b602c5481565b6001600160a01b039182166000908152603b6020908152604080832093909416825291909152205490565b603d5460ff1615610fec5760405162461bcd60e51b815260040161041490612c16565b6001600160a01b0382166110125760405162461bcd60e51b815260040161041490612ca6565b336000818152603b602090815260408083206001600160a01b0388168452909152812054908382116110445781611046565b835b9050600081116110685760405162461bcd60e51b815260040161041490612c36565b6110706112b0565b6001600160a01b038416600090815260346020526040902061109190611a9b565b10156110af5760405162461bcd60e51b815260040161041490612c06565b60006110c1838363ffffffff611d2916565b9050806110d7576110d28488611d6b565b611100565b6001600160a01b038085166000908152603b60209081526040808320938b168352929052208190555b61111a6001600160a01b038816878463ffffffff611dae16565b866001600160a01b0316866001600160a01b0316856001600160a01b03167f7e121a301046a79dbdc6bb475ff36f651f88a7cb91fefd7cb8aa4b9f4a33b20b856040516111679190612cd6565b60405180910390a450505050505050565b602f5481565b603d5460ff16156111a15760405162461bcd60e51b815260040161041490612c16565b6001600160a01b0381166111c75760405162461bcd60e51b815260040161041490612ca6565b336111d06112b0565b6001600160a01b03821660009081526034602052604090206111f190611a9b565b101561120f5760405162461bcd60e51b815260040161041490612c06565b60608061121b836119ba565b9150915060005b82518110156112645761125c83828151811061123a57fe5b60200260200101518684848151811061124f57fe5b6020026020010151610fc9565b600101611222565b5050505050565b60205481565b602d546001600160a01b031681565b6001600160a01b031660009081526032602052604090205460ff1690565b601d6020526000908152604090205481565b60355490565b601c6020526000908152604090205481565b6037546001600160a01b031681565b6004546001600160a01b031681565b60366020526000908152604090205481565b600660208190526000918252604090912080546001820154600283015460038401546004850154600586015496860154600787015460088801546009890154600a8a0154600b909a0154989a9799969860ff909616979496949593949293919290916001600160a01b0391821691168c565b611372610f60565b61138e5760405162461bcd60e51b815260040161041490612c96565b63193bbe8960e31b600081905260056020527fa32428c5f7f1f49cbf6b6f0ae7823841efc255f4d2b6125ce4b307c53dc525c7546001600160a01b0316906113d69083611e07565b6113e7630b05f65760e41b83611e07565b6113f863249556fb60e01b83611e07565b61140963f06a9c6b60e01b83611e07565b61141a6306a688ff60e11b83611e07565b61142b63f19ece6f60e01b83611e07565b61143c63511239d160e11b83611e07565b61144d630e4fb36160e11b83611e07565b61145e6356497ec760e11b83611e07565b61146f6315bf979360e31b83611e07565b611480635a0931db60e11b83611e07565b6114916308ae606760e11b83611e07565b6114a263420bd15760e11b83611e07565b6114b363824fcdc960e01b83611e07565b6114c4636c00807560e11b83611e07565b69416666696c696174657360b01b826001600160a01b0316826001600160a01b03167f1420e3a2094d671bc2eb897941fa3d94ffa37f0cb6d530651946250a2151cb7f60405160405180910390a45050565b336000908152602260205260409020546001600160a01b031661154b5760405162461bcd60e51b815260040161041490612c76565b603d5460ff161561156e5760405162461bcd60e51b815260040161041490612c16565b611576612330565b61157f83611280565b151560408083019182526001600160a01b03858116600090815260336020908152929020541615159083015251806115b8575080602001515b806115d45750816001600160a01b0316836001600160a01b0316145b1580825215611665576001600160a01b03838116600090815260336020908152604080832080546001600160a01b0319169487169485179055928252603490522061161f9084611af3565b50816001600160a01b0316836001600160a01b03167f01085a2bdafb7e1bf8c2744a99befcb7d35fd44ce0fec8273e65687bf69b40d260405160405180910390a36116bb565b816001600160a01b0316836001600160a01b03167f5fcda235bf45571cdfcce3194fdec51249320ea208d33ddf19457f971fbce052836020015184604001516040516116b2929190612aa2565b60405180910390a35b505050565b6007602052600090815260409020805460018201546002830154600384015460048501546005860154600690960154949560ff8516956101009095046001600160a01b03908116959481169493169288565b603c60209081526000928352604080842090915290825290205481565b6038546001600160a01b031681565b60275481565b60196020526000908152604090205481565b6000606061176383610d25565b6002549091506001600160a01b031660005b82518110156118d25782516000906060906001600160a01b0385169063d138f9a160e01b908790869081106117a657fe5b6020026020010151602d60009054906101000a90046001600160a01b0316603b60008c6001600160a01b03166001600160a01b0316815260200190815260200160002060008a89815181106117f757fe5b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002054604051602401611832939291906129cf565b60408051601f198184030181529181526020820180516001600160e01b03166001600160e01b031990941693909317909252905161187091906129b5565b600060405180830381855afa9150503d80600081146118ab576040519150601f19603f3d011682016040523d82523d6000602084013e6