@ensuro/price-risk-module
Version:
Price Risk Module for the Ensuro Protocol
1,128 lines • 122 kB
JSON
{
"_format": "hh-sol-artifact-1",
"contractName": "PriceRiskModule",
"sourceName": "contracts/PriceRiskModule.sol",
"abi": [
{
"inputs": [
{
"internalType": "contract IPolicyPool",
"name": "policyPool_",
"type": "address"
},
{
"internalType": "contract IPremiumsAccount",
"name": "premiumsAccount_",
"type": "address"
},
{
"internalType": "uint256",
"name": "slotSize_",
"type": "uint256"
}
],
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"inputs": [],
"name": "ExposureLimitCannotBeLessThanActiveExposure",
"type": "error"
},
{
"inputs": [],
"name": "NoZeroPolicyPool",
"type": "error"
},
{
"inputs": [],
"name": "NoZeroWallet",
"type": "error"
},
{
"inputs": [],
"name": "PremiumsAccountMustBePartOfThePool",
"type": "error"
},
{
"inputs": [],
"name": "UpgradeCannotChangePolicyPool",
"type": "error"
},
{
"inputs": [],
"name": "UpgradeCannotChangePremiumsAccount",
"type": "error"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "address",
"name": "previousAdmin",
"type": "address"
},
{
"indexed": false,
"internalType": "address",
"name": "newAdmin",
"type": "address"
}
],
"name": "AdminChanged",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "beacon",
"type": "address"
}
],
"name": "BeaconUpgraded",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "enum IAccessManager.GovernanceActions",
"name": "action",
"type": "uint8"
},
{
"indexed": false,
"internalType": "address",
"name": "value",
"type": "address"
}
],
"name": "ComponentChanged",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "enum IAccessManager.GovernanceActions",
"name": "action",
"type": "uint8"
},
{
"indexed": false,
"internalType": "uint256",
"name": "value",
"type": "uint256"
}
],
"name": "GovernanceAction",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "uint8",
"name": "version",
"type": "uint8"
}
],
"name": "Initialized",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "customer",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "policyId",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "triggerPrice",
"type": "uint256"
},
{
"indexed": false,
"internalType": "bool",
"name": "lower",
"type": "bool"
}
],
"name": "NewPricePolicy",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "address",
"name": "account",
"type": "address"
}
],
"name": "Paused",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "address",
"name": "account",
"type": "address"
}
],
"name": "Unpaused",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "implementation",
"type": "address"
}
],
"name": "Upgraded",
"type": "event"
},
{
"inputs": [],
"name": "GUARDIAN_ROLE",
"outputs": [
{
"internalType": "bytes32",
"name": "",
"type": "bytes32"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "LEVEL1_ROLE",
"outputs": [
{
"internalType": "bytes32",
"name": "",
"type": "bytes32"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "LEVEL2_ROLE",
"outputs": [
{
"internalType": "bytes32",
"name": "",
"type": "bytes32"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "LEVEL3_ROLE",
"outputs": [
{
"internalType": "bytes32",
"name": "",
"type": "bytes32"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "ORACLE_ADMIN_ROLE",
"outputs": [
{
"internalType": "bytes32",
"name": "",
"type": "bytes32"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "PRICER_ROLE",
"outputs": [
{
"internalType": "bytes32",
"name": "",
"type": "bytes32"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "PRICE_SLOTS",
"outputs": [
{
"internalType": "uint8",
"name": "",
"type": "uint8"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "RM_PROVIDER_ROLE",
"outputs": [
{
"internalType": "bytes32",
"name": "",
"type": "bytes32"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "TWEAK_EXPIRATION",
"outputs": [
{
"internalType": "uint40",
"name": "",
"type": "uint40"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "activeExposure",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "currency",
"outputs": [
{
"internalType": "contract IERC20Metadata",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "exposureLimit",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "int40",
"name": "duration",
"type": "int40"
}
],
"name": "getCDF",
"outputs": [
{
"components": [
{
"internalType": "uint64",
"name": "lossProb",
"type": "uint64"
},
{
"internalType": "uint64",
"name": "jrCollRatio",
"type": "uint64"
},
{
"internalType": "uint64",
"name": "collRatio",
"type": "uint64"
}
],
"internalType": "struct IPriceRiskModule.SlotPricing[30]",
"name": "ret",
"type": "tuple[30]"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "payout",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "lossProb",
"type": "uint256"
},
{
"internalType": "uint40",
"name": "expiration",
"type": "uint40"
}
],
"name": "getMinimumPremium",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "payout",
"type": "uint256"
},
{
"components": [
{
"internalType": "uint64",
"name": "lossProb",
"type": "uint64"
},
{
"internalType": "uint64",
"name": "jrCollRatio",
"type": "uint64"
},
{
"internalType": "uint64",
"name": "collRatio",
"type": "uint64"
}
],
"internalType": "struct IPriceRiskModule.SlotPricing",
"name": "pricing",
"type": "tuple"
},
{
"internalType": "uint40",
"name": "expiration",
"type": "uint40"
}
],
"name": "getMinimumPremiumForPricing",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "policyId",
"type": "uint256"
}
],
"name": "getPolicyData",
"outputs": [
{
"components": [
{
"components": [
{
"internalType": "uint256",
"name": "id",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "payout",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "premium",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "jrScr",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "srScr",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "lossProb",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "purePremium",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "ensuroCommission",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "partnerCommission",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "jrCoc",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "srCoc",
"type": "uint256"
},
{
"internalType": "contract IRiskModule",
"name": "riskModule",
"type": "address"
},
{
"internalType": "uint40",
"name": "start",
"type": "uint40"
},
{
"internalType": "uint40",
"name": "expiration",
"type": "uint40"
}
],
"internalType": "struct Policy.PolicyData",
"name": "ensuroPolicy",
"type": "tuple"
},
{
"internalType": "uint256",
"name": "triggerPrice",
"type": "uint256"
},
{
"internalType": "bool",
"name": "lower",
"type": "bool"
}
],
"internalType": "struct PriceRiskModule.PolicyData",
"name": "",
"type": "tuple"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "string",
"name": "name_",
"type": "string"
},
{
"internalType": "uint256",
"name": "collRatio_",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "ensuroPpFee_",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "srRoc_",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "maxPayoutPerPolicy_",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "exposureLimit_",
"type": "uint256"
},
{
"internalType": "address",
"name": "wallet_",
"type": "address"
},
{
"internalType": "contract IPriceOracle",
"name": "oracle_",
"type": "address"
}
],
"name": "initialize",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "lastTweak",
"outputs": [
{
"internalType": "uint40",
"name": "",
"type": "uint40"
},
{
"internalType": "uint56",
"name": "",
"type": "uint56"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "maxDuration",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "maxPayoutPerPolicy",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "minDuration",
"outputs": [
{
"internalType": "uint40",
"name": "",
"type": "uint40"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "name",
"outputs": [
{
"internalType": "string",
"name": "",
"type": "string"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "triggerPrice",
"type": "uint256"
},
{
"internalType": "bool",
"name": "lower",
"type": "bool"
},
{
"internalType": "uint256",
"name": "payout",
"type": "uint256"
},
{
"internalType": "uint40",
"name": "expiration",
"type": "uint40"
},
{
"internalType": "address",
"name": "onBehalfOf",
"type": "address"
}
],
"name": "newPolicy",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "oracle",
"outputs": [
{
"internalType": "contract IPriceOracle",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "params",
"outputs": [
{
"components": [
{
"internalType": "uint256",
"name": "moc",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "jrCollRatio",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "collRatio",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "ensuroPpFee",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "ensuroCocFee",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "jrRoc",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "srRoc",
"type": "uint256"
}
],
"internalType": "struct IRiskModule.Params",
"name": "ret",
"type": "tuple"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "pause",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "paused",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "policyId",
"type": "uint256"
}
],
"name": "policyCanBeTriggered",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "policyPool",
"outputs": [
{
"internalType": "contract IPolicyPool",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "premiumsAccount",
"outputs": [
{
"internalType": "contract IPremiumsAccount",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "triggerPrice",
"type": "uint256"
},
{
"internalType": "bool",
"name": "lower",
"type": "bool"
},
{
"internalType": "uint256",
"name": "payout",
"type": "uint256"
},
{
"internalType": "uint40",
"name": "expiration",
"type": "uint40"
}
],
"name": "pricePolicy",
"outputs": [
{
"internalType": "uint256",
"name": "premium",
"type": "uint256"
},
{
"components": [
{
"internalType": "uint64",
"name": "lossProb",
"type": "uint64"
},
{
"internalType": "uint64",
"name": "jrCollRatio",
"type": "uint64"
},
{
"internalType": "uint64",
"name": "collRatio",
"type": "uint64"
}
],
"internalType": "struct IPriceRiskModule.SlotPricing",
"name": "price",
"type": "tuple"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "proxiableUUID",
"outputs": [
{
"internalType": "bytes32",
"name": "",
"type": "bytes32"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "payout",
"type": "uint256"
}
],
"name": "releaseExposure",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "int40",
"name": "duration",
"type": "int40"
},
{
"components": [
{
"internalType": "uint64",
"name": "lossProb",
"type": "uint64"
},
{
"internalType": "uint64",
"name": "jrCollRatio",
"type": "uint64"
},
{
"internalType": "uint64",
"name": "collRatio",
"type": "uint64"
}
],
"internalType": "struct IPriceRiskModule.SlotPricing[30]",
"name": "cdf",
"type": "tuple[30]"
}
],
"name": "setCDF",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint40",
"name": "minDuration_",
"type": "uint40"
}
],
"name": "setMinDuration",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "contract IPriceOracle",
"name": "oracle_",
"type": "address"
}
],
"name": "setOracle",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "enum IRiskModule.Parameter",
"name": "param",
"type": "uint8"
},
{
"internalType": "uint256",
"name": "newValue",
"type": "uint256"
}
],
"name": "setParam",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "wallet_",
"type": "address"
}
],
"name": "setWallet",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "bytes4",
"name": "interfaceId",
"type": "bytes4"
}
],
"name": "supportsInterface",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "policyId",
"type": "uint256"
}
],
"name": "triggerPolicy",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "unpause",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "newImplementation",
"type": "address"
}
],
"name": "upgradeTo",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "newImplementation",
"type": "address"
},
{
"internalType": "bytes",
"name": "data",
"type": "bytes"
}
],
"name": "upgradeToAndCall",
"outputs": [],
"stateMutability": "payable",
"type": "function"
},
{
"inputs": [],
"name": "wallet",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
}
],
"bytecode": "0x610100604052306080523480156200001657600080fd5b50604051620060c2380380620060c2833981016040819052620000399162000213565b8282816001600160a01b0381166200006457604051636b23cf0160e01b815260040160405180910390fd5b6200006e62000139565b806001600160a01b031660a0816001600160a01b03168152505050816001600160a01b0316816001600160a01b0316634d15eb036040518163ffffffff1660e01b8152600401602060405180830381865afa158015620000d2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620000f891906200025b565b6001600160a01b031614620001205760405163fec343d560e01b815260040160405180910390fd5b6001600160a01b031660c0525060e05250620002829050565b600054610100900460ff1615620001a65760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60005460ff90811614620001f8576000805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b6001600160a01b03811681146200021057600080fd5b50565b6000806000606084860312156200022957600080fd5b83516200023681620001fa565b60208501519093506200024981620001fa565b80925050604084015190509250925092565b6000602082840312156200026e57600080fd5b81516200027b81620001fa565b9392505050565b60805160a05160c05160e051615d656200035d60003960006137d10152600081816105750152613f8301526000818161040701528181610cca015281816110ee0152818161117a015281816113e8015281816114a40152818161192401528181611c0001528181611f420152818161203f01528181612888015281816129c201528181612e2301528181612ec201528181612fb0015281816132310152818161333f0152818161387e0152614a36015260008181610df501528181610e3501528181611270015281816112b0015261133f0152615d656000f3fe6080604052600436106102675760003560e01c80637adbf97311610144578063c1cca2b3116100b6578063e42569d91161007a578063e42569d914610819578063e5a6b10f14610840578063f48d63ad14610855578063f67b2bad14610882578063f92b2ed5146108a4578063fbb81279146108c457600080fd5b8063c1cca2b314610739578063c866ef1f14610759578063cfd4c60614610779578063cff0ab961461078e578063deaa59df146107f957600080fd5b80638003a94f116101085780638003a94f146106595780638456cb591461068d57806385272a6e146106a25780638bac3a24146106b7578063a5f8b2d6146106d7578063a9a24f271461070557600080fd5b80637adbf973146105c65780637aea23ad146105e65780637dc0d1d0146106065780637ed5acfa1461062d5780637ff8bf251461064457600080fd5b80634f1ef286116101dd5780635c975abb116101a15780635c975abb146104ee5780636a448ef1146105065780636db5c8fd146105265780636ee851481461054657806373a952e8146105665780637a5402e91461059957600080fd5b80634f1ef2861461043f578063521eb2731461045257806352d1902d1461047057806356715761146104855780635b494dd5146104ba57600080fd5b80633659cfe61161022f5780633659cfe614610335578063377e1cc9146103555780633f4ba83a14610375578063468a8c9f1461038a5780634a47a3e0146103c45780634d15eb03146103f857600080fd5b806301ffc9a71461026c57806306fdde03146102a15780630c5d0e65146102c3578063127115c9146102f157806324ea54f414610313575b600080fd5b34801561027857600080fd5b5061028c610287366004614e1d565b6108f8565b60405190151581526020015b60405180910390f35b3480156102ad57600080fd5b506102b6610924565b6040516102989190614e6b565b3480156102cf57600080fd5b506102e36102de366004614edb565b6109b6565b604051908152602001610298565b3480156102fd57600080fd5b5061031161030c366004614f38565b610ca7565b005b34801561031f57600080fd5b506102e3600080516020615d1083398151915281565b34801561034157600080fd5b50610311610350366004614f53565b610deb565b34801561036157600080fd5b50610311610370366004614f70565b610eca565b34801561038157600080fd5b5061031161115a565b34801561039657600080fd5b5060c9546040805164ffffffffff83168152600160281b90920466ffffffffffffff16602083015201610298565b3480156103d057600080fd5b506102e37fa82e22387fca439f316d78ca566f383218ab8ae1b3e830178c9c82cbd16749c081565b34801561040457600080fd5b507f00000000000000000000000000000000000000000000000000000000000000005b6040516001600160a01b039091168152602001610298565b61031161044d366004615014565b611266565b34801561045e57600080fd5b5060fe546001600160a01b0316610427565b34801561047c57600080fd5b506102e3611332565b34801561049157600080fd5b5061012f54600160401b900463ffffffff165b60405164ffffffffff9091168152602001610298565b3480156104c657600080fd5b506102e37f5ec196419322369c6bac572d883f4d990ae5ec82f7d93cdf89b85dbb05b63c2781565b3480156104fa57600080fd5b5060975460ff1661028c565b34801561051257600080fd5b50610311610521366004614f70565b6113e5565b34801561053257600080fd5b5060fc54600160b01b900461ffff166102e3565b34801561055257600080fd5b50610311610561366004615089565b611481565b34801561057257600080fd5b507f0000000000000000000000000000000000000000000000000000000000000000610427565b3480156105a557600080fd5b506105b96105b4366004614f70565b61180f565b604051610298919061517e565b3480156105d257600080fd5b506103116105e1366004614f53565b611901565b3480156105f257600080fd5b506103116106013660046151af565b611a6e565b34801561061257600080fd5b5061042761012f54600160601b90046001600160a01b031690565b34801561063957600080fd5b506104a46201518081565b34801561065057600080fd5b5060fd546102e3565b34801561066557600080fd5b506102e37fc307c44629779eb8fc0b85f224c3d22f5876a6c84de0ee42d481eb7814f0d3a881565b34801561069957600080fd5b50610311611bef565b3480156106ae57600080fd5b506102e3611cea565b3480156106c357600080fd5b506102e36106d2366004615257565b611d0d565b3480156106e357600080fd5b506106f76106f236600461528c565b611d2d565b6040516102989291906152d4565b34801561071157600080fd5b506102e37f0df0a8869cf58168a14cd7ac426ff1b8c6ff5d5c800c6f44803f3431dcb3bad181565b34801561074557600080fd5b5061031161075436600461530a565b611eed565b34801561076557600080fd5b506102e361077436600461534f565b6127b0565b34801561078557600080fd5b506102e36127fc565b34801561079a57600080fd5b506107a361281b565b6040516102989190600060e082019050825182526020830151602083015260408301516040830152606083015160608301526080830151608083015260a083015160a083015260c083015160c083015292915050565b34801561080557600080fd5b50610311610814366004614f53565b612865565b34801561082557600080fd5b5061082e601e81565b60405160ff9091168152602001610298565b34801561084c57600080fd5b506104276129be565b34801561086157600080fd5b506108756108703660046153e5565b612a42565b6040516102989190615400565b34801561088e57600080fd5b506102e3600080516020615cc983398151915281565b3480156108b057600080fd5b5061028c6108bf366004614f70565b612ae1565b3480156108d057600080fd5b506102e37fc6823861ee2bb2198ce6b1fd6faf4c8f44f745bc804aca4a762f67e0d507fd8a81565b600061090382612c06565b8061091e57506001600160e01b0319821663da40804f60e01b145b92915050565b606060fb80546109339061545f565b80601f016020809104026020016040519081016040528092919081815260200182805461095f9061545f565b80156109ac5780601f10610981576101008083540402835291602001916109ac565b820191906000526020600020905b81548152906001019060200180831161098f57829003601f168201915b5050505050905090565b60006109c0612c3c565b6001600160a01b038216610a295760405162461bcd60e51b815260206004820152602560248201527f6f6e426568616c664f662063616e6e6f7420626520746865207a65726f206164604482015264647265737360d81b60648201526084015b60405180910390fd5b600080610a3888888888611d2d565b9150915060008211610aa55760405162461bcd60e51b815260206004820152603060248201527f456974686572206475726174696f6e206f722070657263656e74616765206a7560448201526f1b5c081b9bdd081cdd5c1c1bdc9d195960821b6064820152608401610a20565b61012f54600090610ac2906001600160401b03163060601b6154a9565b600081815261012d60205260408120919250610adc61281b565b6020808601516001600160401b03908116918301919091526040808701518216908301528551919250610b25918b918891168b3361012f548d906001600160401b031688612c84565b80518355602081015160018085019190915560408201516002850155606082015160038501556080820151600485015560a0820151600585015560c0820151600685015560e0820151600785015561010082015160088501556101208201516009850155610140820151600a850155610160820151600b850180546101808501516101a0909501516001600160a01b039093166001600160c81b031990911617600160a01b64ffffffffff958616021764ffffffffff60c81b1916600160c81b94909216939093021790915561012f8054600090610c0d9084906001600160401b03166154bc565b82546101009290920a6001600160401b0381810219909316919092169190910217905550600c82018b9055600d8201805460ff19168b151590811790915560408051858152602081018e9052908101919091526001600160a01b038816907fac60a84d926e5f83b9718922af7ef1285ea8a8516516c4981ed3297d2e89ae0b9060600160405180910390a250909998505050505050505050565b7fc307c44629779eb8fc0b85f224c3d22f5876a6c84de0ee42d481eb7814f0d3a87f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166371907f176040518163ffffffff1660e01b8152600401602060405180830381865afa158015610d26573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d4a91906154e3565b6001600160a01b0316635ff57d2030833360006040518563ffffffff1660e01b8152600401610d7c9493929190615500565b60006040518083038186803b158015610d9457600080fd5b505afa158015610da8573d6000803e3d6000fd5b50505050610db4612c3c565b61012f805463ffffffff60401b1916600160401b63ffffffff851602179055610de7601464ffffffffff841660006132be565b5050565b6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000163003610e335760405162461bcd60e51b8152600401610a209061552a565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316610e7c600080516020615ca9833981519152546001600160a01b031690565b6001600160a01b031614610ea25760405162461bcd60e51b8152600401610a2090615576565b610eab8161331f565b60408051600080825260208201909252610ec791839190613431565b50565b610ed2612c3c565b600081815261012d6020526040902061012f54600b820154600160401b90910463ffffffff1690610f1190600160a01b900464ffffffffff16426155c2565b1015610f5f5760405162461bcd60e51b815260206004820152601e60248201527f546f6f20736f6f6e20746f20747269676765722074686520706f6c69637900006044820152606401610a20565b6000610f7b61012f54600160601b90046001600160a01b031690565b6001600160a01b031663eb91d37e6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610fb8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fdc91906155d5565b600d83015490915060ff161580610ff7575081600c01548111155b6110595760405162461bcd60e51b815260206004820152602d60248201527f436f6e646974696f6e206e6f74206d65742043757272656e745072696365203e60448201526c2074726967676572507269636560981b6064820152608401610a20565b600d82015460ff1680611070575081600c01548110155b6110d25760405162461bcd60e51b815260206004820152602d60248201527f436f6e646974696f6e206e6f74206d65742043757272656e745072696365203c60448201526c2074726967676572507269636560981b6064820152608401610a20565b6001820154604051631e9c0acf60e21b81526001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001691637a702b3c916111239186916004016155ee565b600060405180830381600087803b15801561113d57600080fd5b505af1158015611151573d6000803e3d6000fd5b50505050505050565b600080516020615d10833981519152600080516020615cc98339815191527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166371907f176040518163ffffffff1660e01b8152600401602060405180830381865afa1580156111d6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111fa91906154e3565b6001600160a01b0316632b1cff1f3084843360016040518663ffffffff1660e01b815260040161122e9594939291906156b0565b60006040518083038186803b15801561124657600080fd5b505afa15801561125a573d6000803e3d6000fd5b50505050610de761359c565b6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001630036112ae5760405162461bcd60e51b8152600401610a209061552a565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166112f7600080516020615ca9833981519152546001600160a01b031690565b6001600160a01b03161461131d5760405162461bcd60e51b8152600401610a2090615576565b6113268261331f565b610de782826001613431565b6000306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146113d25760405162461bcd60e51b815260206004820152603860248201527f555550535570677261646561626c653a206d757374206e6f742062652063616c60448201527f6c6564207468726f7567682064656c656761746563616c6c00000000000000006064820152608401610a20565b50600080516020615ca983398151915290565b337f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316146114675760405162461bcd60e51b815260206004820152602160248201527f5468652063616c6c6572206d7573742062652074686520506f6c696379506f6f6044820152601b60fa1b6064820152608401610a20565b8060fd600082825461147991906155c2565b909155505050565b7fc6823861ee2bb2198ce6b1fd6faf4c8f44f745bc804aca4a762f67e0d507fd8a7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166371907f176040518163ffffffff1660e01b8152600401602060405180830381865afa158015611500573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061152491906154e3565b6001600160a01b0316635ff57d2030833360006040518563ffffffff1660e01b81526004016115569493929190615500565b60006040518083038186803b15801561156e57600080fd5b505afa158015611582573d6000803e3d6000fd5b5050505061158e612c3c565b8260040b6000036115d25760405162461bcd60e51b815260206004820152600e60248201526d7c6475726174696f6e7c203c203160901b6044820152606401610a20565b60005b601e8110156117c4578281601e81106115f0576115f06156e3565b60600201600001602081019061160691906156f9565b6001600160401b031615806117025750670de0b6b3a76400008382601e8110611631576116316156e3565b60600201602001602081019061164791906156f9565b6001600160401b0316111580156116965750670de0b6b3a76400008382601e8110611674576116746156e3565b60600201604001602081019061168a91906156f9565b6001600160401b031611155b801561170257508281601e81106116af576116af6156e3565b6060020160400160208101906116c591906156f9565b6001600160401b03168382601e81106116e0576116e06156e3565b6060020160200160208101906116f691906156f9565b6001600160401b031611155b6117635760405162461bcd60e51b815260206004820152602c60248201527f56616c69646174696f6e3a20696e76616c696420636f6c6c61746572616c697a60448201526b6174696f6e20726174696f7360a01b6064820152608401610a20565b8281601e8110611775576117756156e3565b6060020161012e60008660040b60040b815260200190815260200160002082601e81106117a4576117a46156e3565b016117af8282615716565b508190506117bc816157b7565b9150506115d5565b506000808460040b126117de578364ffffffffff166117fa565b6117e7846157d0565b6117fa9064ffffffffff908116906154a9565b905061180960138260006132be565b50505050565b611817614d30565b50600090815261012d602090815260409182902082516102208101845281546060820190815260018301546080830152600283015460a0830152600383015460c0830152600483015460e083015260058301546101008301526006830154610120830152600783015461014083015260088301546101608301526009830154610180830152600a8301546101a0830152600b8301546001600160a01b0381166101c084015264ffffffffff600160a01b820481166101e0850152600160c81b909104166102008301528152600c82015492810192909252600d015460ff1615159181019190915290565b7fc307c44629779eb8fc0b85f224c3d22f5876a6c84de0ee42d481eb7814f0d3a87f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166371907f176040518163ffffffff1660e01b8152600401602060405180830381865afa158015611980573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119a491906154e3565b6001600160a01b0316635ff57d2030833360006040518563ffffffff1660e01b81526004016119d69493929190615500565b60006040518083038186803b1580156119ee57600080fd5b505afa158015611a02573d6000803e3d6000fd5b50505050611a0e612c3c565b6001600160a01b038216611a345760405162461bcd60e51b8152600401610a20906157f4565b61012f80546bffffffffffffffffffffffff16600160601b6001600160a01b03851690810291909117909155610de79060159060006132be565b600054610100900460ff1615808015611a8e5750600054600160ff909116105b80611aa85750303b158015611aa8575060005460ff166001145b611b0b5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610a20565b6000805460ff191660011790558015611b2e576000805461ff0019166101001790555b611b3d898989898989896135ee565b6001600160a01b038216611b635760405162461bcd60e51b8152600401610a20906157f4565b6040805160608101825260018152610e1060208201526001600160a01b0384169101819052600160601b02690e1000000000000000011761012f558015611be4576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b505050505050505050565b600080516020615d108339815191527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166371907f176040518163ffffffff1660e01b8152600401602060405180830381865afa158015611c5c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c8091906154e3565b6001600160a01b0316635ff57d2030833360016040518563ffffffff1660e01b8152600401611cb29493929190615500565b60006040518083038186803b158015611cca57600080fd5b505afa158015611cde573d6000803e3d6000fd5b50505050610ec761362c565b60fc54600090611d08908290600160901b900463ffffffff16613669565b905090565b6000611d2384848442611d1e61281b565b6136fa565b90505b9392505050565b604080516060810182526000808252602082018190529181018290526000611d6561012f54600160601b90046001600160a01b031690565b6001600160a01b031663eb91d37e6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611da2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611dc691906155d5565b9050858015611dd457508681115b80611de7575085158015611de757508681105b611e335760405162461bcd60e51b815260206004820152601e60248201527f507269636520616c726561647920617420747269676765722076616c756500006044820152606401610a20565b6000611e3f4286615847565b61012f54909150600160401b900463ffffffff1664ffffffffff82161015611ea95760405162461bcd60e51b815260206004820152601b60248201527f54686520706f6c696379206578706972657320746f6f20736f6f6e00000000006044820152606401610a20565b611eb4828983613717565b80519093506001600160401b0316600003611ed457600093505050611ee4565b611edf8684876127b0565b935050505b94509492505050565b600080516020615cc98339815191527fa82e22387fca439f316d78ca566f383218ab8ae1b3e830178c9c82cbd16749c07f5ec196419322369c6bac572d883f4d990ae5ec82f7d93cdf89b85dbb05b63c2760007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166371907f176040518163ffffffff1660e01b8152600401602060405180830381865afa158015611f9e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fc291906154e3565b6040516359f7e5e960e11b81529091506001600160a01b0382169063b3efcbd290611ff890309088903390600190600401615500565b602060405180830381865afa158015612015573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120399190615865565b612124577f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166371907f176040518163ffffffff1660e01b8152600401602060405180830381865afa15801561209b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120bf91906154e3565b6001600160a01b0316632b1cff1f3085853360016040518663ffffffff1660e01b81526004016120f39594939291906156b0565b60006040518083038186803b15801561210b57600080fd5b505afa15801561211f573d6000803e3d6000fd5b505050505b600061214f7fa82e22387fca439f316d78ca566f383218ab8ae1b3e830178c9c82cbd16749c061387a565b158015612170575061216e600080516020615cc983398151915261387a565b155b9050600087600981111561218657612186615882565b036121f6578015806121b6575060fc546121b6906121a79061ffff16613971565b8767016345785d8a0000613987565b6121d25760405162461bcd60e51b8152600401610a2090615898565b6121db86613a0e565b60fc805461ffff191661ffff92909216919091179055612778565b600187600981111561220a5761220a615882565b0361227a57801580612231575060fc54612231906121a79062010000900461ffff16613971565b61224d5760405162461bcd60e51b8152600401610a2090615898565b61225686613a0e565b60fc805461ffff92909216620100000263ffff000019909216919091179055612778565b600287600981111561228e5761228e615882565b03612302578015806122b6575060fc546122b6906121a790600160201b900461ffff16613971565b6122d25760405162461bcd60e51b8152600401610a2090615898565b6122db86613a0e565b60fc805461ffff92909216600160201b0265ffff0000000019909216919091179055612778565b600387600981111561231657612316615882565b0361238c5780158061233e575060fc5461233e906121a790600160301b900461ffff16613971565b61235a5760405162461bcd60e51b8152600401610a2090615898565b61236386613a0e565b60fc805461ffff92909216600160301b0267ffff00000000000019909216919091179055612778565b60048760098111156123a0576123a0615882565b03612418578015806123c8575060fc546123c8906121a790600160401b900461ffff16613971565b6123e45760405162461bcd60e51b8152600401610a2090615898565b6123ed86613a0e565b60fc805461ffff92909216600160401b0269ffff000000000000000019909216919091179055612778565b600587600981111561242c5761242c615882565b0361249f57801580612454575060fc54612454906121a790600160501b900461ffff16613971565b6124705760405162461bcd60e51b8152600401610a2090615898565b61247986613a0e565b60fc805461ffff92909216600160501b0261ffff60501b19909216919091179055612778565b60068760098111156124b3576124b3615882565b03612526578015806124db575060fc546124db906121a790600160601b900461ffff16613971565b6124f75760405162461bcd60e51b8152600401610a2090615898565b61250086613a0e565b60fc805461ffff92909216600160601b0261ffff60601b19909216919091179055612778565b600787600981111561253a5761253a615882565b036125a35780158061255257506125526121a76127fc565b61256e5760405162461bcd60e51b8152600401610a2090615898565b612579600287613a28565b60fc805463ffffffff92909216600160701b0263ffffffff60701b19909216919091179055612778565b60088760098111156125b7576125b7615882565b036127165760fd548610156126285760405162461bcd60e51b815260206004820152603160248201527f43616e277420736574206578706f737572654c696d6974206c657373207468616044820152706e20616374697665206578706f7375726560781b6064820152608401610a20565b80158061263b575061263b6121a7611cea565b6126575760405162461bcd60e51b8152600401610a2090615898565b61265f611cea565b8611158061267f575061267f600080516020615cc983398151915261387a565b6126e15760405162461bcd60e51b815260206004820152602d60248201527f547765616b2065786365656465643a20496e637265617365207265717569726560448201526c73204c4556454c315f524f4c4560981b6064820152608401610a20565b6126ec600087613a28565b60fc805463ffffffff92909216600160901b0263ffffffff60901b19909216919091179055612778565b600987600981111561272a5761272a615882565b0361277857801561274d5760405162461bcd60e51b8152600401610a2090615898565b61275686613abb565b60fc805461ffff92909216600160b01b0261ffff60b01b199092169190911790555b61115187600981111561278d5761278d615882565b6127989060086154a9565b602d8111156127a9576127a9615882565b87836132be565b6000806127bb61281b565b6020808601516001600160401b039081169183019190915260408087015182169083015285519192506127f3918791168542856136fa565b95945050505050565b60fc54600090611d0890600290600160701b900463ffffffff16613669565b61285b6040518060e00160405280600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081525090565b611d0860fc613b22565b7f0df0a8869cf58168a14cd7ac426ff1b8c6ff5d5c800c6f44803f3431dcb3bad17f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166371907f176040518163ffffffff1660e01b8152600401602060405180830381865afa1580156128e4573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061290891906154e3565b6001600160a01b0316635ff57d2030833360006040518563ffffffff1660e01b815260040161293a9493929190615500565b60006040518083038186803b15801561295257600080fd5b505afa158015612966573d6000803e3d6000fd5b5050506001600160a01b038316905061299257604051634d1c286960e11b815260040160405180910390fd5b60fe80546001600160a01b0319166001600160a01b038416908117909155610de79060129060006132be565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663e5a6b10f6040518163ffffffff1660e01b8152600401602060405180830381865afa158015612a1e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d0891906154e3565b612a4a614d57565b60005b601e811015612adb57600483900b600090815261012e6020526040902081601e8110612a7b57612a7b6156e3565b6040805160608101825292909101546001600160401b038082168452600160401b820481166020850152600160801b90910416908201528282601e8110612ac457612ac46156e3565b602002015280612ad3816157b7565b915050612a4d565b50919050565b600081815261012d6020526040812061012f54600b820154600160401b90910463ffffffff1690612b2090600160a01b900464ffffffffff16426155c2565b1015612b2f5750600092915050565b6000612b4b61012f54600160601b90046001600160a01b031690565b6001600160a01b031663eb91d37e6040518163ffffffff1660e01b8152600401602060405180830381865afa158015612b88573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612bac91906155d5565b600d83015490915060ff16158015612bc7575081600c015481105b15612bd6575060009392505050565b600d82015460ff168015612bed575081600c015481115b15612bfc575060009392505050565b5060019392505050565b60006001600160e01b031982166301ffc9a760e01b148061091e57506001600160e01b03198216634d15eb0360e01b1492915050565b60975460ff1615612c825760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606401610a20565b565b612c8c614d97565b4260018901612ca557612ca28a898984876136fa565b98505b898910612cf45760405162461bcd60e51b815260206004820181905260248201527f5072656d69756d206d757374206265206c657373207468616e207061796f75746044820152606401610a20565b8064ffffffffff168764ffffffffff1611612d515760405162461bcd60e51b815260206004820181905260248201527f45787069726174696f6e206d75737420626520696e20746865206675747572656044820152606401610a20565b60fc54600160b01b900461ffff16610e10612d6c838a615847565b612d76919