UNPKG

@arbitrum/nitro-contracts

Version:

Layer 2 precompiles and rollup for Arbitrum Nitro

1,627 lines 130 kB
{ "_format": "hh-sol-artifact-1", "contractName": "EdgeChallengeManager", "sourceName": "src/challengeV2/EdgeChallengeManager.sol", "abi": [ { "inputs": [], "stateMutability": "nonpayable", "type": "constructor" }, { "inputs": [ { "internalType": "address", "name": "account", "type": "address" }, { "internalType": "bytes32", "name": "mutualId", "type": "bytes32" } ], "name": "AccountHasMadeLayerZeroRival", "type": "error" }, { "inputs": [], "name": "AssertionHashEmpty", "type": "error" }, { "inputs": [ { "internalType": "bytes32", "name": "h1", "type": "bytes32" }, { "internalType": "bytes32", "name": "h2", "type": "bytes32" } ], "name": "AssertionHashMismatch", "type": "error" }, { "inputs": [], "name": "AssertionNoSibling", "type": "error" }, { "inputs": [], "name": "AssertionNotPending", "type": "error" }, { "inputs": [ { "internalType": "uint8", "name": "levels", "type": "uint8" } ], "name": "BigStepLevelsTooMany", "type": "error" }, { "inputs": [ { "internalType": "uint256", "name": "actual", "type": "uint256" }, { "internalType": "uint256", "name": "expected", "type": "uint256" } ], "name": "CachedTimeSufficient", "type": "error" }, { "inputs": [ { "internalType": "bytes32", "name": "edgeId", "type": "bytes32" }, { "internalType": "bytes32", "name": "lowerChildId", "type": "bytes32" }, { "internalType": "bytes32", "name": "upperChildId", "type": "bytes32" } ], "name": "ChildrenAlreadySet", "type": "error" }, { "inputs": [ { "internalType": "uint8", "name": "argLevel", "type": "uint8" }, { "internalType": "uint8", "name": "claimLevel", "type": "uint8" } ], "name": "ClaimEdgeInvalidLevel", "type": "error" }, { "inputs": [ { "internalType": "bytes32", "name": "claimId", "type": "bytes32" } ], "name": "ClaimEdgeNotLengthOneRival", "type": "error" }, { "inputs": [], "name": "ClaimEdgeNotPending", "type": "error" }, { "inputs": [ { "internalType": "bytes32", "name": "edgeId", "type": "bytes32" } ], "name": "EdgeAlreadyExists", "type": "error" }, { "inputs": [ { "internalType": "bytes32", "name": "edgeId", "type": "bytes32" } ], "name": "EdgeAlreadyRefunded", "type": "error" }, { "inputs": [ { "internalType": "bytes32", "name": "edgeId", "type": "bytes32" }, { "internalType": "bytes32", "name": "claimingEdgeId", "type": "bytes32" } ], "name": "EdgeClaimMismatch", "type": "error" }, { "inputs": [ { "internalType": "bytes32", "name": "edgeId1", "type": "bytes32" }, { "internalType": "bytes32", "name": "edgeId2", "type": "bytes32" }, { "internalType": "uint8", "name": "level1", "type": "uint8" }, { "internalType": "uint8", "name": "level2", "type": "uint8" } ], "name": "EdgeLevelInvalid", "type": "error" }, { "inputs": [ { "internalType": "bytes32", "name": "edgeId", "type": "bytes32" }, { "internalType": "enum EdgeStatus", "name": "", "type": "uint8" } ], "name": "EdgeNotConfirmed", "type": "error" }, { "inputs": [ { "internalType": "bytes32", "name": "edgeId", "type": "bytes32" } ], "name": "EdgeNotExists", "type": "error" }, { "inputs": [ { "internalType": "bytes32", "name": "edgeId", "type": "bytes32" }, { "internalType": "address", "name": "staker", "type": "address" }, { "internalType": "bytes32", "name": "claimId", "type": "bytes32" } ], "name": "EdgeNotLayerZero", "type": "error" }, { "inputs": [ { "internalType": "uint256", "name": "length", "type": "uint256" } ], "name": "EdgeNotLengthOne", "type": "error" }, { "inputs": [ { "internalType": "bytes32", "name": "edgeId", "type": "bytes32" }, { "internalType": "enum EdgeStatus", "name": "status", "type": "uint8" } ], "name": "EdgeNotPending", "type": "error" }, { "inputs": [ { "internalType": "uint8", "name": "level", "type": "uint8" } ], "name": "EdgeTypeNotSmallStep", "type": "error" }, { "inputs": [ { "internalType": "bytes32", "name": "edgeId", "type": "bytes32" } ], "name": "EdgeUnrivaled", "type": "error" }, { "inputs": [], "name": "EmptyArray", "type": "error" }, { "inputs": [], "name": "EmptyAssertionChain", "type": "error" }, { "inputs": [], "name": "EmptyChallengePeriod", "type": "error" }, { "inputs": [], "name": "EmptyClaimId", "type": "error" }, { "inputs": [], "name": "EmptyEdgeSpecificProof", "type": "error" }, { "inputs": [], "name": "EmptyEndMachineStatus", "type": "error" }, { "inputs": [], "name": "EmptyEndRoot", "type": "error" }, { "inputs": [], "name": "EmptyFirstRival", "type": "error" }, { "inputs": [], "name": "EmptyOneStepProofEntry", "type": "error" }, { "inputs": [], "name": "EmptyOriginId", "type": "error" }, { "inputs": [], "name": "EmptyPrefixProof", "type": "error" }, { "inputs": [], "name": "EmptyStakeReceiver", "type": "error" }, { "inputs": [], "name": "EmptyStaker", "type": "error" }, { "inputs": [], "name": "EmptyStartMachineStatus", "type": "error" }, { "inputs": [], "name": "EmptyStartRoot", "type": "error" }, { "inputs": [ { "internalType": "bytes32", "name": "endHistoryRoot", "type": "bytes32" }, { "internalType": "bytes32", "name": "assertionEndRoot", "type": "bytes32" } ], "name": "EndHistoryRootMismatch", "type": "error" }, { "inputs": [ { "internalType": "uint256", "name": "h1", "type": "uint256" }, { "internalType": "uint256", "name": "h2", "type": "uint256" } ], "name": "HeightDiffLtTwo", "type": "error" }, { "inputs": [ { "internalType": "uint256", "name": "totalBlocks", "type": "uint256" }, { "internalType": "uint256", "name": "thresholdBlocks", "type": "uint256" } ], "name": "InsufficientConfirmationBlocks", "type": "error" }, { "inputs": [ { "internalType": "enum EdgeType", "name": "edgeType", "type": "uint8" } ], "name": "InvalidEdgeType", "type": "error" }, { "inputs": [ { "internalType": "uint256", "name": "actualHeight", "type": "uint256" }, { "internalType": "uint256", "name": "expectedHeight", "type": "uint256" } ], "name": "InvalidEndHeight", "type": "error" }, { "inputs": [ { "internalType": "uint256", "name": "start", "type": "uint256" }, { "internalType": "uint256", "name": "end", "type": "uint256" } ], "name": "InvalidHeights", "type": "error" }, { "inputs": [ { "internalType": "uint8", "name": "level", "type": "uint8" }, { "internalType": "uint8", "name": "numBigStepLevels", "type": "uint8" } ], "name": "LevelTooHigh", "type": "error" }, { "inputs": [ { "internalType": "uint256", "name": "actualLength", "type": "uint256" }, { "internalType": "uint256", "name": "maxProofLength", "type": "uint256" } ], "name": "MerkleProofTooLong", "type": "error" }, { "inputs": [ { "internalType": "uint256", "name": "val", "type": "uint256" } ], "name": "NotPowerOfTwo", "type": "error" }, { "inputs": [ { "internalType": "address", "name": "account", "type": "address" } ], "name": "NotValidator", "type": "error" }, { "inputs": [ { "internalType": "bytes32", "name": "mutualId", "type": "bytes32" }, { "internalType": "bytes32", "name": "originId", "type": "bytes32" } ], "name": "OriginIdMutualIdMismatch", "type": "error" }, { "inputs": [ { "internalType": "bytes32", "name": "edgeId", "type": "bytes32" }, { "internalType": "bytes32", "name": "confirmedRivalId", "type": "bytes32" } ], "name": "RivalEdgeConfirmed", "type": "error" }, { "inputs": [ { "internalType": "uint256", "name": "stakeLevels", "type": "uint256" }, { "internalType": "uint256", "name": "numLevels", "type": "uint256" } ], "name": "StakeAmountsMismatch", "type": "error" }, { "inputs": [], "name": "ZeroBigStepLevels", "type": "error" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "bytes32", "name": "edgeId", "type": "bytes32" }, { "indexed": true, "internalType": "bytes32", "name": "mutualId", "type": "bytes32" }, { "indexed": true, "internalType": "bytes32", "name": "originId", "type": "bytes32" }, { "indexed": false, "internalType": "bytes32", "name": "claimId", "type": "bytes32" }, { "indexed": false, "internalType": "uint256", "name": "length", "type": "uint256" }, { "indexed": false, "internalType": "uint8", "name": "level", "type": "uint8" }, { "indexed": false, "internalType": "bool", "name": "hasRival", "type": "bool" }, { "indexed": false, "internalType": "bool", "name": "isLayerZero", "type": "bool" } ], "name": "EdgeAdded", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "bytes32", "name": "edgeId", "type": "bytes32" }, { "indexed": true, "internalType": "bytes32", "name": "lowerChildId", "type": "bytes32" }, { "indexed": true, "internalType": "bytes32", "name": "upperChildId", "type": "bytes32" }, { "indexed": false, "internalType": "bool", "name": "lowerChildAlreadyExists", "type": "bool" } ], "name": "EdgeBisected", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "bytes32", "name": "edgeId", "type": "bytes32" }, { "indexed": true, "internalType": "bytes32", "name": "mutualId", "type": "bytes32" } ], "name": "EdgeConfirmedByOneStepProof", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "bytes32", "name": "edgeId", "type": "bytes32" }, { "indexed": true, "internalType": "bytes32", "name": "mutualId", "type": "bytes32" }, { "indexed": false, "internalType": "uint256", "name": "totalTimeUnrivaled", "type": "uint256" } ], "name": "EdgeConfirmedByTime", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "bytes32", "name": "edgeId", "type": "bytes32" }, { "indexed": true, "internalType": "bytes32", "name": "mutualId", "type": "bytes32" }, { "indexed": false, "internalType": "address", "name": "stakeToken", "type": "address" }, { "indexed": false, "internalType": "uint256", "name": "stakeAmount", "type": "uint256" } ], "name": "EdgeRefunded", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": false, "internalType": "uint8", "name": "version", "type": "uint8" } ], "name": "Initialized", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "bytes32", "name": "edgeId", "type": "bytes32" }, { "indexed": false, "internalType": "uint256", "name": "newValue", "type": "uint256" } ], "name": "TimerCacheUpdated", "type": "event" }, { "inputs": [], "name": "LAYERZERO_BIGSTEPEDGE_HEIGHT", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "LAYERZERO_BLOCKEDGE_HEIGHT", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "LAYERZERO_SMALLSTEPEDGE_HEIGHT", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "NUM_BIGSTEP_LEVEL", "outputs": [ { "internalType": "uint8", "name": "", "type": "uint8" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "assertionChain", "outputs": [ { "internalType": "contract IAssertionChain", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "bytes32", "name": "edgeId", "type": "bytes32" }, { "internalType": "bytes32", "name": "bisectionHistoryRoot", "type": "bytes32" }, { "internalType": "bytes", "name": "prefixProof", "type": "bytes" } ], "name": "bisectEdge", "outputs": [ { "internalType": "bytes32", "name": "", "type": "bytes32" }, { "internalType": "bytes32", "name": "", "type": "bytes32" } ], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "uint8", "name": "level", "type": "uint8" }, { "internalType": "bytes32", "name": "originId", "type": "bytes32" }, { "internalType": "uint256", "name": "startHeight", "type": "uint256" }, { "internalType": "bytes32", "name": "startHistoryRoot", "type": "bytes32" }, { "internalType": "uint256", "name": "endHeight", "type": "uint256" }, { "internalType": "bytes32", "name": "endHistoryRoot", "type": "bytes32" } ], "name": "calculateEdgeId", "outputs": [ { "internalType": "bytes32", "name": "", "type": "bytes32" } ], "stateMutability": "pure", "type": "function" }, { "inputs": [ { "internalType": "uint8", "name": "level", "type": "uint8" }, { "internalType": "bytes32", "name": "originId", "type": "bytes32" }, { "internalType": "uint256", "name": "startHeight", "type": "uint256" }, { "internalType": "bytes32", "name": "startHistoryRoot", "type": "bytes32" }, { "internalType": "uint256", "name": "endHeight", "type": "uint256" } ], "name": "calculateMutualId", "outputs": [ { "internalType": "bytes32", "name": "", "type": "bytes32" } ], "stateMutability": "pure", "type": "function" }, { "inputs": [], "name": "challengePeriodBlocks", "outputs": [ { "internalType": "uint64", "name": "", "type": "uint64" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "bytes32", "name": "edgeId", "type": "bytes32" }, { "components": [ { "internalType": "bytes32", "name": "beforeHash", "type": "bytes32" }, { "internalType": "bytes", "name": "proof", "type": "bytes" } ], "internalType": "struct OneStepData", "name": "oneStepData", "type": "tuple" }, { "components": [ { "internalType": "bytes32", "name": "wasmModuleRoot", "type": "bytes32" }, { "internalType": "uint256", "name": "requiredStake", "type": "uint256" }, { "internalType": "address", "name": "challengeManager", "type": "address" }, { "internalType": "uint64", "name": "confirmPeriodBlocks", "type": "uint64" }, { "internalType": "uint64", "name": "nextInboxPosition", "type": "uint64" } ], "internalType": "struct ConfigData", "name": "prevConfig", "type": "tuple" }, { "internalType": "bytes32[]", "name": "beforeHistoryInclusionProof", "type": "bytes32[]" }, { "internalType": "bytes32[]", "name": "afterHistoryInclusionProof", "type": "bytes32[]" } ], "name": "confirmEdgeByOneStepProof", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "bytes32", "name": "edgeId", "type": "bytes32" }, { "components": [ { "components": [ { "components": [ { "internalType": "bytes32[2]", "name": "bytes32Vals", "type": "bytes32[2]" }, { "internalType": "uint64[2]", "name": "u64Vals", "type": "uint64[2]" } ], "internalType": "struct GlobalState", "name": "globalState", "type": "tuple" }, { "internalType": "enum MachineStatus", "name": "machineStatus", "type": "uint8" }, { "internalType": "bytes32", "name": "endHistoryRoot", "type": "bytes32" } ], "internalType": "struct AssertionState", "name": "assertionState", "type": "tuple" }, { "internalType": "bytes32", "name": "prevAssertionHash", "type": "bytes32" }, { "internalType": "bytes32", "name": "inboxAcc", "type": "bytes32" } ], "internalType": "struct AssertionStateData", "name": "claimStateData", "type": "tuple" } ], "name": "confirmEdgeByTime", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "bytes32", "name": "mutualId", "type": "bytes32" } ], "name": "confirmedRival", "outputs": [ { "internalType": "bytes32", "name": "", "type": "bytes32" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "components": [ { "internalType": "uint8", "name": "level", "type": "uint8" }, { "internalType": "bytes32", "name": "endHistoryRoot", "type": "bytes32" }, { "internalType": "uint256", "name": "endHeight", "type": "uint256" }, { "internalType": "bytes32", "name": "claimId", "type": "bytes32" }, { "internalType": "bytes", "name": "prefixProof", "type": "bytes" }, { "internalType": "bytes", "name": "proof", "type": "bytes" } ], "internalType": "struct CreateEdgeArgs", "name": "args", "type": "tuple" } ], "name": "createLayerZeroEdge", "outputs": [ { "internalType": "bytes32", "name": "", "type": "bytes32" } ], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "bytes32", "name": "edgeId", "type": "bytes32" } ], "name": "edgeExists", "outputs": [ { "internalType": "bool", "name": "", "type": "bool" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "bytes32", "name": "edgeId", "type": "bytes32" } ], "name": "edgeLength", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "excessStakeReceiver", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "bytes32", "name": "mutualId", "type": "bytes32" } ], "name": "firstRival", "outputs": [ { "internalType": "bytes32", "name": "", "type": "bytes32" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "bytes32", "name": "edgeId", "type": "bytes32" } ], "name": "getEdge", "outputs": [ { "components": [ { "internalType": "bytes32", "name": "originId", "type": "bytes32" }, { "internalType": "bytes32", "name": "startHistoryRoot", "type": "bytes32" }, { "internalType": "uint256", "name": "startHeight", "type": "uint256" }, { "internalType": "bytes32", "name": "endHistoryRoot", "type": "bytes32" }, { "internalType": "uint256", "name": "endHeight", "type": "uint256" }, { "internalType": "bytes32", "name": "lowerChildId", "type": "bytes32" }, { "internalType": "bytes32", "name": "upperChildId", "type": "bytes32" }, { "internalType": "bytes32", "name": "claimId", "type": "bytes32" }, { "internalType": "address", "name": "staker", "type": "address" }, { "internalType": "uint64", "name": "createdAtBlock", "type": "uint64" }, { "internalType": "uint64", "name": "confirmedAtBlock", "type": "uint64" }, { "internalType": "enum EdgeStatus", "name": "status", "type": "uint8" }, { "internalType": "uint8", "name": "level", "type": "uint8" }, { "internalType": "bool", "name": "refunded", "type": "bool" }, { "internalType": "uint64", "name": "totalTimeUnrivaledCache", "type": "uint64" } ], "internalType": "struct ChallengeEdge", "name": "", "type": "tuple" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "enum EdgeType", "name": "eType", "type": "uint8" } ], "name": "getLayerZeroEndHeight", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "bytes32", "name": "edgeId", "type": "bytes32" } ], "name": "getPrevAssertionHash", "outputs": [ { "internalType": "bytes32", "name": "", "type": "bytes32" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "bytes32", "name": "edgeId", "type": "bytes32" } ], "name": "hasLengthOneRival", "outputs": [ { "internalType": "bool", "name": "", "type": "bool" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "account", "type": "address" }, { "internalType": "bytes32", "name": "mutualId", "type": "bytes32" } ], "name": "hasMadeLayerZeroRival", "outputs": [ { "internalType": "bool", "name": "", "type": "bool" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "bytes32", "name": "edgeId", "type": "bytes32" } ], "name": "hasRival", "outputs": [ { "internalType": "bool", "name": "", "type": "bool" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "contract IAssertionChain", "name": "_assertionChain", "type": "address" }, { "internalType": "uint64", "name": "_challengePeriodBlocks", "type": "uint64" }, { "internalType": "contract IOneStepProofEntry", "name": "_oneStepProofEntry", "type": "address" }, { "internalType": "uint256", "name": "layerZeroBlockEdgeHeight", "type": "uint256" }, { "internalType": "uint256", "name": "layerZeroBigStepEdgeHeight", "type": "uint256" }, { "internalType": "uint256", "name": "layerZeroSmallStepEdgeHeight", "type": "uint256" }, { "internalType": "contract IERC20", "name": "_stakeToken", "type": "address" }, { "internalType": "address", "name": "_excessStakeReceiver", "type": "address" }, { "internalType": "uint8", "name": "_numBigStepLevel", "type": "uint8" }, { "internalType": "uint256[]", "name": "_stakeAmounts", "type": "uint256[]" } ], "name": "initialize", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "bytes32[]", "name": "edgeIds", "type": "bytes32[]" }, { "internalType": "uint256", "name": "maximumCachedTime", "type": "uint256" } ], "name": "multiUpdateTimeCacheByChildren", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "oneStepProofEntry", "outputs": [ { "internalType": "contract IOneStepProofEntry", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "bytes32", "name": "edgeId", "type": "bytes32" } ], "name": "refundStake", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "name": "stakeAmounts", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "stakeToken", "outputs": [ { "internalType": "contract IERC20", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "bytes32", "name": "edgeId", "type": "bytes32" } ], "name": "timeUnrivaled", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "bytes32", "name": "edgeId", "type": "bytes32" }, { "internalType": "uint256", "name": "maximumCachedTime", "type": "uint256" } ], "name": "updateTimerCacheByChildren", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "bytes32", "name": "edgeId", "type": "bytes32" }, { "internalType": "bytes32", "name": "claimingEdgeId", "type": "bytes32" }, { "internalType": "uint256", "name": "maximumCachedTime", "type": "uint256" } ], "name": "updateTimerCacheByClaim", "outputs": [], "stateMutability": "nonpayable", "type": "function" } ], "bytecode": "0x60806040523480156200001157600080fd5b506200001c62000022565b620000e4565b600054610100900460ff16156200008f5760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60005460ff9081161015620000e2576000805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b615bf780620000f46000396000f3fe608060405234801561001057600080fd5b50600436106101ef5760003560e01c8063655b42f31161010f578063c32d8c63116100a2578063eae0328b11610071578063eae0328b146104b1578063edaab54a146104c4578063f8ee77d6146104d7578063fda2892e146104e057600080fd5b8063c32d8c6314610443578063c8bc4e4314610456578063e5b123da1461047e578063e94e051e1461049e57600080fd5b80638c1b3a40116100de5780638c1b3a40146103ea578063908517e9146103fd578063b2a1408e14610410578063bce6f54f1461042357600080fd5b8063655b42f314610378578063748926f3146103b1578063750e0c0f146103c45780638826a370146103d757600080fd5b8063432bb78a1161018757806351ed6a301161015657806351ed6a301461031057806354b64151146103235780635a48e0f4146103465780635d9e24441461035957600080fd5b8063432bb78a1461028d57806346c2781a146102a057806348923bc5146102cb57806348dd2924146102f657600080fd5b80631dce5166116101c35780631dce5166146102555780633e35f5e81461025e578063416e66571461027157806342e1aaa81461027a57600080fd5b80624d8efe146101f457806305fae1411461021a5780631a72d54c1461022d5780631c1b4f3a14610242575b600080fd5b610207610202366004614c06565b610500565b6040519081526020015b60405180910390f35b610207610228366004614c50565b61051b565b61024061023b366004614d02565b610aa3565b005b610207610250366004614dd5565b610e20565b610207600a5481565b61020761026c366004614dd5565b610e41565b610207600b5481565b610207610288366004614e06565b610e54565b61024061029b366004614e23565b610ed8565b6008546102b3906001600160401b031681565b6040516001600160401b039091168152602001610211565b6009546102de906001600160a01b031681565b6040516001600160a01b039091168152602001610211565b6008546102de90600160401b90046001600160a01b031681565b6006546102de906001600160a01b031681565b610336610331366004614dd5565b610f73565b6040519015158152602001610211565b610207610354366004614dd5565b610f80565b600d546103669060ff1681565b60405160ff9091168152602001610211565b610336610386366004614e6e565b6001600160a01b03919091166000908152600460209081526040808320938352929052205460ff1690565b6102406103bf366004614dd5565b610f8d565b6103366103d2366004614dd5565b611080565b6102406103e5366004614e9a565b611097565b6102406103f8366004614ec6565b6110ff565b61033661040b366004614dd5565b6112ae565b61024061041e366004614f8e565b6112bb565b610207610431366004614dd5565b60009081526002602052604090205490565b610207610451366004614fc8565b6115c4565b61046961046436600461500a565b6115dd565b60408051928352602083019190915201610211565b61020761048c366004614dd5565b60009081526003602052604090205490565b6005546102de906001600160a01b031681565b6102076104bf366004614dd5565b611799565b6102406104d2366004615089565b6117ae565b610207600c5481565b6104f36104ee366004614dd5565b611807565b60405161021191906150d5565b6000610510878787878787611926565b979650505050505050565b60008060088054906101000a90046001600160a01b03166001600160a01b03166312ab3d3b6040518163ffffffff1660e01b8152600401602060405180830381865afa15801561056f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061059391906151bd565b159050808015610612575060085460405163facd743b60e01b8152336004820152600160401b9091046001600160a01b03169063facd743b90602401602060405180830381865afa1580156105ec573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061061091906151bd565b155b1561063757604051633b4f6e2b60e21b81523360048201526024015b60405180910390fd5b61063f614a15565b600061065c61065160208701876151df565b600d5460ff1661196b565b9050600061066982610e54565b9050610673614a59565b6000836002811115610687576106876150ab565b036109525761069960a08801886151fa565b90506000036106bb57604051630c9ccac560e41b815260040160405180910390fd5b6000806106cb60a08a018a6151fa565b8101906106d8919061548e565b925092505060088054906101000a90046001600160a01b03166001600160a01b031663e51019a68a606001358360000151846020015185604001516040518563ffffffff1660e01b81526004016107329493929190615562565b60006040518083038186803b15801561074a57600080fd5b505afa15801561075e573d6000803e3d6000fd5b505060085460208481015186519187015160408089015190516372880cd360e11b8152600160401b9095046001600160a01b0316965063e51019a695506107aa94929392600401615562565b60006040518083038186803b1580156107c257600080fd5b505afa1580156107d6573d6000803e3d6000fd5b5050505080600001516040015189602001351461081b5780516040908101519051631d31f4cd60e11b815260208b01356004820152602481019190915260440161062e565b6040805160c08101825260608b013580825260208481015190830152600854835163e531d8c760e01b815260048101929092529192830191600160401b90046001600160a01b03169063e531d8c790602401602060405180830381865afa15801561088a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108ae91906151bd565b15158152600854602084810151604051632b5de4f360e11b81526004810191909152920191600091600160401b90046001600160a01b0316906356bbc9e690602401602060405180830381865afa15801561090d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061093191906155af565b6001600160401b031611815292516020840152905160409092019190915290505b600954600d5461097a916001918a9185916001600160a01b0390911690879060ff168b6119da565b6006549094506001600160a01b03166000600761099a60208b018b6151df565b60ff16815481106109ad576109ad6155cc565b60009182526020909120015490506001600160a01b038216158015906109d257508015155b15610a0e5760008660c001516109e857306109f5565b6005546001600160a01b03165b9050610a0c6001600160a01b038416338385611ab0565b505b8560400151866020015187600001517faa4b66b1ce938c06e2a3f8466bae10ef62e747630e3859889f4719fc6427b5a489606001518a608001518b60a001518c60c001518d60e00151604051610a8d959493929190948552602085019390935260ff919091166040840152151560608301521515608082015260a00190565b60405180910390a4505092519695505050505050565b600054610100900460ff1615808015610ac35750600054600160ff909116105b80610add5750303b158015610add575060005460ff166001145b610b405760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b606482015260840161062e565b6000805460ff191660011790558015610b63576000805461ff0019166101001790555b6001600160a01b038c16610b8a5760405163641f043160e11b815260040160405180910390fd5b600880546001600160a01b03808f16600160401b0268010000000000000000600160e01b0319909216919091179091558a16610bd95760405163fb60b0ef60e01b815260040160405180910390fd5b600980546001600160a01b0319166001600160a01b038c161790556001600160401b038b16600003610c1e57604051632283bb7360e21b815260040160405180910390fd5b6008805467ffffffffffffffff19166001600160401b038d16179055600680546001600160a01b0319166001600160a01b03888116919091179091558516610c79576040516301e1d91560e31b815260040160405180910390fd5b600580546001600160a01b0319166001600160a01b038716179055610c9d89611b1b565b610cbd57604051633abfb6ff60e21b8152600481018a905260240161062e565b600a899055610ccb88611b1b565b610ceb57604051633abfb6ff60e21b81526004810189905260240161062e565b600b889055610cf987611b1b565b610d1957604051633abfb6ff60e21b81526004810188905260240161062e565b600c87905560ff8416600003610d4257604051632a18f5b960e21b815260040160405180910390fd5b60fd8460ff161115610d6c5760405163040d23bf60e41b815260ff8516600482015260240161062e565b600d805460ff191660ff861617905581610d878560026155f8565b60ff1614610dbf5781610d9b8560026155f8565b604051622bb3a760e61b8152600481019290925260ff16602482015260440161062e565b610dcb60078484614a9b565b508015610e12576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b505050505050505050505050565b60078181548110610e3057600080fd5b600091825260209091200154905081565b6000610e4e600183611b45565b92915050565b600080826002811115610e6957610e696150ab565b03610e76575050600a5490565b6001826002811115610e8a57610e8a6150ab565b03610e97575050600b5490565b6002826002811115610eab57610eab6150ab565b03610eb8575050600c5490565b81604051630efcb87b60e21b815260040161062e9190615611565b919050565b6000829003610efa5760405163521299a960e01b815260040160405180910390fd5b610f2b8383610f0a600182615624565b818110610f1957610f196155cc565b60019260209091020135905083611ccf565b5060005b82811015610f6d57610f5b848483818110610f4c57610f4c6155cc565b905060200201356000196117ae565b80610f6581615637565b915050610f2f565b50505050565b6000610e4e600183611d25565b6000610e4e600183611d59565b6000610f9a600183611daa565b9050610fa581611df3565b6006546009820154600780546001600160a01b0390931692600092600160481b900460ff16908110610fd957610fd96155cc565b60009182526020909120015490506001600160a01b03821615801590610ffe57508015155b1561101f57600883015461101f906001600160a01b03848116911683611eb6565b600084815260016020526040902061103690611eeb565b604080516001600160a01b03851681526020810184905286917fa635398959ddb5ce3b14537edfc25b2e671274c9b8cad0f4bd634752e69007b6910160405180910390a350505050565b6000818152600160205260408120610e4e90611f1b565b600d5460009081906110b3906001908790879060ff1687611f34565b9150915081156110f857847fbe17755d8d836ad67bfaf8e5b3869aedb4cba03f295a167c5547feddd9ef50ad826040516110ef91815260200190565b60405180910390a25b5050505050565b600061110c600189611d59565b6008546040516304972af960e01b8152919250600160401b90046001600160a01b0316906304972af9906111469084908a90600401615650565b60006040518083038186803b15801561115e57600080fd5b505afa158015611172573d6000803e3d6000fd5b505050506000604051806060016040528088608001602081019061119691906156c9565b6001600160401b0316815260200160088054906101000a90046001600160a01b03166001600160a01b031663e78cea926040518163ffffffff1660e01b8152600401602060405180830381865afa1580156111f5573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061121991906156e6565b6001600160a01b0390811682528935602090920191909152600954600d54600b54600c54949550611261946001948f9416928e9288928e928e928e928e9260ff169190611f9b565b600089815260016020526040902061127890611eeb565b6040518a907fe11db4b27bc8c6ea5943ecbb205ae1ca8d56c42c719717aaf8a53d43d0cee7c290600090a3505050505050505050565b6000610e4e600183612301565b60006112c8600184611daa565b90506112d3816123bc565b61131c576112e0816123e0565b60088201546007830154604051631cb1906160e31b815260048101939093526001600160a01b039091166024830152604482015260640161062e565b600080806009840154600d5461133f9160ff600160481b9091048116911661196b565b6002811115611350576113506150ab565b1490508080156113d4575060085460078401546040516306106c4560e31b81526004810191909152600160401b9091046001600160a01b031690633083622890602401602060405180830381865afa1580156113b0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113d491906151bd565b156115495760085460078401546040516372880cd360e11b8152600160401b9092046001600160a01b03169163e51019a69161142091889060c08201359060e083013590600401615703565b60006040518083038186803b15801561143857600080fd5b505afa15801561144c573d6000803e3d6000fd5b5050600854604051631171558560e01b815260c08801356004820152600160401b9091046001600160a01b0316925063117155859150602401602060405180830381865afa1580156114a2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114c691906155af565b600854604051632b5de4f360e11b815260c08701356004820152600160401b9091046001600160a01b0316906356bbc9e690602401602060405180830381865afa158015611518573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061153c91906155af565b6115469190615790565b91505b60085460009061156890600190889086906001600160401b0316612415565b600087815260016020526040902090915061158290611eeb565b867f2e0808830a22204cb3fb8f8d784b28bc97e9ce2e39d2f9cde2860de0957d68eb836040516115b491815260200190565b60405180910390a3505050505050565b60006115d386868686866124d4565b9695505050505050565b600080600080600061162c898989898080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250600195949392505061252e9050565b8151929550909350915015806116c4578260400151836020015184600001517faa4b66b1ce938c06e2a3f8466bae10ef62e747630e3859889f4719fc6427b5a4866060015187608001518860a001518960c001518a60e001516040516116bb959493929190948552602085019390935260ff919091166040840152151560608301521515608082015260a00190565b60405180910390a45b8160400151826020015183600001517faa4b66b1ce938c06e2a3f8466bae10ef62e747630e3859889f4719fc6427b5a4856060015186608001518760a001518860c001518960e00151604051611743959493929190948552602085019390935260ff919091166040840152151560608301521515608082015260a00190565b60405180910390a48151604051821515815285908c907f7340510d24b7ec9b5c100f5500d93429d80d00d46f0d18e4e85d0c4cc22b99249060200160405180910390a45051919350909150505b94509492505050565b6000610e4e6117a9600184611daa565b61282f565b6000806117bd60018585612874565b915091508115610f6d57837fbe17755d8d836ad67bfaf8e5b3869aedb4cba03f295a167c5547feddd9ef50ad826040516117f991815260200190565b60405180910390a250505050565b61180f614ae6565b61181a600183611daa565b604080516101e0810182528254815260018084015460208301526002840154928201929092526003830154606082015260048301546080820152600583015460a0820152600683015460c0820152600783015460e082015260088301546001600160a01b038116610100830152600160a01b90046001600160401b039081166101208301526009840154908116610140830152909291610160840191600160401b900460ff16908111156118d0576118d06150ab565b60018111156118e1576118e16150ab565b81526009919091015460ff600160481b820481166020840152600160501b820416151560408301526001600160401b03600160581b9091041660609091015292915050565b600061193587878787876124d4565b60408051602081019290925281018390526060016040516020818303038152906040528051906020012090509695505050505050565b60008260ff1660000361198057506000610e4e565b8160ff168360ff161161199557506001610e4e565b6119a08260016155f8565b60ff168360ff16036119b457506002610e4e565b6040516315c1b4af60e31b815260ff80851660048301528316602482015260440161062e565b6119e2614a15565b6000806119f28a8a8a8a89612898565b915091506000611a03838b89612d19565b90506000611a1283838d612e2c565b90508515611a96576000611a2582612e5f565b33600090815260038f016020908152604080832084845290915290205490915060ff1615611a6f57604051632d23561d60e11b81523360048201526024810182905260440161062e565b33600090815260038e016020908152604080832093835292905220805460ff191660011790555b611aa08c82612e83565b9c9b505050505050505050505050565b6040516001600160a01b0380851660248301528316604482015260648101829052610f6d9085906323b872dd60e01b906084015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b03199093169290921790915261317a565b600081600003611b2d57506000919050565b6000611b3a600184615624565b929092161592915050565b6000818152602083905260408120611b5c90611f1b565b611b7b5760405162a7b02