From 6cff418a12906be2d3bcc24b15267e40abc8feb7 Mon Sep 17 00:00:00 2001 From: envestcc Date: Tue, 6 Jun 2023 17:01:06 +0800 Subject: [PATCH 1/7] handle BucketTypeExpanded event --- blockindex/contractstaking/event_handler.go | 53 +++++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/blockindex/contractstaking/event_handler.go b/blockindex/contractstaking/event_handler.go index daecaf9a30..83214edfa9 100644 --- a/blockindex/contractstaking/event_handler.go +++ b/blockindex/contractstaking/event_handler.go @@ -357,6 +357,31 @@ const ( ], "name": "Withdrawal", "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "duration", + "type": "uint256" + } + ], + "name": "BucketTypeExpanded", + "type": "event" } ]` ) @@ -421,6 +446,8 @@ func (eh *contractStakingEventHandler) HandleEvent(ctx context.Context, blk *blo return eh.handleDurationExtendedEvent(event) case "AmountIncreased": return eh.handleAmountIncreasedEvent(event) + case "BucketTypeExpanded": + return eh.handleBucketTypeExpandedEvent(event) case "DelegateChanged": return eh.handleDelegateChangedEvent(event) case "Withdrawal": @@ -666,6 +693,32 @@ func (eh *contractStakingEventHandler) handleAmountIncreasedEvent(event eventPar return eh.dirty.updateBucketInfo(tokenIDParam.Uint64(), b) } +func (eh *contractStakingEventHandler) handleBucketTypeExpandedEvent(event eventParam) error { + tokenIDParam, err := event.IndexedFieldUint256("tokenId") + if err != nil { + return err + } + amountParam, err := event.FieldUint256("amount") + if err != nil { + return err + } + durationParam, err := event.FieldUint256("duration") + if err != nil { + return err + } + + b, ok := eh.dirty.getBucketInfo(tokenIDParam.Uint64()) + if !ok { + return errors.Wrapf(ErrBucketNotExist, "token id %d", tokenIDParam.Uint64()) + } + newBtIdx, _, ok := eh.dirty.matchBucketType(amountParam, durationParam.Uint64()) + if !ok { + return errors.Wrapf(errBucketTypeNotExist, "amount %d, duration %d", amountParam.Int64(), durationParam.Uint64()) + } + b.TypeIndex = newBtIdx + return eh.dirty.updateBucketInfo(tokenIDParam.Uint64(), b) +} + func (eh *contractStakingEventHandler) handleDelegateChangedEvent(event eventParam) error { tokenIDParam, err := event.IndexedFieldUint256("tokenId") if err != nil { From e5cb30144f4d9faced5dfc365e059b44f68155bc Mon Sep 17 00:00:00 2001 From: envestcc Date: Tue, 6 Jun 2023 17:01:28 +0800 Subject: [PATCH 2/7] add tests --- blockindex/contractstaking/indexer_test.go | 56 ++++++++++++++++ e2etest/contract_staking_test.go | 74 +++++++++++++++++++++- 2 files changed, 129 insertions(+), 1 deletion(-) diff --git a/blockindex/contractstaking/indexer_test.go b/blockindex/contractstaking/indexer_test.go index 772a34b3a6..8f25b068b3 100644 --- a/blockindex/contractstaking/indexer_test.go +++ b/blockindex/contractstaking/indexer_test.go @@ -382,6 +382,53 @@ func TestContractStakingIndexerBucketInfo(t *testing.T) { r.EqualValues(1, indexer.TotalBucketCount()) } +func TestContractStakingIndexerChangeBucketType(t *testing.T) { + r := require.New(t) + testDBPath, err := testutil.PathOfTempFile("staking.db") + r.NoError(err) + defer testutil.CleanupPath(testDBPath) + cfg := db.DefaultConfig + cfg.DbPath = testDBPath + kvStore := db.NewBoltDB(cfg) + indexer, err := NewContractStakingIndexer(kvStore, _testStakingContractAddress, 0) + r.NoError(err) + r.NoError(indexer.Start(context.Background())) + + // init bucket type + bucketTypeData := [][2]int64{ + {10, 10}, + {20, 10}, + {10, 100}, + {20, 100}, + } + height := uint64(1) + handler := newContractStakingEventHandler(indexer.cache, height) + for _, data := range bucketTypeData { + activateBucketType(r, handler, data[0], data[1], height) + } + err = indexer.commit(handler) + r.NoError(err) + + t.Run("expand bucket type", func(t *testing.T) { + owner := identityset.Address(0) + delegate := identityset.Address(1) + height++ + handler = newContractStakingEventHandler(indexer.cache, height) + stake(r, handler, owner, delegate, 1, 10, 100, height) + r.NoError(err) + r.NoError(indexer.commit(handler)) + bucket, ok := indexer.Bucket(1) + r.True(ok) + + expandBucketType(r, handler, int64(bucket.Index), 20, 100) + r.NoError(indexer.commit(handler)) + bucket, ok = indexer.Bucket(bucket.Index) + r.True(ok) + r.EqualValues(20, bucket.StakedAmount.Int64()) + r.EqualValues(100, bucket.StakedDurationBlockNumber) + }) +} + func BenchmarkIndexer_PutBlockBeforeContractHeight(b *testing.B) { // Create a new Indexer with a contract height of 100 indexer := &Indexer{contractDeployHeight: 100} @@ -458,3 +505,12 @@ func withdraw(r *require.Assertions, handler *contractStakingEventHandler, token }) r.NoError(err) } + +func expandBucketType(r *require.Assertions, handler *contractStakingEventHandler, token, amount, duration int64) { + err := handler.handleBucketTypeExpandedEvent(eventParam{ + "tokenId": big.NewInt(token), + "amount": big.NewInt(amount), + "duration": big.NewInt(duration), + }) + r.NoError(err) +} diff --git a/e2etest/contract_staking_test.go b/e2etest/contract_staking_test.go index e5ca295c0d..f8dfc7b0f6 100644 --- a/e2etest/contract_staking_test.go +++ b/e2etest/contract_staking_test.go @@ -39,7 +39,7 @@ import ( const ( // _stakingContractByteCode is the byte code of the contract staking contract for testing, which changes the freeze blocks to 10 - _stakingContractByteCode = `60806040523480156200001157600080fd5b5060405180604001604052806009815260200168109d58dad95d13919560ba1b815250604051806040016040528060038152602001621092d560ea1b81525081600090816200006191906200019b565b5060016200007082826200019b565b5050506200008d62000087620000a060201b60201c565b620000a4565b6006805460ff60a01b1916905562000267565b3390565b600680546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b634e487b7160e01b600052604160045260246000fd5b600181811c908216806200012157607f821691505b6020821081036200014257634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200019657600081815260208120601f850160051c81016020861015620001715750805b601f850160051c820191505b8181101562000192578281556001016200017d565b5050505b505050565b81516001600160401b03811115620001b757620001b7620000f6565b620001cf81620001c884546200010c565b8462000148565b602080601f831160018114620002075760008415620001ee5750858301515b600019600386901b1c1916600185901b17855562000192565b600085815260208120601f198616915b82811015620002385788860151825594840194600190910190840162000217565b5085821015620002575787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b613dbf80620002776000396000f3fe6080604052600436106102925760003560e01c80637acb77571161015a578063bbe33ea5116100c1578063e449f3411161007a578063e449f341146107e9578063e985e9c514610809578063eb0ffb2e14610852578063eec7ee7314610872578063f0b56b5d14610885578063f2fde38b1461089a57600080fd5b8063bbe33ea514610740578063c87b56dd14610753578063c8e7792314610773578063d0949f9914610793578063d6605fd8146107a9578063e0028ecf146107c957600080fd5b806398ca3b761161011357806398ca3b76146106985780639f7d5b00146106b8578063a22cb465146106cd578063b2383e55146106ed578063b88d4fde14610700578063b8f4bd7b1461072057600080fd5b80637acb7757146105fd5780638456cb59146106105780638da5cb5b1461062557806393b6ef591461064357806395d89b4114610663578063960014bd1461067857600080fd5b806342842e0e116101fe5780636198e339116101b75780636198e339146105485780636352211e1461056857806370a0823114610588578063711563d4146105a8578063715018a6146105bb57806378bfca10146105d057600080fd5b806342842e0e14610458578063431cd92a1461047857806343e06c59146104c95780635c975abb146104e95780635ceb8b5b146105085780635d36598f1461052857600080fd5b80630f5b2ca5116102505780630f5b2ca5146103965780631338736f146103b657806323b872dd146103d65780632e17de78146103f65780633f4ba83a146104165780633fd140df1461042b57600080fd5b8062f714ce1461029757806301ffc9a7146102b957806303459b16146102ee57806306fdde031461031c578063081812fc1461033e578063095ea7b314610376575b600080fd5b3480156102a357600080fd5b506102b76102b23660046134d2565b6108ba565b005b3480156102c557600080fd5b506102d96102d4366004613518565b610981565b60405190151581526020015b60405180910390f35b3480156102fa57600080fd5b5061030e610309366004613535565b6109d3565b6040519081526020016102e5565b34801561032857600080fd5b506103316109f9565b6040516102e5919061359e565b34801561034a57600080fd5b5061035e610359366004613535565b610a8b565b6040516001600160a01b0390911681526020016102e5565b34801561038257600080fd5b506102b76103913660046135b1565b610ab2565b3480156103a257600080fd5b506102b76103b13660046134d2565b610bc7565b3480156103c257600080fd5b506102b76103d13660046135dd565b610c34565b3480156103e257600080fd5b506102b76103f13660046135ff565b610ca7565b34801561040257600080fd5b506102b7610411366004613535565b610cd8565b34801561042257600080fd5b506102b7610d87565b34801561043757600080fd5b5061044b61044636600461368b565b610d99565b6040516102e591906136cc565b34801561046457600080fd5b506102b76104733660046135ff565b610f1b565b34801561048457600080fd5b50610498610493366004613535565b610f36565b6040805195865260208601949094529284019190915260608301526001600160a01b0316608082015260a0016102e5565b3480156104d557600080fd5b506102d96104e43660046135dd565b610fb2565b3480156104f557600080fd5b50600654600160a01b900460ff166102d9565b34801561051457600080fd5b506102b7610523366004613756565b610fcd565b34801561053457600080fd5b506102b761054336600461368b565b611074565b34801561055457600080fd5b506102b7610563366004613535565b61110a565b34801561057457600080fd5b5061035e610583366004613535565b61116c565b34801561059457600080fd5b5061030e6105a33660046137a1565b6111cc565b61030e6105b63660046137be565b611252565b3480156105c757600080fd5b506102b761132b565b3480156105dc57600080fd5b506105f06105eb3660046135dd565b61133d565b6040516102e591906137fd565b61030e61060b3660046134d2565b611472565b34801561061c57600080fd5b506102b76114f6565b34801561063157600080fd5b506006546001600160a01b031661035e565b34801561064f57600080fd5b5061030e61065e366004613535565b611506565b34801561066f57600080fd5b50610331611531565b34801561068457600080fd5b5061044b61069336600461368b565b611540565b3480156106a457600080fd5b506102b76106b3366004613856565b6116ba565b3480156106c457600080fd5b50600b5461030e565b3480156106d957600080fd5b506102b76106e83660046138ac565b611750565b6102b76106fb3660046135dd565b61175f565b34801561070c57600080fd5b506102b761071b366004613925565b611863565b34801561072c57600080fd5b506102b761073b366004613856565b61189b565b6102b761074e366004613756565b61198a565b34801561075f57600080fd5b5061033161076e366004613535565b611b94565b34801561077f57600080fd5b506102b761078e3660046135dd565b611c07565b34801561079f57600080fd5b5061030e60001981565b3480156107b557600080fd5b506102b76107c43660046135dd565b611dac565b3480156107d557600080fd5b506102b76107e43660046135dd565b611e91565b3480156107f557600080fd5b506102b761080436600461368b565b611f05565b34801561081557600080fd5b506102d96108243660046139e8565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205460ff1690565b34801561085e57600080fd5b506102b761086d3660046135dd565b611fe1565b61030e610880366004613a16565b612057565b34801561089157600080fd5b5061030e600a81565b3480156108a657600080fd5b506102b76108b53660046137a1565b61215c565b6108c26121d5565b816108cc81612222565b600083815260086020526040902060028101546108e890612277565b156109325760405162461bcd60e51b81526020600482015260156024820152746e6f7420726561647920746f20776974686472617760581b60448201526064015b60405180910390fd5b61093b846122eb565b610945818461238e565b6040516001600160a01b0384169085907fd964a27d45f595739c13d8b1160b57491050cacf3a2e5602207277d6228f64ee90600090a350505050565b60006001600160e01b031982166380ac58cd60e01b14806109b257506001600160e01b03198216635b5e139f60e01b145b806109cd57506301ffc9a760e01b6001600160e01b03198316145b92915050565b60006109de8261244d565b6000828152600860205260409020600201546109cd90612277565b606060008054610a0890613adc565b80601f0160208091040260200160405190810160405280929190818152602001828054610a3490613adc565b8015610a815780601f10610a5657610100808354040283529160200191610a81565b820191906000526020600020905b815481529060010190602001808311610a6457829003601f168201915b5050505050905090565b6000610a968261244d565b506000908152600460205260409020546001600160a01b031690565b6000610abd8261116c565b9050806001600160a01b0316836001600160a01b031603610b2a5760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b6064820152608401610929565b336001600160a01b0382161480610b465750610b468133610824565b610bb85760405162461bcd60e51b815260206004820152603d60248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60448201527f6b656e206f776e6572206f7220617070726f76656420666f7220616c6c0000006064820152608401610929565b610bc283836124ac565b505050565b610bcf6121d5565b81610bd981612222565b6000838152600860205260409020610bf1908361251a565b6040516001600160a01b038316815283907f6f08c7e76d830d5f3d0a18fd27f4d8c0049b24a8689ddb39625e0864d894a9c19060200160405180910390a2505050565b610c3c6121d5565b81610c4681612222565b6000838152600860205260409020610c5d81612618565b610c678184612662565b837f907fece23ce39fbcbceb71e515043fe29408353fbb393b25b35eb8a70a4bad0b84604051610c9991815260200190565b60405180910390a250505050565b610cb1338261274f565b610ccd5760405162461bcd60e51b815260040161092990613b16565b610bc28383836127cd565b610ce06121d5565b80610cea81612222565b6000828152600860205260409020610d0181612618565b610d0a8161293e565b15610d4e5760405162461bcd60e51b81526020600482015260146024820152736e6f7420726561647920746f20756e7374616b6560601b6044820152606401610929565b610d57816129e3565b60405183907f11725367022c3ff288940f4b5473aa61c2da6a24af7363a1128ee2401e8983b290600090a2505050565b610d8f612a1a565b610d97612a74565b565b6060816001600160401b03811115610db357610db36138df565b604051908082528060200260200182016040528015610de657816020015b6060815260200190600190039081610dd15790505b5090506000610df4600b5490565b905060005b83811015610f1357816001600160401b03811115610e1957610e196138df565b604051908082528060200260200182016040528015610e42578160200160208202803683370190505b50838281518110610e5557610e55613b63565b60200260200101819052506000600a6000878785818110610e7857610e78613b63565b9050602002016020810190610e8d91906137a1565b6001600160a01b03166001600160a01b03168152602001908152602001600020905060005b83811015610f09576000818152602083905260409020548551869085908110610edd57610edd613b63565b60200260200101518281518110610ef657610ef6613b63565b6020908102919091010152600101610eb2565b5050600101610df9565b505092915050565b610bc283838360405180602001604052806000815250611863565b6000806000806000610f478661244d565b60008681526008602052604081208054600b80549293929091908110610f6f57610f6f613b63565b6000918252602090912060039182020180546001918201549185015460028601549590930154909b919a509198509296506001600160a01b031694509092505050565b6000610fc6610fc18484612ac9565b612b30565b9392505050565b610fd56121d5565b60008060005b8481101561106c57858582818110610ff557610ff5613b63565b90506020020135925061100783612222565b6000838152600860205260409020915061102082612618565b61102a8285612662565b827f907fece23ce39fbcbceb71e515043fe29408353fbb393b25b35eb8a70a4bad0b8560405161105c91815260200190565b60405180910390a2600101610fdb565b505050505050565b61107c6121d5565b60008060005b838110156111035784848281811061109c5761109c613b63565b9050602002013592506110ae83612222565b600083815260086020526040902091506110c782612b61565b6110d082612bab565b60405183907ff27b6ce5b2f5e68ddb2fd95a8a909d4ecf1daaac270935fff052feacb24f184290600090a2600101611082565b5050505050565b6111126121d5565b8061111c81612222565b600082815260086020526040902061113381612b61565b61113c81612bab565b60405183907ff27b6ce5b2f5e68ddb2fd95a8a909d4ecf1daaac270935fff052feacb24f184290600090a2505050565b6000818152600260205260408120546001600160a01b0316806109cd5760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b6044820152606401610929565b60006001600160a01b0382166112365760405162461bcd60e51b815260206004820152602960248201527f4552433732313a2061646472657373207a65726f206973206e6f7420612076616044820152683634b21037bbb732b960b91b6064820152608401610929565b506001600160a01b031660009081526003602052604090205490565b600061125c6121d5565b6000821180156112745750346112728387613b8f565b145b6112905760405162461bcd60e51b815260040161092990613ba6565b600061129c8686612ac9565b90506112a781612bff565b600754600101915060005b83811015611320576112c48286612c4b565b6112ce8184613bd2565b604080516001600160a01b0388168152602081018a90529081018890527f17700ceb1658b18206f427c1578048e87504106b14ec69e9b4586d9a95174a329060600160405180910390a26001016112b2565b50505b949350505050565b611333612a1a565b610d976000612ce5565b606060008211801561135a5750600b546113578385613bd2565b11155b6113765760405162461bcd60e51b815260040161092990613ba6565b816001600160401b0381111561138e5761138e6138df565b6040519080825280602002602001820160405280156113e357816020015b6113d060405180606001604052806000815260200160008152602001600081525090565b8152602001906001900390816113ac5790505b50905060005b8281101561146b57600b8185018154811061140657611406613b63565b9060005260206000209060030201604051806060016040529081600082015481526020016001820154815260200160028201548152505082828151811061144f5761144f613b63565b60200260200101819052506114648160010190565b90506113e9565b5092915050565b600061147c6121d5565b3460006114898286612ac9565b905061149481612bff565b61149e8185612c4b565b600754604080516001600160a01b03871681526020810185905290810187905281907f17700ceb1658b18206f427c1578048e87504106b14ec69e9b4586d9a95174a329060600160405180910390a295945050505050565b6114fe612a1a565b610d97612d37565b60006115118261244d565b600082815260086020526040902061152881612618565b610fc68161293e565b606060018054610a0890613adc565b6060816001600160401b0381111561155a5761155a6138df565b60405190808252806020026020018201604052801561158d57816020015b60608152602001906001900390816115785790505b509050600061159b600b5490565b905060005b83811015610f1357816001600160401b038111156115c0576115c06138df565b6040519080825280602002602001820160405280156115e9578160200160208202803683370190505b508382815181106115fc576115fc613b63565b602002602001018190525060006009600087878581811061161f5761161f613b63565b905060200201602081019061163491906137a1565b6001600160a01b03166001600160a01b03168152602001908152602001600020905060005b838110156116b057600081815260208390526040902054855186908590811061168457611684613b63565b6020026020010151828151811061169d5761169d613b63565b6020908102919091010152600101611659565b50506001016115a0565b6116c26121d5565b6000805b83811015611103578484828181106116e0576116e0613b63565b9050602002013591506116f282612222565b600082815260086020526040902061170a908461251a565b6040516001600160a01b038416815282907f6f08c7e76d830d5f3d0a18fd27f4d8c0049b24a8689ddb39625e0864d894a9c19060200160405180910390a26001016116c6565b61175b338383612d7a565b5050565b6117676121d5565b8161177181612222565b600083815260086020526040902061178881612b61565b8054600b805460009190839081106117a2576117a2613b63565b90600052602060002090600302019050848160000154346117c39190613bd2565b146117e05760405162461bcd60e51b815260040161092990613be5565b60038301546001600160a01b03166000908152600a602090815260408083208584529091529020805460001901905560018101546118219084908790612e48565b857f1d9c4d2b3e13eb9ac08a42625750ac17ec6ca94b4755c49285e9467b4e48c89d8660405161185391815260200190565b60405180910390a2505050505050565b61186d338361274f565b6118895760405162461bcd60e51b815260040161092990613b16565b61189584848484612e94565b50505050565b6118a36121d5565b60008060005b8481101561106c578585828181106118c3576118c3613b63565b9050602002013592506118d583612222565b600083815260086020526040902060028101549092506118f490612277565b156119395760405162461bcd60e51b81526020600482015260156024820152746e6f7420726561647920746f20776974686472617760581b6044820152606401610929565b611942836122eb565b61194c828561238e565b6040516001600160a01b0385169084907fd964a27d45f595739c13d8b1160b57491050cacf3a2e5602207277d6228f64ee90600090a36001016118a9565b6119926121d5565b600182116119d35760405162461bcd60e51b815260206004820152600e60248201526d0d2dcecc2d8d2c840d8cadccee8d60931b6044820152606401610929565b3460008080855b8015611b8a57600019018787828181106119f6576119f6613b63565b905060200201359350611a0884612222565b60008481526008602052604090209250611a2183612618565b82546003840154600b80546001600160a01b039092169183908110611a4857611a48613b63565b906000526020600020906003020193508360010154881015611a9f5760405162461bcd60e51b815260206004820152601060248201526f34b73b30b634b210323ab930ba34b7b760811b6044820152606401610929565b8354611aab9088613bd2565b9650611abd8560010154600019141590565b15611af2576001600160a01b038116600090815260096020908152604080832085845290915290208054600019019055611b1e565b6001600160a01b0381166000908152600a60209081526040808320858452909152902080546000190190555b8215611b3257611b2d866122eb565b611b83565b6000196001860155611b4585888a612e48565b7fb3f4c8ca702dbbd32d9a25ce17b1942a5060284d9d69fc4fcac8fb0397891b128a8a898b604051611b7a9493929190613c10565b60405180910390a15b50506119da565b5050505050505050565b6060611b9f8261244d565b6000611bb660408051602081019091526000815290565b90506000815111611bd65760405180602001604052806000815250610fc6565b80611be084612ec7565b604051602001611bf1929190613c56565b6040516020818303038152906040529392505050565b611c0f612a1a565b81600003611c535760405162461bcd60e51b8152602060048201526011602482015270185b5bdd5b9d081a5cc81a5b9d985b1a59607a1b6044820152606401610929565b6000828152600c6020908152604080832084845290915290205415611cb25760405162461bcd60e51b81526020600482015260156024820152746475706c6963617465206275636b6574207479706560581b6044820152606401610929565b60408051606081018252838152602080820184815243838501908152600b8054600181018255600082815295517f0175b7a638427703f0dbe7bb9bbf987a2551717b34e79f33b5b1008d1fa01db960039092029182015592517f0175b7a638427703f0dbe7bb9bbf987a2551717b34e79f33b5b1008d1fa01dba84015590517f0175b7a638427703f0dbe7bb9bbf987a2551717b34e79f33b5b1008d1fa01dbb9092019190915554858352600c82528383208584528252918390209190915581518481529081018390527f6b39e3267efcd6611c8d7d2534c4715dcb4824322b90d85540a3a82967b6e7b791015b60405180910390a15050565b611db46121d5565b81611dbe81612222565b6000838152600860205260409020611dd581612b61565b8054600b80546000919083908110611def57611def613b63565b9060005260206000209060030201905080600101548511611e225760405162461bcd60e51b815260040161092990613be5565b60038301546001600160a01b03166000908152600a60209081526040808320858452909152902080546000190190558054611e5f90849087612e48565b857fc599168ac63ff28ec278088a2c424383a36ca26c931eb41af05e014f19252ea48660405161185391815260200190565b611e99612a1a565b43600b611ea68484612ac9565b81548110611eb657611eb6613b63565b9060005260206000209060030201600201819055507f6b39e3267efcd6611c8d7d2534c4715dcb4824322b90d85540a3a82967b6e7b78282604051611da0929190918252602082015260400190565b611f0d6121d5565b60008060005b8381101561110357848482818110611f2d57611f2d613b63565b905060200201359250611f3f83612222565b60008381526008602052604090209150611f5882612618565b611f618261293e565b15611fa55760405162461bcd60e51b81526020600482015260146024820152736e6f7420726561647920746f20756e7374616b6560601b6044820152606401610929565b611fae826129e3565b60405183907f11725367022c3ff288940f4b5473aa61c2da6a24af7363a1128ee2401e8983b290600090a2600101611f13565b611fe9612a1a565b600019600b611ff88484612ac9565b8154811061200857612008613b63565b9060005260206000209060030201600201819055507f099df2bf9247b43481cf1b791a4dd5fa1220c40c62940da539082fbcb30241d68282604051611da0929190918252602082015260400190565b60006120616121d5565b3482518561206f9190613b8f565b1461208c5760405162461bcd60e51b815260040161092990613ba6565b60006120988585612ac9565b90506120a381612bff565b600754600101915060005b8351811015612153576120da828583815181106120cd576120cd613b63565b6020026020010151612c4b565b6120e48184613bd2565b7f17700ceb1658b18206f427c1578048e87504106b14ec69e9b4586d9a95174a3285838151811061211757612117613b63565b602090810291909101810151604080516001600160a01b0390921682529181018a905290810188905260600160405180910390a26001016120ae565b50509392505050565b612164612a1a565b6001600160a01b0381166121c95760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610929565b6121d281612ce5565b50565b600654600160a01b900460ff1615610d975760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606401610929565b61222b8161116c565b6001600160a01b0316336001600160a01b0316146121d25760405162461bcd60e51b81526020600482015260096024820152683737ba1037bbb732b960b91b6044820152606401610929565b600060001982036122c35760405162461bcd60e51b81526020600482015260166024820152751b9bdd08185b881d5b9cdd185ad95908189d58dad95d60521b6044820152606401610929565b60006122d0600a84613bd2565b90504381116122e25750600092915050565b43900392915050565b60006122f68261116c565b9050612306816000846001612f59565b61230f8261116c565b600083815260046020908152604080832080546001600160a01b03199081169091556001600160a01b0385168085526003845282852080546000190190558785526002909352818420805490911690555192935084927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a45050565b6000600b8360000154815481106123a7576123a7613b63565b600091825260208220600390910201546040519092506001600160a01b0384169083908381818185875af1925050503d8060008114612402576040519150601f19603f3d011682016040523d82523d6000602084013e612407565b606091505b50509050806118955760405162461bcd60e51b81526020600482015260126024820152713330b4b632b2103a37903a3930b739b332b960711b6044820152606401610929565b6000818152600260205260409020546001600160a01b03166121d25760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b6044820152606401610929565b600081815260046020526040902080546001600160a01b0319166001600160a01b03841690811790915581906124e18261116c565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b61252382612618565b815460038301546001600160a01b0390811690831681036125565760405162461bcd60e51b815260040161092990613be5565b6001840154600019146125ac576001600160a01b038181166000908152600960208181526040808420878552825280842080546000190190559387168352908152828220858352905220805460010190556125f1565b6001600160a01b038181166000908152600a60208181526040808420878552825280842080546000190190559387168352908152828220858352905220805460010190555b505060039190910180546001600160a01b0319166001600160a01b03909216919091179055565b6002810154600019146121d25760405162461bcd60e51b81526020600482015260126024820152713737ba10309039ba30b5b2b2103a37b5b2b760711b6044820152606401610929565b815460038301546001600160a01b031661267b8461293e565b8310156126bd5760405162461bcd60e51b815260206004820152601060248201526f34b73b30b634b210323ab930ba34b7b760811b6044820152606401610929565b60006126ed600b84815481106126d5576126d5613b63565b90600052602060002090600302016000015485612ac9565b90506126f881612bff565b60001960018681018290556001600160a01b039390931660008181526009602090815260408083209783529681528682208054909401909355968390558652600a8152838620918652529220805490920190915550565b60008061275b8361116c565b9050806001600160a01b0316846001600160a01b031614806127a257506001600160a01b0380821660009081526005602090815260408083209388168352929052205460ff165b806113235750836001600160a01b03166127bb84610a8b565b6001600160a01b031614949350505050565b826001600160a01b03166127e08261116c565b6001600160a01b0316146128065760405162461bcd60e51b815260040161092990613c85565b6001600160a01b0382166128685760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b6064820152608401610929565b6128758383836001612f59565b826001600160a01b03166128888261116c565b6001600160a01b0316146128ae5760405162461bcd60e51b815260040161092990613c85565b600081815260046020908152604080832080546001600160a01b03199081169091556001600160a01b0387811680865260038552838620805460001901905590871680865283862080546001019055868652600290945282852080549092168417909155905184937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b600181015460009060001981036129905760405162461bcd60e51b81526020600482015260166024820152751b9bdd08185b881d5b9b1bd8dad95908189d58dad95d60521b6044820152606401610929565b6000600b8460000154815481106129a9576129a9613b63565b906000526020600020906003020160010154826129c69190613bd2565b90504381116129d9575060009392505050565b4390039392505050565b43600282015560038101546001600160a01b0316600090815260096020908152604080832093548352929052208054600019019055565b6006546001600160a01b03163314610d975760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610929565b612a7c613029565b6006805460ff60a01b191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b6000828152600c6020908152604080832084845290915281205480612b265760405162461bcd60e51b8152602060048201526013602482015272696e76616c6964206275636b6574207479706560681b6044820152606401610929565b6000198101611323565b600043600b8381548110612b4657612b46613b63565b90600052602060002090600302016002015411159050919050565b6001810154600019146121d25760405162461bcd60e51b81526020600482015260126024820152713737ba1030903637b1b5b2b2103a37b5b2b760711b6044820152606401610929565b80546003820154436001938401556001600160a01b03166000818152600a60209081526040808320858452825280832080546000190190559282526009815282822093825292909252902080549091019055565b612c0881612b30565b6121d25760405162461bcd60e51b8152602060048201526014602482015273696e616374697665206275636b6574207479706560601b6044820152606401610929565b6007805460019081018083556040805160808101825286815260001960208083018281528385019283526001600160a01b0389811660608601818152600098895260088552878920965187559251868a0155935160028601559051600390940180546001600160a01b03191694909116939093179092558352600a815281832087845290529020805490910190555461175b903390613079565b600680546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b612d3f6121d5565b6006805460ff60a01b1916600160a01b1790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258612aac3390565b816001600160a01b0316836001600160a01b031603612ddb5760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c6572000000000000006044820152606401610929565b6001600160a01b03838116600081815260056020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6000612e548383612ac9565b9050612e5f81612bff565b60038401546001600160a01b03166000908152600a602090815260408083208484529091529020805460010190559092555050565b612e9f8484846127cd565b612eab84848484613093565b6118955760405162461bcd60e51b815260040161092990613cca565b60606000612ed483613191565b60010190506000816001600160401b03811115612ef357612ef36138df565b6040519080825280601f01601f191660200182016040528015612f1d576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a8504945084612f2757509392505050565b80600114612fa95760405162461bcd60e51b815260206004820152601f60248201527f6261746368207472616e73666572206973206e6f7420737570706f72746564006044820152606401610929565b6001600160a01b0383161580612fd15750600082815260086020526040902060020154600019145b61301d5760405162461bcd60e51b815260206004820152601e60248201527f63616e6e6f74207472616e7366657220756e7374616b656420746f6b656e00006044820152606401610929565b61189584848484613269565b600654600160a01b900460ff16610d975760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606401610929565b61175b8282604051806020016040528060008152506132f1565b60006001600160a01b0384163b1561318957604051630a85bd0160e11b81526001600160a01b0385169063150b7a02906130d7903390899088908890600401613d1c565b6020604051808303816000875af1925050508015613112575060408051601f3d908101601f1916820190925261310f91810190613d59565b60015b61316f573d808015613140576040519150601f19603f3d011682016040523d82523d6000602084013e613145565b606091505b5080516000036131675760405162461bcd60e51b815260040161092990613cca565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050611323565b506001611323565b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b83106131d05772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef810000000083106131fc576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc10000831061321a57662386f26fc10000830492506010015b6305f5e1008310613232576305f5e100830492506008015b612710831061324657612710830492506004015b60648310613258576064830492506002015b600a83106109cd5760010192915050565b6001811115611895576001600160a01b038416156132af576001600160a01b038416600090815260036020526040812080548392906132a9908490613d76565b90915550505b6001600160a01b03831615611895576001600160a01b038316600090815260036020526040812080548392906132e6908490613bd2565b909155505050505050565b6132fb8383613324565b6133086000848484613093565b610bc25760405162461bcd60e51b815260040161092990613cca565b6001600160a01b03821661337a5760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610929565b6000818152600260205260409020546001600160a01b0316156133df5760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610929565b6133ed600083836001612f59565b6000818152600260205260409020546001600160a01b0316156134525760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610929565b6001600160a01b038216600081815260036020908152604080832080546001019055848352600290915280822080546001600160a01b0319168417905551839291907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b6001600160a01b03811681146121d257600080fd5b600080604083850312156134e557600080fd5b8235915060208301356134f7816134bd565b809150509250929050565b6001600160e01b0319811681146121d257600080fd5b60006020828403121561352a57600080fd5b8135610fc681613502565b60006020828403121561354757600080fd5b5035919050565b60005b83811015613569578181015183820152602001613551565b50506000910152565b6000815180845261358a81602086016020860161354e565b601f01601f19169290920160200192915050565b602081526000610fc66020830184613572565b600080604083850312156135c457600080fd5b82356135cf816134bd565b946020939093013593505050565b600080604083850312156135f057600080fd5b50508035926020909101359150565b60008060006060848603121561361457600080fd5b833561361f816134bd565b9250602084013561362f816134bd565b929592945050506040919091013590565b60008083601f84011261365257600080fd5b5081356001600160401b0381111561366957600080fd5b6020830191508360208260051b850101111561368457600080fd5b9250929050565b6000806020838503121561369e57600080fd5b82356001600160401b038111156136b457600080fd5b6136c085828601613640565b90969095509350505050565b6000602080830181845280855180835260408601915060408160051b87010192508387016000805b8381101561374857888603603f19018552825180518088529088019088880190845b818110156137325783518352928a0192918a0191600101613716565b50909750505093860193918601916001016136f4565b509398975050505050505050565b60008060006040848603121561376b57600080fd5b83356001600160401b0381111561378157600080fd5b61378d86828701613640565b909790965060209590950135949350505050565b6000602082840312156137b357600080fd5b8135610fc6816134bd565b600080600080608085870312156137d457600080fd5b843593506020850135925060408501356137ed816134bd565b9396929550929360600135925050565b602080825282518282018190526000919060409081850190868401855b82811015613849578151805185528681015187860152850151858501526060909301929085019060010161381a565b5091979650505050505050565b60008060006040848603121561386b57600080fd5b83356001600160401b0381111561388157600080fd5b61388d86828701613640565b90945092505060208401356138a1816134bd565b809150509250925092565b600080604083850312156138bf57600080fd5b82356138ca816134bd565b9150602083013580151581146134f757600080fd5b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b038111828210171561391d5761391d6138df565b604052919050565b6000806000806080858703121561393b57600080fd5b8435613946816134bd565b9350602085810135613957816134bd565b93506040860135925060608601356001600160401b038082111561397a57600080fd5b818801915088601f83011261398e57600080fd5b8135818111156139a0576139a06138df565b6139b2601f8201601f191685016138f5565b915080825289848285010111156139c857600080fd5b808484018584013760008482840101525080935050505092959194509250565b600080604083850312156139fb57600080fd5b8235613a06816134bd565b915060208301356134f7816134bd565b600080600060608486031215613a2b57600080fd5b83359250602080850135925060408501356001600160401b0380821115613a5157600080fd5b818701915087601f830112613a6557600080fd5b813581811115613a7757613a776138df565b8060051b9150613a888483016138f5565b818152918301840191848101908a841115613aa257600080fd5b938501935b83851015613acc5784359250613abc836134bd565b8282529385019390850190613aa7565b8096505050505050509250925092565b600181811c90821680613af057607f821691505b602082108103613b1057634e487b7160e01b600052602260045260246000fd5b50919050565b6020808252602d908201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560408201526c1c881bdc88185c1c1c9bdd9959609a1b606082015260800190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b80820281158282048414176109cd576109cd613b79565b602080825260129082015271696e76616c696420706172616d657465727360701b604082015260600190565b808201808211156109cd576109cd613b79565b60208082526011908201527034b73b30b634b21037b832b930ba34b7b760791b604082015260600190565b6060808252810184905260006001600160fb1b03851115613c3057600080fd5b8460051b8087608085013760208301949094525060408101919091520160800192915050565b60008351613c6881846020880161354e565b835190830190613c7c81836020880161354e565b01949350505050565b60208082526025908201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060408201526437bbb732b960d91b606082015260800190565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090613d4f90830184613572565b9695505050505050565b600060208284031215613d6b57600080fd5b8151610fc681613502565b818103818111156109cd576109cd613b7956fea2646970667358221220be917767ef1b31d340fe6087913ba2e72285104d0b6c49192dabe393bb91652864736f6c63430008120033` + _stakingContractByteCode = `60806040523480156200001157600080fd5b5060405180604001604052806009815260200168109d58dad95d13919560ba1b815250604051806040016040528060038152602001621092d560ea1b81525081600090816200006191906200019b565b5060016200007082826200019b565b5050506200008d62000087620000a060201b60201c565b620000a4565b6006805460ff60a01b1916905562000267565b3390565b600680546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b634e487b7160e01b600052604160045260246000fd5b600181811c908216806200012157607f821691505b6020821081036200014257634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200019657600081815260208120601f850160051c81016020861015620001715750805b601f850160051c820191505b8181101562000192578281556001016200017d565b5050505b505050565b81516001600160401b03811115620001b757620001b7620000f6565b620001cf81620001c884546200010c565b8462000148565b602080601f831160018114620002075760008415620001ee5750858301515b600019600386901b1c1916600185901b17855562000192565b600085815260208120601f198616915b82811015620002385788860151825594840194600190910190840162000217565b5085821015620002575787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b613f4980620002776000396000f3fe6080604052600436106102ad5760003560e01c806379afcecb11610175578063b8f4bd7b116100dc578063e0028ecf11610095578063eb0ffb2e1161006f578063eb0ffb2e14610880578063eec7ee73146108a0578063f0b56b5d146108b3578063f2fde38b146108c857600080fd5b8063e0028ecf146107f7578063e449f34114610817578063e985e9c51461083757600080fd5b8063b8f4bd7b1461074e578063bbe33ea51461076e578063c87b56dd14610781578063c8e77923146107a1578063d0949f99146107c1578063d6605fd8146107d757600080fd5b8063960014bd1161012e578063960014bd146106a657806398ca3b76146106c65780639f7d5b00146106e6578063a22cb465146106fb578063b2383e551461071b578063b88d4fde1461072e57600080fd5b806379afcecb146106185780637acb77571461062b5780638456cb591461063e5780638da5cb5b1461065357806393b6ef591461067157806395d89b411461069157600080fd5b806342842e0e116102195780636198e339116101d25780636198e339146105635780636352211e1461058357806370a08231146105a3578063711563d4146105c3578063715018a6146105d657806378bfca10146105eb57600080fd5b806342842e0e14610473578063431cd92a1461049357806343e06c59146104e45780635c975abb146105045780635ceb8b5b146105235780635d36598f1461054357600080fd5b80630f5b2ca51161026b5780630f5b2ca5146103b15780631338736f146103d157806323b872dd146103f15780632e17de78146104115780633f4ba83a146104315780633fd140df1461044657600080fd5b8062f714ce146102b257806301ffc9a7146102d457806303459b161461030957806306fdde0314610337578063081812fc14610359578063095ea7b314610391575b600080fd5b3480156102be57600080fd5b506102d26102cd366004613606565b6108e8565b005b3480156102e057600080fd5b506102f46102ef36600461364c565b6109af565b60405190151581526020015b60405180910390f35b34801561031557600080fd5b50610329610324366004613669565b610a01565b604051908152602001610300565b34801561034357600080fd5b5061034c610a27565b60405161030091906136d2565b34801561036557600080fd5b50610379610374366004613669565b610ab9565b6040516001600160a01b039091168152602001610300565b34801561039d57600080fd5b506102d26103ac3660046136e5565b610ae0565b3480156103bd57600080fd5b506102d26103cc366004613606565b610bf5565b3480156103dd57600080fd5b506102d26103ec366004613711565b610c62565b3480156103fd57600080fd5b506102d261040c366004613733565b610cd5565b34801561041d57600080fd5b506102d261042c366004613669565b610d06565b34801561043d57600080fd5b506102d2610db5565b34801561045257600080fd5b506104666104613660046137bf565b610dc7565b6040516103009190613800565b34801561047f57600080fd5b506102d261048e366004613733565b610f49565b34801561049f57600080fd5b506104b36104ae366004613669565b610f64565b6040805195865260208601949094529284019190915260608301526001600160a01b0316608082015260a001610300565b3480156104f057600080fd5b506102f46104ff366004613711565b610fe0565b34801561051057600080fd5b50600654600160a01b900460ff166102f4565b34801561052f57600080fd5b506102d261053e36600461388a565b610ffb565b34801561054f57600080fd5b506102d261055e3660046137bf565b6110a2565b34801561056f57600080fd5b506102d261057e366004613669565b611138565b34801561058f57600080fd5b5061037961059e366004613669565b61119a565b3480156105af57600080fd5b506103296105be3660046138d5565b6111fa565b6103296105d13660046138f2565b611280565b3480156105e257600080fd5b506102d2611359565b3480156105f757600080fd5b5061060b610606366004613711565b61136b565b6040516103009190613931565b6102d261062636600461398a565b6114a0565b610329610639366004613606565b6115ec565b34801561064a57600080fd5b506102d2611670565b34801561065f57600080fd5b506006546001600160a01b0316610379565b34801561067d57600080fd5b5061032961068c366004613669565b611680565b34801561069d57600080fd5b5061034c6116ab565b3480156106b257600080fd5b506104666106c13660046137bf565b6116ba565b3480156106d257600080fd5b506102d26106e13660046139b6565b611834565b3480156106f257600080fd5b50600b54610329565b34801561070757600080fd5b506102d2610716366004613a0c565b6118ca565b6102d2610729366004613711565b6118d9565b34801561073a57600080fd5b506102d2610749366004613a85565b6119dd565b34801561075a57600080fd5b506102d26107693660046139b6565b611a15565b6102d261077c36600461388a565b611b04565b34801561078d57600080fd5b5061034c61079c366004613669565b611ceb565b3480156107ad57600080fd5b506102d26107bc366004613711565b611d5e565b3480156107cd57600080fd5b5061032960001981565b3480156107e357600080fd5b506102d26107f2366004613711565b611f03565b34801561080357600080fd5b506102d2610812366004613711565b611fe8565b34801561082357600080fd5b506102d26108323660046137bf565b61205c565b34801561084357600080fd5b506102f4610852366004613b48565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205460ff1690565b34801561088c57600080fd5b506102d261089b366004613711565b612138565b6103296108ae366004613b76565b6121ae565b3480156108bf57600080fd5b50610329600a81565b3480156108d457600080fd5b506102d26108e33660046138d5565b6122b3565b6108f061232c565b816108fa81612379565b60008381526008602052604090206002810154610916906123ce565b156109605760405162461bcd60e51b81526020600482015260156024820152746e6f7420726561647920746f20776974686472617760581b60448201526064015b60405180910390fd5b61096984612442565b61097381846124e5565b6040516001600160a01b0384169085907fd964a27d45f595739c13d8b1160b57491050cacf3a2e5602207277d6228f64ee90600090a350505050565b60006001600160e01b031982166380ac58cd60e01b14806109e057506001600160e01b03198216635b5e139f60e01b145b806109fb57506301ffc9a760e01b6001600160e01b03198316145b92915050565b6000610a0c826125a4565b6000828152600860205260409020600201546109fb906123ce565b606060008054610a3690613c3c565b80601f0160208091040260200160405190810160405280929190818152602001828054610a6290613c3c565b8015610aaf5780601f10610a8457610100808354040283529160200191610aaf565b820191906000526020600020905b815481529060010190602001808311610a9257829003601f168201915b5050505050905090565b6000610ac4826125a4565b506000908152600460205260409020546001600160a01b031690565b6000610aeb8261119a565b9050806001600160a01b0316836001600160a01b031603610b585760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b6064820152608401610957565b336001600160a01b0382161480610b745750610b748133610852565b610be65760405162461bcd60e51b815260206004820152603d60248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60448201527f6b656e206f776e6572206f7220617070726f76656420666f7220616c6c0000006064820152608401610957565b610bf08383612603565b505050565b610bfd61232c565b81610c0781612379565b6000838152600860205260409020610c1f9083612671565b6040516001600160a01b038316815283907f6f08c7e76d830d5f3d0a18fd27f4d8c0049b24a8689ddb39625e0864d894a9c19060200160405180910390a2505050565b610c6a61232c565b81610c7481612379565b6000838152600860205260409020610c8b8161276f565b610c9581846127b9565b837f907fece23ce39fbcbceb71e515043fe29408353fbb393b25b35eb8a70a4bad0b84604051610cc791815260200190565b60405180910390a250505050565b610cdf3382612883565b610cfb5760405162461bcd60e51b815260040161095790613c76565b610bf0838383612901565b610d0e61232c565b80610d1881612379565b6000828152600860205260409020610d2f8161276f565b610d3881612a72565b15610d7c5760405162461bcd60e51b81526020600482015260146024820152736e6f7420726561647920746f20756e7374616b6560601b6044820152606401610957565b610d8581612b17565b60405183907f11725367022c3ff288940f4b5473aa61c2da6a24af7363a1128ee2401e8983b290600090a2505050565b610dbd612b4e565b610dc5612ba8565b565b6060816001600160401b03811115610de157610de1613a3f565b604051908082528060200260200182016040528015610e1457816020015b6060815260200190600190039081610dff5790505b5090506000610e22600b5490565b905060005b83811015610f4157816001600160401b03811115610e4757610e47613a3f565b604051908082528060200260200182016040528015610e70578160200160208202803683370190505b50838281518110610e8357610e83613cc3565b60200260200101819052506000600a6000878785818110610ea657610ea6613cc3565b9050602002016020810190610ebb91906138d5565b6001600160a01b03166001600160a01b03168152602001908152602001600020905060005b83811015610f37576000818152602083905260409020548551869085908110610f0b57610f0b613cc3565b60200260200101518281518110610f2457610f24613cc3565b6020908102919091010152600101610ee0565b5050600101610e27565b505092915050565b610bf0838383604051806020016040528060008152506119dd565b6000806000806000610f75866125a4565b60008681526008602052604081208054600b80549293929091908110610f9d57610f9d613cc3565b6000918252602090912060039182020180546001918201549185015460028601549590930154909b919a509198509296506001600160a01b031694509092505050565b6000610ff4610fef8484612bfd565b612c64565b9392505050565b61100361232c565b60008060005b8481101561109a5785858281811061102357611023613cc3565b90506020020135925061103583612379565b6000838152600860205260409020915061104e8261276f565b61105882856127b9565b827f907fece23ce39fbcbceb71e515043fe29408353fbb393b25b35eb8a70a4bad0b8560405161108a91815260200190565b60405180910390a2600101611009565b505050505050565b6110aa61232c565b60008060005b83811015611131578484828181106110ca576110ca613cc3565b9050602002013592506110dc83612379565b600083815260086020526040902091506110f582612c95565b6110fe82612cdf565b60405183907ff27b6ce5b2f5e68ddb2fd95a8a909d4ecf1daaac270935fff052feacb24f184290600090a26001016110b0565b5050505050565b61114061232c565b8061114a81612379565b600082815260086020526040902061116181612c95565b61116a81612cdf565b60405183907ff27b6ce5b2f5e68ddb2fd95a8a909d4ecf1daaac270935fff052feacb24f184290600090a2505050565b6000818152600260205260408120546001600160a01b0316806109fb5760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b6044820152606401610957565b60006001600160a01b0382166112645760405162461bcd60e51b815260206004820152602960248201527f4552433732313a2061646472657373207a65726f206973206e6f7420612076616044820152683634b21037bbb732b960b91b6064820152608401610957565b506001600160a01b031660009081526003602052604090205490565b600061128a61232c565b6000821180156112a25750346112a08387613cef565b145b6112be5760405162461bcd60e51b815260040161095790613d06565b60006112ca8686612bfd565b90506112d581612d33565b600754600101915060005b8381101561134e576112f28286612d7f565b6112fc8184613d32565b604080516001600160a01b0388168152602081018a90529081018890527f17700ceb1658b18206f427c1578048e87504106b14ec69e9b4586d9a95174a329060600160405180910390a26001016112e0565b50505b949350505050565b611361612b4e565b610dc56000612e19565b60606000821180156113885750600b546113858385613d32565b11155b6113a45760405162461bcd60e51b815260040161095790613d06565b816001600160401b038111156113bc576113bc613a3f565b60405190808252806020026020018201604052801561141157816020015b6113fe60405180606001604052806000815260200160008152602001600081525090565b8152602001906001900390816113da5790505b50905060005b8281101561149957600b8185018154811061143457611434613cc3565b9060005260206000209060030201604051806060016040529081600082015481526020016001820154815260200160028201548152505082828151811061147d5761147d613cc3565b60200260200101819052506114928160010190565b9050611417565b5092915050565b6114a861232c565b826114b281612379565b60008481526008602052604090206114c981612c95565b8054600b805460009190839081106114e3576114e3613cc3565b90600052602060002090600302019050806001015485116115165760405162461bcd60e51b815260040161095790613d45565b60003411801561153157508054869061152f9034613d32565b145b61156e5760405162461bcd60e51b815260206004820152600e60248201526d1a5b9d985b1a5908185b5bdd5b9d60921b6044820152606401610957565b60038301546001600160a01b03166000908152600a60209081526040808320858452909152902080546000190190556115a8838787612e6b565b604080518781526020810187905288917f2ab6e87dd81682612cbe0d596465aca761138ab17b7ef0a3f7fb156593ce3f10910160405180910390a250505050505050565b60006115f661232c565b3460006116038286612bfd565b905061160e81612d33565b6116188185612d7f565b600754604080516001600160a01b03871681526020810185905290810187905281907f17700ceb1658b18206f427c1578048e87504106b14ec69e9b4586d9a95174a329060600160405180910390a295945050505050565b611678612b4e565b610dc5612eb7565b600061168b826125a4565b60008281526008602052604090206116a28161276f565b610ff481612a72565b606060018054610a3690613c3c565b6060816001600160401b038111156116d4576116d4613a3f565b60405190808252806020026020018201604052801561170757816020015b60608152602001906001900390816116f25790505b5090506000611715600b5490565b905060005b83811015610f4157816001600160401b0381111561173a5761173a613a3f565b604051908082528060200260200182016040528015611763578160200160208202803683370190505b5083828151811061177657611776613cc3565b602002602001018190525060006009600087878581811061179957611799613cc3565b90506020020160208101906117ae91906138d5565b6001600160a01b03166001600160a01b03168152602001908152602001600020905060005b8381101561182a5760008181526020839052604090205485518690859081106117fe576117fe613cc3565b6020026020010151828151811061181757611817613cc3565b60209081029190910101526001016117d3565b505060010161171a565b61183c61232c565b6000805b838110156111315784848281811061185a5761185a613cc3565b90506020020135915061186c82612379565b60008281526008602052604090206118849084612671565b6040516001600160a01b038416815282907f6f08c7e76d830d5f3d0a18fd27f4d8c0049b24a8689ddb39625e0864d894a9c19060200160405180910390a2600101611840565b6118d5338383612efa565b5050565b6118e161232c565b816118eb81612379565b600083815260086020526040902061190281612c95565b8054600b8054600091908390811061191c5761191c613cc3565b906000526020600020906003020190508481600001543461193d9190613d32565b1461195a5760405162461bcd60e51b815260040161095790613d6f565b60038301546001600160a01b03166000908152600a6020908152604080832085845290915290208054600019019055600181015461199b9084908790612e6b565b857f1d9c4d2b3e13eb9ac08a42625750ac17ec6ca94b4755c49285e9467b4e48c89d866040516119cd91815260200190565b60405180910390a2505050505050565b6119e73383612883565b611a035760405162461bcd60e51b815260040161095790613c76565b611a0f84848484612fc8565b50505050565b611a1d61232c565b60008060005b8481101561109a57858582818110611a3d57611a3d613cc3565b905060200201359250611a4f83612379565b60008381526008602052604090206002810154909250611a6e906123ce565b15611ab35760405162461bcd60e51b81526020600482015260156024820152746e6f7420726561647920746f20776974686472617760581b6044820152606401610957565b611abc83612442565b611ac682856124e5565b6040516001600160a01b0385169084907fd964a27d45f595739c13d8b1160b57491050cacf3a2e5602207277d6228f64ee90600090a3600101611a23565b611b0c61232c565b60018211611b4d5760405162461bcd60e51b815260206004820152600e60248201526d0d2dcecc2d8d2c840d8cadccee8d60931b6044820152606401610957565b3460008080855b8015611ce15760001901878782818110611b7057611b70613cc3565b905060200201359350611b8284612379565b60008481526008602052604090209250611b9b8361276f565b82546003840154600b80546001600160a01b039092169183908110611bc257611bc2613cc3565b906000526020600020906003020193508360010154881015611bf65760405162461bcd60e51b815260040161095790613d45565b8354611c029088613d32565b9650611c148560010154600019141590565b15611c49576001600160a01b038116600090815260096020908152604080832085845290915290208054600019019055611c75565b6001600160a01b0381166000908152600a60209081526040808320858452909152902080546000190190555b8215611c8957611c8486612442565b611cda565b6000196001860155611c9c85888a612e6b565b7fb3f4c8ca702dbbd32d9a25ce17b1942a5060284d9d69fc4fcac8fb0397891b128a8a898b604051611cd19493929190613d9a565b60405180910390a15b5050611b54565b5050505050505050565b6060611cf6826125a4565b6000611d0d60408051602081019091526000815290565b90506000815111611d2d5760405180602001604052806000815250610ff4565b80611d3784612ffb565b604051602001611d48929190613de0565b6040516020818303038152906040529392505050565b611d66612b4e565b81600003611daa5760405162461bcd60e51b8152602060048201526011602482015270185b5bdd5b9d081a5cc81a5b9d985b1a59607a1b6044820152606401610957565b6000828152600c6020908152604080832084845290915290205415611e095760405162461bcd60e51b81526020600482015260156024820152746475706c6963617465206275636b6574207479706560581b6044820152606401610957565b60408051606081018252838152602080820184815243838501908152600b8054600181018255600082815295517f0175b7a638427703f0dbe7bb9bbf987a2551717b34e79f33b5b1008d1fa01db960039092029182015592517f0175b7a638427703f0dbe7bb9bbf987a2551717b34e79f33b5b1008d1fa01dba84015590517f0175b7a638427703f0dbe7bb9bbf987a2551717b34e79f33b5b1008d1fa01dbb9092019190915554858352600c82528383208584528252918390209190915581518481529081018390527f6b39e3267efcd6611c8d7d2534c4715dcb4824322b90d85540a3a82967b6e7b791015b60405180910390a15050565b611f0b61232c565b81611f1581612379565b6000838152600860205260409020611f2c81612c95565b8054600b80546000919083908110611f4657611f46613cc3565b9060005260206000209060030201905080600101548511611f795760405162461bcd60e51b815260040161095790613d6f565b60038301546001600160a01b03166000908152600a60209081526040808320858452909152902080546000190190558054611fb690849087612e6b565b857fc599168ac63ff28ec278088a2c424383a36ca26c931eb41af05e014f19252ea4866040516119cd91815260200190565b611ff0612b4e565b43600b611ffd8484612bfd565b8154811061200d5761200d613cc3565b9060005260206000209060030201600201819055507f6b39e3267efcd6611c8d7d2534c4715dcb4824322b90d85540a3a82967b6e7b78282604051611ef7929190918252602082015260400190565b61206461232c565b60008060005b838110156111315784848281811061208457612084613cc3565b90506020020135925061209683612379565b600083815260086020526040902091506120af8261276f565b6120b882612a72565b156120fc5760405162461bcd60e51b81526020600482015260146024820152736e6f7420726561647920746f20756e7374616b6560601b6044820152606401610957565b61210582612b17565b60405183907f11725367022c3ff288940f4b5473aa61c2da6a24af7363a1128ee2401e8983b290600090a260010161206a565b612140612b4e565b600019600b61214f8484612bfd565b8154811061215f5761215f613cc3565b9060005260206000209060030201600201819055507f099df2bf9247b43481cf1b791a4dd5fa1220c40c62940da539082fbcb30241d68282604051611ef7929190918252602082015260400190565b60006121b861232c565b348251856121c69190613cef565b146121e35760405162461bcd60e51b815260040161095790613d06565b60006121ef8585612bfd565b90506121fa81612d33565b600754600101915060005b83518110156122aa576122318285838151811061222457612224613cc3565b6020026020010151612d7f565b61223b8184613d32565b7f17700ceb1658b18206f427c1578048e87504106b14ec69e9b4586d9a95174a3285838151811061226e5761226e613cc3565b602090810291909101810151604080516001600160a01b0390921682529181018a905290810188905260600160405180910390a2600101612205565b50509392505050565b6122bb612b4e565b6001600160a01b0381166123205760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610957565b61232981612e19565b50565b600654600160a01b900460ff1615610dc55760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606401610957565b6123828161119a565b6001600160a01b0316336001600160a01b0316146123295760405162461bcd60e51b81526020600482015260096024820152683737ba1037bbb732b960b91b6044820152606401610957565b6000600019820361241a5760405162461bcd60e51b81526020600482015260166024820152751b9bdd08185b881d5b9cdd185ad95908189d58dad95d60521b6044820152606401610957565b6000612427600a84613d32565b90504381116124395750600092915050565b43900392915050565b600061244d8261119a565b905061245d81600084600161308d565b6124668261119a565b600083815260046020908152604080832080546001600160a01b03199081169091556001600160a01b0385168085526003845282852080546000190190558785526002909352818420805490911690555192935084927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a45050565b6000600b8360000154815481106124fe576124fe613cc3565b600091825260208220600390910201546040519092506001600160a01b0384169083908381818185875af1925050503d8060008114612559576040519150601f19603f3d011682016040523d82523d6000602084013e61255e565b606091505b5050905080611a0f5760405162461bcd60e51b81526020600482015260126024820152713330b4b632b2103a37903a3930b739b332b960711b6044820152606401610957565b6000818152600260205260409020546001600160a01b03166123295760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b6044820152606401610957565b600081815260046020526040902080546001600160a01b0319166001600160a01b03841690811790915581906126388261119a565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b61267a8261276f565b815460038301546001600160a01b0390811690831681036126ad5760405162461bcd60e51b815260040161095790613d6f565b600184015460001914612703576001600160a01b03818116600090815260096020818152604080842087855282528084208054600019019055938716835290815282822085835290522080546001019055612748565b6001600160a01b038181166000908152600a60208181526040808420878552825280842080546000190190559387168352908152828220858352905220805460010190555b505060039190910180546001600160a01b0319166001600160a01b03909216919091179055565b6002810154600019146123295760405162461bcd60e51b81526020600482015260126024820152713737ba10309039ba30b5b2b2103a37b5b2b760711b6044820152606401610957565b815460038301546001600160a01b03166127d284612a72565b8310156127f15760405162461bcd60e51b815260040161095790613d45565b6000612821600b848154811061280957612809613cc3565b90600052602060002090600302016000015485612bfd565b905061282c81612d33565b60001960018681018290556001600160a01b039390931660008181526009602090815260408083209783529681528682208054909401909355968390558652600a8152838620918652529220805490920190915550565b60008061288f8361119a565b9050806001600160a01b0316846001600160a01b031614806128d657506001600160a01b0380821660009081526005602090815260408083209388168352929052205460ff165b806113515750836001600160a01b03166128ef84610ab9565b6001600160a01b031614949350505050565b826001600160a01b03166129148261119a565b6001600160a01b03161461293a5760405162461bcd60e51b815260040161095790613e0f565b6001600160a01b03821661299c5760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b6064820152608401610957565b6129a9838383600161308d565b826001600160a01b03166129bc8261119a565b6001600160a01b0316146129e25760405162461bcd60e51b815260040161095790613e0f565b600081815260046020908152604080832080546001600160a01b03199081169091556001600160a01b0387811680865260038552838620805460001901905590871680865283862080546001019055868652600290945282852080549092168417909155905184937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b60018101546000906000198103612ac45760405162461bcd60e51b81526020600482015260166024820152751b9bdd08185b881d5b9b1bd8dad95908189d58dad95d60521b6044820152606401610957565b6000600b846000015481548110612add57612add613cc3565b90600052602060002090600302016001015482612afa9190613d32565b9050438111612b0d575060009392505050565b4390039392505050565b43600282015560038101546001600160a01b0316600090815260096020908152604080832093548352929052208054600019019055565b6006546001600160a01b03163314610dc55760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610957565b612bb061315d565b6006805460ff60a01b191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b6000828152600c6020908152604080832084845290915281205480612c5a5760405162461bcd60e51b8152602060048201526013602482015272696e76616c6964206275636b6574207479706560681b6044820152606401610957565b6000198101611351565b600043600b8381548110612c7a57612c7a613cc3565b90600052602060002090600302016002015411159050919050565b6001810154600019146123295760405162461bcd60e51b81526020600482015260126024820152713737ba1030903637b1b5b2b2103a37b5b2b760711b6044820152606401610957565b80546003820154436001938401556001600160a01b03166000818152600a60209081526040808320858452825280832080546000190190559282526009815282822093825292909252902080549091019055565b612d3c81612c64565b6123295760405162461bcd60e51b8152602060048201526014602482015273696e616374697665206275636b6574207479706560601b6044820152606401610957565b6007805460019081018083556040805160808101825286815260001960208083018281528385019283526001600160a01b0389811660608601818152600098895260088552878920965187559251868a0155935160028601559051600390940180546001600160a01b03191694909116939093179092558352600a81528183208784529052902080549091019055546118d59033906131ad565b600680546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6000612e778383612bfd565b9050612e8281612d33565b60038401546001600160a01b03166000908152600a602090815260408083208484529091529020805460010190559092555050565b612ebf61232c565b6006805460ff60a01b1916600160a01b1790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258612be03390565b816001600160a01b0316836001600160a01b031603612f5b5760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c6572000000000000006044820152606401610957565b6001600160a01b03838116600081815260056020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b612fd3848484612901565b612fdf848484846131c7565b611a0f5760405162461bcd60e51b815260040161095790613e54565b60606000613008836132c5565b60010190506000816001600160401b0381111561302757613027613a3f565b6040519080825280601f01601f191660200182016040528015613051576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a850494508461305b57509392505050565b806001146130dd5760405162461bcd60e51b815260206004820152601f60248201527f6261746368207472616e73666572206973206e6f7420737570706f72746564006044820152606401610957565b6001600160a01b03831615806131055750600082815260086020526040902060020154600019145b6131515760405162461bcd60e51b815260206004820152601e60248201527f63616e6e6f74207472616e7366657220756e7374616b656420746f6b656e00006044820152606401610957565b611a0f8484848461339d565b600654600160a01b900460ff16610dc55760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606401610957565b6118d5828260405180602001604052806000815250613425565b60006001600160a01b0384163b156132bd57604051630a85bd0160e11b81526001600160a01b0385169063150b7a029061320b903390899088908890600401613ea6565b6020604051808303816000875af1925050508015613246575060408051601f3d908101601f1916820190925261324391810190613ee3565b60015b6132a3573d808015613274576040519150601f19603f3d011682016040523d82523d6000602084013e613279565b606091505b50805160000361329b5760405162461bcd60e51b815260040161095790613e54565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050611351565b506001611351565b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b83106133045772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef81000000008310613330576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc10000831061334e57662386f26fc10000830492506010015b6305f5e1008310613366576305f5e100830492506008015b612710831061337a57612710830492506004015b6064831061338c576064830492506002015b600a83106109fb5760010192915050565b6001811115611a0f576001600160a01b038416156133e3576001600160a01b038416600090815260036020526040812080548392906133dd908490613f00565b90915550505b6001600160a01b03831615611a0f576001600160a01b0383166000908152600360205260408120805483929061341a908490613d32565b909155505050505050565b61342f8383613458565b61343c60008484846131c7565b610bf05760405162461bcd60e51b815260040161095790613e54565b6001600160a01b0382166134ae5760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610957565b6000818152600260205260409020546001600160a01b0316156135135760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610957565b61352160008383600161308d565b6000818152600260205260409020546001600160a01b0316156135865760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610957565b6001600160a01b038216600081815260036020908152604080832080546001019055848352600290915280822080546001600160a01b0319168417905551839291907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b6001600160a01b038116811461232957600080fd5b6000806040838503121561361957600080fd5b82359150602083013561362b816135f1565b809150509250929050565b6001600160e01b03198116811461232957600080fd5b60006020828403121561365e57600080fd5b8135610ff481613636565b60006020828403121561367b57600080fd5b5035919050565b60005b8381101561369d578181015183820152602001613685565b50506000910152565b600081518084526136be816020860160208601613682565b601f01601f19169290920160200192915050565b602081526000610ff460208301846136a6565b600080604083850312156136f857600080fd5b8235613703816135f1565b946020939093013593505050565b6000806040838503121561372457600080fd5b50508035926020909101359150565b60008060006060848603121561374857600080fd5b8335613753816135f1565b92506020840135613763816135f1565b929592945050506040919091013590565b60008083601f84011261378657600080fd5b5081356001600160401b0381111561379d57600080fd5b6020830191508360208260051b85010111156137b857600080fd5b9250929050565b600080602083850312156137d257600080fd5b82356001600160401b038111156137e857600080fd5b6137f485828601613774565b90969095509350505050565b6000602080830181845280855180835260408601915060408160051b87010192508387016000805b8381101561387c57888603603f19018552825180518088529088019088880190845b818110156138665783518352928a0192918a019160010161384a565b5090975050509386019391860191600101613828565b509398975050505050505050565b60008060006040848603121561389f57600080fd5b83356001600160401b038111156138b557600080fd5b6138c186828701613774565b909790965060209590950135949350505050565b6000602082840312156138e757600080fd5b8135610ff4816135f1565b6000806000806080858703121561390857600080fd5b84359350602085013592506040850135613921816135f1565b9396929550929360600135925050565b602080825282518282018190526000919060409081850190868401855b8281101561397d578151805185528681015187860152850151858501526060909301929085019060010161394e565b5091979650505050505050565b60008060006060848603121561399f57600080fd5b505081359360208301359350604090920135919050565b6000806000604084860312156139cb57600080fd5b83356001600160401b038111156139e157600080fd5b6139ed86828701613774565b9094509250506020840135613a01816135f1565b809150509250925092565b60008060408385031215613a1f57600080fd5b8235613a2a816135f1565b91506020830135801515811461362b57600080fd5b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b0381118282101715613a7d57613a7d613a3f565b604052919050565b60008060008060808587031215613a9b57600080fd5b8435613aa6816135f1565b9350602085810135613ab7816135f1565b93506040860135925060608601356001600160401b0380821115613ada57600080fd5b818801915088601f830112613aee57600080fd5b813581811115613b0057613b00613a3f565b613b12601f8201601f19168501613a55565b91508082528984828501011115613b2857600080fd5b808484018584013760008482840101525080935050505092959194509250565b60008060408385031215613b5b57600080fd5b8235613b66816135f1565b9150602083013561362b816135f1565b600080600060608486031215613b8b57600080fd5b83359250602080850135925060408501356001600160401b0380821115613bb157600080fd5b818701915087601f830112613bc557600080fd5b813581811115613bd757613bd7613a3f565b8060051b9150613be8848301613a55565b818152918301840191848101908a841115613c0257600080fd5b938501935b83851015613c2c5784359250613c1c836135f1565b8282529385019390850190613c07565b8096505050505050509250925092565b600181811c90821680613c5057607f821691505b602082108103613c7057634e487b7160e01b600052602260045260246000fd5b50919050565b6020808252602d908201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560408201526c1c881bdc88185c1c1c9bdd9959609a1b606082015260800190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b80820281158282048414176109fb576109fb613cd9565b602080825260129082015271696e76616c696420706172616d657465727360701b604082015260600190565b808201808211156109fb576109fb613cd9565b60208082526010908201526f34b73b30b634b210323ab930ba34b7b760811b604082015260600190565b60208082526011908201527034b73b30b634b21037b832b930ba34b7b760791b604082015260600190565b6060808252810184905260006001600160fb1b03851115613dba57600080fd5b8460051b8087608085013760208301949094525060408101919091520160800192915050565b60008351613df2818460208801613682565b835190830190613e06818360208801613682565b01949350505050565b60208082526025908201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060408201526437bbb732b960d91b606082015260800190565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090613ed9908301846136a6565b9695505050505050565b600060208284031215613ef557600080fd5b8151610ff481613636565b818103818111156109fb576109fb613cd956fea2646970667358221220f047e82e372fdca1378eb96ca9e2aba1a81cda9ab783cf9beca229c708c9775764736f6c63430008120033` _stakingContractABI = `[ { "inputs": [], @@ -153,6 +153,31 @@ const ( "name": "BucketTypeDeactivated", "type": "event" }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "duration", + "type": "uint256" + } + ], + "name": "BucketTypeExpanded", + "type": "event" + }, { "anonymous": false, "inputs": [ @@ -652,6 +677,29 @@ const ( "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_tokenId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_newAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_newDuration", + "type": "uint256" + } + ], + "name": "expandBucketType", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, { "inputs": [ { @@ -1609,6 +1657,30 @@ func TestContractStaking(t *testing.T) { r.EqualValues(100, bt.StakedAmount.Int64()) }) + t.Run("expand bucket type", func(t *testing.T) { + bt := simpleStake(_delegates[4], big.NewInt(10), big.NewInt(10)) + tokenID := bt.Index + + data, err := lsdABI.Pack("expandBucketType", big.NewInt(int64(tokenID)), big.NewInt(100), big.NewInt(100)) + r.NoError(err) + param = callParam{ + contractAddr: contractAddresses, + bytecode: hex.EncodeToString(data), + amount: big.NewInt(90), + gasLimit: 1000000, + gasPrice: big.NewInt(0), + sk: identityset.PrivateKey(adminID), + } + receipts, _ = writeContract(bc, sf, dao, ap, []*callParam{¶m}, r) + r.Len(receipts, 1) + r.EqualValues("", receipts[0].ExecutionRevertMsg()) + r.EqualValues(iotextypes.ReceiptStatus_Success, receipts[0].Status) + bt, ok := indexer.Bucket(uint64(tokenID)) + r.True(ok) + r.EqualValues(100, bt.StakedAmount.Int64()) + r.EqualValues(100, bt.StakedDurationBlockNumber) + }) + t.Run("change delegate", func(t *testing.T) { delegateIdx := 5 bt := simpleStake(_delegates[delegateIdx], big.NewInt(10), big.NewInt(10)) From b4faf17ad007f3821a7861fed5bb089bfb464d88 Mon Sep 17 00:00:00 2001 From: envestcc Date: Tue, 6 Jun 2023 21:36:41 +0800 Subject: [PATCH 3/7] update event name --- blockindex/contractstaking/event_handler.go | 8 +++---- blockindex/contractstaking/indexer_test.go | 2 +- e2etest/contract_staking_test.go | 24 ++++++++++----------- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/blockindex/contractstaking/event_handler.go b/blockindex/contractstaking/event_handler.go index 83214edfa9..56a0147b2a 100644 --- a/blockindex/contractstaking/event_handler.go +++ b/blockindex/contractstaking/event_handler.go @@ -380,7 +380,7 @@ const ( "type": "uint256" } ], - "name": "BucketTypeExpanded", + "name": "BucketExpanded", "type": "event" } ]` @@ -446,8 +446,8 @@ func (eh *contractStakingEventHandler) HandleEvent(ctx context.Context, blk *blo return eh.handleDurationExtendedEvent(event) case "AmountIncreased": return eh.handleAmountIncreasedEvent(event) - case "BucketTypeExpanded": - return eh.handleBucketTypeExpandedEvent(event) + case "BucketExpanded": + return eh.handleBucketExpandedEvent(event) case "DelegateChanged": return eh.handleDelegateChangedEvent(event) case "Withdrawal": @@ -693,7 +693,7 @@ func (eh *contractStakingEventHandler) handleAmountIncreasedEvent(event eventPar return eh.dirty.updateBucketInfo(tokenIDParam.Uint64(), b) } -func (eh *contractStakingEventHandler) handleBucketTypeExpandedEvent(event eventParam) error { +func (eh *contractStakingEventHandler) handleBucketExpandedEvent(event eventParam) error { tokenIDParam, err := event.IndexedFieldUint256("tokenId") if err != nil { return err diff --git a/blockindex/contractstaking/indexer_test.go b/blockindex/contractstaking/indexer_test.go index 8f25b068b3..e580a4d9d1 100644 --- a/blockindex/contractstaking/indexer_test.go +++ b/blockindex/contractstaking/indexer_test.go @@ -507,7 +507,7 @@ func withdraw(r *require.Assertions, handler *contractStakingEventHandler, token } func expandBucketType(r *require.Assertions, handler *contractStakingEventHandler, token, amount, duration int64) { - err := handler.handleBucketTypeExpandedEvent(eventParam{ + err := handler.handleBucketExpandedEvent(eventParam{ "tokenId": big.NewInt(token), "amount": big.NewInt(amount), "duration": big.NewInt(duration), diff --git a/e2etest/contract_staking_test.go b/e2etest/contract_staking_test.go index f8dfc7b0f6..5a01d43caa 100644 --- a/e2etest/contract_staking_test.go +++ b/e2etest/contract_staking_test.go @@ -39,7 +39,7 @@ import ( const ( // _stakingContractByteCode is the byte code of the contract staking contract for testing, which changes the freeze blocks to 10 - _stakingContractByteCode = `60806040523480156200001157600080fd5b5060405180604001604052806009815260200168109d58dad95d13919560ba1b815250604051806040016040528060038152602001621092d560ea1b81525081600090816200006191906200019b565b5060016200007082826200019b565b5050506200008d62000087620000a060201b60201c565b620000a4565b6006805460ff60a01b1916905562000267565b3390565b600680546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b634e487b7160e01b600052604160045260246000fd5b600181811c908216806200012157607f821691505b6020821081036200014257634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200019657600081815260208120601f850160051c81016020861015620001715750805b601f850160051c820191505b8181101562000192578281556001016200017d565b5050505b505050565b81516001600160401b03811115620001b757620001b7620000f6565b620001cf81620001c884546200010c565b8462000148565b602080601f831160018114620002075760008415620001ee5750858301515b600019600386901b1c1916600185901b17855562000192565b600085815260208120601f198616915b82811015620002385788860151825594840194600190910190840162000217565b5085821015620002575787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b613f4980620002776000396000f3fe6080604052600436106102ad5760003560e01c806379afcecb11610175578063b8f4bd7b116100dc578063e0028ecf11610095578063eb0ffb2e1161006f578063eb0ffb2e14610880578063eec7ee73146108a0578063f0b56b5d146108b3578063f2fde38b146108c857600080fd5b8063e0028ecf146107f7578063e449f34114610817578063e985e9c51461083757600080fd5b8063b8f4bd7b1461074e578063bbe33ea51461076e578063c87b56dd14610781578063c8e77923146107a1578063d0949f99146107c1578063d6605fd8146107d757600080fd5b8063960014bd1161012e578063960014bd146106a657806398ca3b76146106c65780639f7d5b00146106e6578063a22cb465146106fb578063b2383e551461071b578063b88d4fde1461072e57600080fd5b806379afcecb146106185780637acb77571461062b5780638456cb591461063e5780638da5cb5b1461065357806393b6ef591461067157806395d89b411461069157600080fd5b806342842e0e116102195780636198e339116101d25780636198e339146105635780636352211e1461058357806370a08231146105a3578063711563d4146105c3578063715018a6146105d657806378bfca10146105eb57600080fd5b806342842e0e14610473578063431cd92a1461049357806343e06c59146104e45780635c975abb146105045780635ceb8b5b146105235780635d36598f1461054357600080fd5b80630f5b2ca51161026b5780630f5b2ca5146103b15780631338736f146103d157806323b872dd146103f15780632e17de78146104115780633f4ba83a146104315780633fd140df1461044657600080fd5b8062f714ce146102b257806301ffc9a7146102d457806303459b161461030957806306fdde0314610337578063081812fc14610359578063095ea7b314610391575b600080fd5b3480156102be57600080fd5b506102d26102cd366004613606565b6108e8565b005b3480156102e057600080fd5b506102f46102ef36600461364c565b6109af565b60405190151581526020015b60405180910390f35b34801561031557600080fd5b50610329610324366004613669565b610a01565b604051908152602001610300565b34801561034357600080fd5b5061034c610a27565b60405161030091906136d2565b34801561036557600080fd5b50610379610374366004613669565b610ab9565b6040516001600160a01b039091168152602001610300565b34801561039d57600080fd5b506102d26103ac3660046136e5565b610ae0565b3480156103bd57600080fd5b506102d26103cc366004613606565b610bf5565b3480156103dd57600080fd5b506102d26103ec366004613711565b610c62565b3480156103fd57600080fd5b506102d261040c366004613733565b610cd5565b34801561041d57600080fd5b506102d261042c366004613669565b610d06565b34801561043d57600080fd5b506102d2610db5565b34801561045257600080fd5b506104666104613660046137bf565b610dc7565b6040516103009190613800565b34801561047f57600080fd5b506102d261048e366004613733565b610f49565b34801561049f57600080fd5b506104b36104ae366004613669565b610f64565b6040805195865260208601949094529284019190915260608301526001600160a01b0316608082015260a001610300565b3480156104f057600080fd5b506102f46104ff366004613711565b610fe0565b34801561051057600080fd5b50600654600160a01b900460ff166102f4565b34801561052f57600080fd5b506102d261053e36600461388a565b610ffb565b34801561054f57600080fd5b506102d261055e3660046137bf565b6110a2565b34801561056f57600080fd5b506102d261057e366004613669565b611138565b34801561058f57600080fd5b5061037961059e366004613669565b61119a565b3480156105af57600080fd5b506103296105be3660046138d5565b6111fa565b6103296105d13660046138f2565b611280565b3480156105e257600080fd5b506102d2611359565b3480156105f757600080fd5b5061060b610606366004613711565b61136b565b6040516103009190613931565b6102d261062636600461398a565b6114a0565b610329610639366004613606565b6115ec565b34801561064a57600080fd5b506102d2611670565b34801561065f57600080fd5b506006546001600160a01b0316610379565b34801561067d57600080fd5b5061032961068c366004613669565b611680565b34801561069d57600080fd5b5061034c6116ab565b3480156106b257600080fd5b506104666106c13660046137bf565b6116ba565b3480156106d257600080fd5b506102d26106e13660046139b6565b611834565b3480156106f257600080fd5b50600b54610329565b34801561070757600080fd5b506102d2610716366004613a0c565b6118ca565b6102d2610729366004613711565b6118d9565b34801561073a57600080fd5b506102d2610749366004613a85565b6119dd565b34801561075a57600080fd5b506102d26107693660046139b6565b611a15565b6102d261077c36600461388a565b611b04565b34801561078d57600080fd5b5061034c61079c366004613669565b611ceb565b3480156107ad57600080fd5b506102d26107bc366004613711565b611d5e565b3480156107cd57600080fd5b5061032960001981565b3480156107e357600080fd5b506102d26107f2366004613711565b611f03565b34801561080357600080fd5b506102d2610812366004613711565b611fe8565b34801561082357600080fd5b506102d26108323660046137bf565b61205c565b34801561084357600080fd5b506102f4610852366004613b48565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205460ff1690565b34801561088c57600080fd5b506102d261089b366004613711565b612138565b6103296108ae366004613b76565b6121ae565b3480156108bf57600080fd5b50610329600a81565b3480156108d457600080fd5b506102d26108e33660046138d5565b6122b3565b6108f061232c565b816108fa81612379565b60008381526008602052604090206002810154610916906123ce565b156109605760405162461bcd60e51b81526020600482015260156024820152746e6f7420726561647920746f20776974686472617760581b60448201526064015b60405180910390fd5b61096984612442565b61097381846124e5565b6040516001600160a01b0384169085907fd964a27d45f595739c13d8b1160b57491050cacf3a2e5602207277d6228f64ee90600090a350505050565b60006001600160e01b031982166380ac58cd60e01b14806109e057506001600160e01b03198216635b5e139f60e01b145b806109fb57506301ffc9a760e01b6001600160e01b03198316145b92915050565b6000610a0c826125a4565b6000828152600860205260409020600201546109fb906123ce565b606060008054610a3690613c3c565b80601f0160208091040260200160405190810160405280929190818152602001828054610a6290613c3c565b8015610aaf5780601f10610a8457610100808354040283529160200191610aaf565b820191906000526020600020905b815481529060010190602001808311610a9257829003601f168201915b5050505050905090565b6000610ac4826125a4565b506000908152600460205260409020546001600160a01b031690565b6000610aeb8261119a565b9050806001600160a01b0316836001600160a01b031603610b585760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b6064820152608401610957565b336001600160a01b0382161480610b745750610b748133610852565b610be65760405162461bcd60e51b815260206004820152603d60248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60448201527f6b656e206f776e6572206f7220617070726f76656420666f7220616c6c0000006064820152608401610957565b610bf08383612603565b505050565b610bfd61232c565b81610c0781612379565b6000838152600860205260409020610c1f9083612671565b6040516001600160a01b038316815283907f6f08c7e76d830d5f3d0a18fd27f4d8c0049b24a8689ddb39625e0864d894a9c19060200160405180910390a2505050565b610c6a61232c565b81610c7481612379565b6000838152600860205260409020610c8b8161276f565b610c9581846127b9565b837f907fece23ce39fbcbceb71e515043fe29408353fbb393b25b35eb8a70a4bad0b84604051610cc791815260200190565b60405180910390a250505050565b610cdf3382612883565b610cfb5760405162461bcd60e51b815260040161095790613c76565b610bf0838383612901565b610d0e61232c565b80610d1881612379565b6000828152600860205260409020610d2f8161276f565b610d3881612a72565b15610d7c5760405162461bcd60e51b81526020600482015260146024820152736e6f7420726561647920746f20756e7374616b6560601b6044820152606401610957565b610d8581612b17565b60405183907f11725367022c3ff288940f4b5473aa61c2da6a24af7363a1128ee2401e8983b290600090a2505050565b610dbd612b4e565b610dc5612ba8565b565b6060816001600160401b03811115610de157610de1613a3f565b604051908082528060200260200182016040528015610e1457816020015b6060815260200190600190039081610dff5790505b5090506000610e22600b5490565b905060005b83811015610f4157816001600160401b03811115610e4757610e47613a3f565b604051908082528060200260200182016040528015610e70578160200160208202803683370190505b50838281518110610e8357610e83613cc3565b60200260200101819052506000600a6000878785818110610ea657610ea6613cc3565b9050602002016020810190610ebb91906138d5565b6001600160a01b03166001600160a01b03168152602001908152602001600020905060005b83811015610f37576000818152602083905260409020548551869085908110610f0b57610f0b613cc3565b60200260200101518281518110610f2457610f24613cc3565b6020908102919091010152600101610ee0565b5050600101610e27565b505092915050565b610bf0838383604051806020016040528060008152506119dd565b6000806000806000610f75866125a4565b60008681526008602052604081208054600b80549293929091908110610f9d57610f9d613cc3565b6000918252602090912060039182020180546001918201549185015460028601549590930154909b919a509198509296506001600160a01b031694509092505050565b6000610ff4610fef8484612bfd565b612c64565b9392505050565b61100361232c565b60008060005b8481101561109a5785858281811061102357611023613cc3565b90506020020135925061103583612379565b6000838152600860205260409020915061104e8261276f565b61105882856127b9565b827f907fece23ce39fbcbceb71e515043fe29408353fbb393b25b35eb8a70a4bad0b8560405161108a91815260200190565b60405180910390a2600101611009565b505050505050565b6110aa61232c565b60008060005b83811015611131578484828181106110ca576110ca613cc3565b9050602002013592506110dc83612379565b600083815260086020526040902091506110f582612c95565b6110fe82612cdf565b60405183907ff27b6ce5b2f5e68ddb2fd95a8a909d4ecf1daaac270935fff052feacb24f184290600090a26001016110b0565b5050505050565b61114061232c565b8061114a81612379565b600082815260086020526040902061116181612c95565b61116a81612cdf565b60405183907ff27b6ce5b2f5e68ddb2fd95a8a909d4ecf1daaac270935fff052feacb24f184290600090a2505050565b6000818152600260205260408120546001600160a01b0316806109fb5760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b6044820152606401610957565b60006001600160a01b0382166112645760405162461bcd60e51b815260206004820152602960248201527f4552433732313a2061646472657373207a65726f206973206e6f7420612076616044820152683634b21037bbb732b960b91b6064820152608401610957565b506001600160a01b031660009081526003602052604090205490565b600061128a61232c565b6000821180156112a25750346112a08387613cef565b145b6112be5760405162461bcd60e51b815260040161095790613d06565b60006112ca8686612bfd565b90506112d581612d33565b600754600101915060005b8381101561134e576112f28286612d7f565b6112fc8184613d32565b604080516001600160a01b0388168152602081018a90529081018890527f17700ceb1658b18206f427c1578048e87504106b14ec69e9b4586d9a95174a329060600160405180910390a26001016112e0565b50505b949350505050565b611361612b4e565b610dc56000612e19565b60606000821180156113885750600b546113858385613d32565b11155b6113a45760405162461bcd60e51b815260040161095790613d06565b816001600160401b038111156113bc576113bc613a3f565b60405190808252806020026020018201604052801561141157816020015b6113fe60405180606001604052806000815260200160008152602001600081525090565b8152602001906001900390816113da5790505b50905060005b8281101561149957600b8185018154811061143457611434613cc3565b9060005260206000209060030201604051806060016040529081600082015481526020016001820154815260200160028201548152505082828151811061147d5761147d613cc3565b60200260200101819052506114928160010190565b9050611417565b5092915050565b6114a861232c565b826114b281612379565b60008481526008602052604090206114c981612c95565b8054600b805460009190839081106114e3576114e3613cc3565b90600052602060002090600302019050806001015485116115165760405162461bcd60e51b815260040161095790613d45565b60003411801561153157508054869061152f9034613d32565b145b61156e5760405162461bcd60e51b815260206004820152600e60248201526d1a5b9d985b1a5908185b5bdd5b9d60921b6044820152606401610957565b60038301546001600160a01b03166000908152600a60209081526040808320858452909152902080546000190190556115a8838787612e6b565b604080518781526020810187905288917f2ab6e87dd81682612cbe0d596465aca761138ab17b7ef0a3f7fb156593ce3f10910160405180910390a250505050505050565b60006115f661232c565b3460006116038286612bfd565b905061160e81612d33565b6116188185612d7f565b600754604080516001600160a01b03871681526020810185905290810187905281907f17700ceb1658b18206f427c1578048e87504106b14ec69e9b4586d9a95174a329060600160405180910390a295945050505050565b611678612b4e565b610dc5612eb7565b600061168b826125a4565b60008281526008602052604090206116a28161276f565b610ff481612a72565b606060018054610a3690613c3c565b6060816001600160401b038111156116d4576116d4613a3f565b60405190808252806020026020018201604052801561170757816020015b60608152602001906001900390816116f25790505b5090506000611715600b5490565b905060005b83811015610f4157816001600160401b0381111561173a5761173a613a3f565b604051908082528060200260200182016040528015611763578160200160208202803683370190505b5083828151811061177657611776613cc3565b602002602001018190525060006009600087878581811061179957611799613cc3565b90506020020160208101906117ae91906138d5565b6001600160a01b03166001600160a01b03168152602001908152602001600020905060005b8381101561182a5760008181526020839052604090205485518690859081106117fe576117fe613cc3565b6020026020010151828151811061181757611817613cc3565b60209081029190910101526001016117d3565b505060010161171a565b61183c61232c565b6000805b838110156111315784848281811061185a5761185a613cc3565b90506020020135915061186c82612379565b60008281526008602052604090206118849084612671565b6040516001600160a01b038416815282907f6f08c7e76d830d5f3d0a18fd27f4d8c0049b24a8689ddb39625e0864d894a9c19060200160405180910390a2600101611840565b6118d5338383612efa565b5050565b6118e161232c565b816118eb81612379565b600083815260086020526040902061190281612c95565b8054600b8054600091908390811061191c5761191c613cc3565b906000526020600020906003020190508481600001543461193d9190613d32565b1461195a5760405162461bcd60e51b815260040161095790613d6f565b60038301546001600160a01b03166000908152600a6020908152604080832085845290915290208054600019019055600181015461199b9084908790612e6b565b857f1d9c4d2b3e13eb9ac08a42625750ac17ec6ca94b4755c49285e9467b4e48c89d866040516119cd91815260200190565b60405180910390a2505050505050565b6119e73383612883565b611a035760405162461bcd60e51b815260040161095790613c76565b611a0f84848484612fc8565b50505050565b611a1d61232c565b60008060005b8481101561109a57858582818110611a3d57611a3d613cc3565b905060200201359250611a4f83612379565b60008381526008602052604090206002810154909250611a6e906123ce565b15611ab35760405162461bcd60e51b81526020600482015260156024820152746e6f7420726561647920746f20776974686472617760581b6044820152606401610957565b611abc83612442565b611ac682856124e5565b6040516001600160a01b0385169084907fd964a27d45f595739c13d8b1160b57491050cacf3a2e5602207277d6228f64ee90600090a3600101611a23565b611b0c61232c565b60018211611b4d5760405162461bcd60e51b815260206004820152600e60248201526d0d2dcecc2d8d2c840d8cadccee8d60931b6044820152606401610957565b3460008080855b8015611ce15760001901878782818110611b7057611b70613cc3565b905060200201359350611b8284612379565b60008481526008602052604090209250611b9b8361276f565b82546003840154600b80546001600160a01b039092169183908110611bc257611bc2613cc3565b906000526020600020906003020193508360010154881015611bf65760405162461bcd60e51b815260040161095790613d45565b8354611c029088613d32565b9650611c148560010154600019141590565b15611c49576001600160a01b038116600090815260096020908152604080832085845290915290208054600019019055611c75565b6001600160a01b0381166000908152600a60209081526040808320858452909152902080546000190190555b8215611c8957611c8486612442565b611cda565b6000196001860155611c9c85888a612e6b565b7fb3f4c8ca702dbbd32d9a25ce17b1942a5060284d9d69fc4fcac8fb0397891b128a8a898b604051611cd19493929190613d9a565b60405180910390a15b5050611b54565b5050505050505050565b6060611cf6826125a4565b6000611d0d60408051602081019091526000815290565b90506000815111611d2d5760405180602001604052806000815250610ff4565b80611d3784612ffb565b604051602001611d48929190613de0565b6040516020818303038152906040529392505050565b611d66612b4e565b81600003611daa5760405162461bcd60e51b8152602060048201526011602482015270185b5bdd5b9d081a5cc81a5b9d985b1a59607a1b6044820152606401610957565b6000828152600c6020908152604080832084845290915290205415611e095760405162461bcd60e51b81526020600482015260156024820152746475706c6963617465206275636b6574207479706560581b6044820152606401610957565b60408051606081018252838152602080820184815243838501908152600b8054600181018255600082815295517f0175b7a638427703f0dbe7bb9bbf987a2551717b34e79f33b5b1008d1fa01db960039092029182015592517f0175b7a638427703f0dbe7bb9bbf987a2551717b34e79f33b5b1008d1fa01dba84015590517f0175b7a638427703f0dbe7bb9bbf987a2551717b34e79f33b5b1008d1fa01dbb9092019190915554858352600c82528383208584528252918390209190915581518481529081018390527f6b39e3267efcd6611c8d7d2534c4715dcb4824322b90d85540a3a82967b6e7b791015b60405180910390a15050565b611f0b61232c565b81611f1581612379565b6000838152600860205260409020611f2c81612c95565b8054600b80546000919083908110611f4657611f46613cc3565b9060005260206000209060030201905080600101548511611f795760405162461bcd60e51b815260040161095790613d6f565b60038301546001600160a01b03166000908152600a60209081526040808320858452909152902080546000190190558054611fb690849087612e6b565b857fc599168ac63ff28ec278088a2c424383a36ca26c931eb41af05e014f19252ea4866040516119cd91815260200190565b611ff0612b4e565b43600b611ffd8484612bfd565b8154811061200d5761200d613cc3565b9060005260206000209060030201600201819055507f6b39e3267efcd6611c8d7d2534c4715dcb4824322b90d85540a3a82967b6e7b78282604051611ef7929190918252602082015260400190565b61206461232c565b60008060005b838110156111315784848281811061208457612084613cc3565b90506020020135925061209683612379565b600083815260086020526040902091506120af8261276f565b6120b882612a72565b156120fc5760405162461bcd60e51b81526020600482015260146024820152736e6f7420726561647920746f20756e7374616b6560601b6044820152606401610957565b61210582612b17565b60405183907f11725367022c3ff288940f4b5473aa61c2da6a24af7363a1128ee2401e8983b290600090a260010161206a565b612140612b4e565b600019600b61214f8484612bfd565b8154811061215f5761215f613cc3565b9060005260206000209060030201600201819055507f099df2bf9247b43481cf1b791a4dd5fa1220c40c62940da539082fbcb30241d68282604051611ef7929190918252602082015260400190565b60006121b861232c565b348251856121c69190613cef565b146121e35760405162461bcd60e51b815260040161095790613d06565b60006121ef8585612bfd565b90506121fa81612d33565b600754600101915060005b83518110156122aa576122318285838151811061222457612224613cc3565b6020026020010151612d7f565b61223b8184613d32565b7f17700ceb1658b18206f427c1578048e87504106b14ec69e9b4586d9a95174a3285838151811061226e5761226e613cc3565b602090810291909101810151604080516001600160a01b0390921682529181018a905290810188905260600160405180910390a2600101612205565b50509392505050565b6122bb612b4e565b6001600160a01b0381166123205760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610957565b61232981612e19565b50565b600654600160a01b900460ff1615610dc55760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606401610957565b6123828161119a565b6001600160a01b0316336001600160a01b0316146123295760405162461bcd60e51b81526020600482015260096024820152683737ba1037bbb732b960b91b6044820152606401610957565b6000600019820361241a5760405162461bcd60e51b81526020600482015260166024820152751b9bdd08185b881d5b9cdd185ad95908189d58dad95d60521b6044820152606401610957565b6000612427600a84613d32565b90504381116124395750600092915050565b43900392915050565b600061244d8261119a565b905061245d81600084600161308d565b6124668261119a565b600083815260046020908152604080832080546001600160a01b03199081169091556001600160a01b0385168085526003845282852080546000190190558785526002909352818420805490911690555192935084927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a45050565b6000600b8360000154815481106124fe576124fe613cc3565b600091825260208220600390910201546040519092506001600160a01b0384169083908381818185875af1925050503d8060008114612559576040519150601f19603f3d011682016040523d82523d6000602084013e61255e565b606091505b5050905080611a0f5760405162461bcd60e51b81526020600482015260126024820152713330b4b632b2103a37903a3930b739b332b960711b6044820152606401610957565b6000818152600260205260409020546001600160a01b03166123295760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b6044820152606401610957565b600081815260046020526040902080546001600160a01b0319166001600160a01b03841690811790915581906126388261119a565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b61267a8261276f565b815460038301546001600160a01b0390811690831681036126ad5760405162461bcd60e51b815260040161095790613d6f565b600184015460001914612703576001600160a01b03818116600090815260096020818152604080842087855282528084208054600019019055938716835290815282822085835290522080546001019055612748565b6001600160a01b038181166000908152600a60208181526040808420878552825280842080546000190190559387168352908152828220858352905220805460010190555b505060039190910180546001600160a01b0319166001600160a01b03909216919091179055565b6002810154600019146123295760405162461bcd60e51b81526020600482015260126024820152713737ba10309039ba30b5b2b2103a37b5b2b760711b6044820152606401610957565b815460038301546001600160a01b03166127d284612a72565b8310156127f15760405162461bcd60e51b815260040161095790613d45565b6000612821600b848154811061280957612809613cc3565b90600052602060002090600302016000015485612bfd565b905061282c81612d33565b60001960018681018290556001600160a01b039390931660008181526009602090815260408083209783529681528682208054909401909355968390558652600a8152838620918652529220805490920190915550565b60008061288f8361119a565b9050806001600160a01b0316846001600160a01b031614806128d657506001600160a01b0380821660009081526005602090815260408083209388168352929052205460ff165b806113515750836001600160a01b03166128ef84610ab9565b6001600160a01b031614949350505050565b826001600160a01b03166129148261119a565b6001600160a01b03161461293a5760405162461bcd60e51b815260040161095790613e0f565b6001600160a01b03821661299c5760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b6064820152608401610957565b6129a9838383600161308d565b826001600160a01b03166129bc8261119a565b6001600160a01b0316146129e25760405162461bcd60e51b815260040161095790613e0f565b600081815260046020908152604080832080546001600160a01b03199081169091556001600160a01b0387811680865260038552838620805460001901905590871680865283862080546001019055868652600290945282852080549092168417909155905184937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b60018101546000906000198103612ac45760405162461bcd60e51b81526020600482015260166024820152751b9bdd08185b881d5b9b1bd8dad95908189d58dad95d60521b6044820152606401610957565b6000600b846000015481548110612add57612add613cc3565b90600052602060002090600302016001015482612afa9190613d32565b9050438111612b0d575060009392505050565b4390039392505050565b43600282015560038101546001600160a01b0316600090815260096020908152604080832093548352929052208054600019019055565b6006546001600160a01b03163314610dc55760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610957565b612bb061315d565b6006805460ff60a01b191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b6000828152600c6020908152604080832084845290915281205480612c5a5760405162461bcd60e51b8152602060048201526013602482015272696e76616c6964206275636b6574207479706560681b6044820152606401610957565b6000198101611351565b600043600b8381548110612c7a57612c7a613cc3565b90600052602060002090600302016002015411159050919050565b6001810154600019146123295760405162461bcd60e51b81526020600482015260126024820152713737ba1030903637b1b5b2b2103a37b5b2b760711b6044820152606401610957565b80546003820154436001938401556001600160a01b03166000818152600a60209081526040808320858452825280832080546000190190559282526009815282822093825292909252902080549091019055565b612d3c81612c64565b6123295760405162461bcd60e51b8152602060048201526014602482015273696e616374697665206275636b6574207479706560601b6044820152606401610957565b6007805460019081018083556040805160808101825286815260001960208083018281528385019283526001600160a01b0389811660608601818152600098895260088552878920965187559251868a0155935160028601559051600390940180546001600160a01b03191694909116939093179092558352600a81528183208784529052902080549091019055546118d59033906131ad565b600680546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6000612e778383612bfd565b9050612e8281612d33565b60038401546001600160a01b03166000908152600a602090815260408083208484529091529020805460010190559092555050565b612ebf61232c565b6006805460ff60a01b1916600160a01b1790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258612be03390565b816001600160a01b0316836001600160a01b031603612f5b5760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c6572000000000000006044820152606401610957565b6001600160a01b03838116600081815260056020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b612fd3848484612901565b612fdf848484846131c7565b611a0f5760405162461bcd60e51b815260040161095790613e54565b60606000613008836132c5565b60010190506000816001600160401b0381111561302757613027613a3f565b6040519080825280601f01601f191660200182016040528015613051576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a850494508461305b57509392505050565b806001146130dd5760405162461bcd60e51b815260206004820152601f60248201527f6261746368207472616e73666572206973206e6f7420737570706f72746564006044820152606401610957565b6001600160a01b03831615806131055750600082815260086020526040902060020154600019145b6131515760405162461bcd60e51b815260206004820152601e60248201527f63616e6e6f74207472616e7366657220756e7374616b656420746f6b656e00006044820152606401610957565b611a0f8484848461339d565b600654600160a01b900460ff16610dc55760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606401610957565b6118d5828260405180602001604052806000815250613425565b60006001600160a01b0384163b156132bd57604051630a85bd0160e11b81526001600160a01b0385169063150b7a029061320b903390899088908890600401613ea6565b6020604051808303816000875af1925050508015613246575060408051601f3d908101601f1916820190925261324391810190613ee3565b60015b6132a3573d808015613274576040519150601f19603f3d011682016040523d82523d6000602084013e613279565b606091505b50805160000361329b5760405162461bcd60e51b815260040161095790613e54565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050611351565b506001611351565b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b83106133045772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef81000000008310613330576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc10000831061334e57662386f26fc10000830492506010015b6305f5e1008310613366576305f5e100830492506008015b612710831061337a57612710830492506004015b6064831061338c576064830492506002015b600a83106109fb5760010192915050565b6001811115611a0f576001600160a01b038416156133e3576001600160a01b038416600090815260036020526040812080548392906133dd908490613f00565b90915550505b6001600160a01b03831615611a0f576001600160a01b0383166000908152600360205260408120805483929061341a908490613d32565b909155505050505050565b61342f8383613458565b61343c60008484846131c7565b610bf05760405162461bcd60e51b815260040161095790613e54565b6001600160a01b0382166134ae5760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610957565b6000818152600260205260409020546001600160a01b0316156135135760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610957565b61352160008383600161308d565b6000818152600260205260409020546001600160a01b0316156135865760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610957565b6001600160a01b038216600081815260036020908152604080832080546001019055848352600290915280822080546001600160a01b0319168417905551839291907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b6001600160a01b038116811461232957600080fd5b6000806040838503121561361957600080fd5b82359150602083013561362b816135f1565b809150509250929050565b6001600160e01b03198116811461232957600080fd5b60006020828403121561365e57600080fd5b8135610ff481613636565b60006020828403121561367b57600080fd5b5035919050565b60005b8381101561369d578181015183820152602001613685565b50506000910152565b600081518084526136be816020860160208601613682565b601f01601f19169290920160200192915050565b602081526000610ff460208301846136a6565b600080604083850312156136f857600080fd5b8235613703816135f1565b946020939093013593505050565b6000806040838503121561372457600080fd5b50508035926020909101359150565b60008060006060848603121561374857600080fd5b8335613753816135f1565b92506020840135613763816135f1565b929592945050506040919091013590565b60008083601f84011261378657600080fd5b5081356001600160401b0381111561379d57600080fd5b6020830191508360208260051b85010111156137b857600080fd5b9250929050565b600080602083850312156137d257600080fd5b82356001600160401b038111156137e857600080fd5b6137f485828601613774565b90969095509350505050565b6000602080830181845280855180835260408601915060408160051b87010192508387016000805b8381101561387c57888603603f19018552825180518088529088019088880190845b818110156138665783518352928a0192918a019160010161384a565b5090975050509386019391860191600101613828565b509398975050505050505050565b60008060006040848603121561389f57600080fd5b83356001600160401b038111156138b557600080fd5b6138c186828701613774565b909790965060209590950135949350505050565b6000602082840312156138e757600080fd5b8135610ff4816135f1565b6000806000806080858703121561390857600080fd5b84359350602085013592506040850135613921816135f1565b9396929550929360600135925050565b602080825282518282018190526000919060409081850190868401855b8281101561397d578151805185528681015187860152850151858501526060909301929085019060010161394e565b5091979650505050505050565b60008060006060848603121561399f57600080fd5b505081359360208301359350604090920135919050565b6000806000604084860312156139cb57600080fd5b83356001600160401b038111156139e157600080fd5b6139ed86828701613774565b9094509250506020840135613a01816135f1565b809150509250925092565b60008060408385031215613a1f57600080fd5b8235613a2a816135f1565b91506020830135801515811461362b57600080fd5b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b0381118282101715613a7d57613a7d613a3f565b604052919050565b60008060008060808587031215613a9b57600080fd5b8435613aa6816135f1565b9350602085810135613ab7816135f1565b93506040860135925060608601356001600160401b0380821115613ada57600080fd5b818801915088601f830112613aee57600080fd5b813581811115613b0057613b00613a3f565b613b12601f8201601f19168501613a55565b91508082528984828501011115613b2857600080fd5b808484018584013760008482840101525080935050505092959194509250565b60008060408385031215613b5b57600080fd5b8235613b66816135f1565b9150602083013561362b816135f1565b600080600060608486031215613b8b57600080fd5b83359250602080850135925060408501356001600160401b0380821115613bb157600080fd5b818701915087601f830112613bc557600080fd5b813581811115613bd757613bd7613a3f565b8060051b9150613be8848301613a55565b818152918301840191848101908a841115613c0257600080fd5b938501935b83851015613c2c5784359250613c1c836135f1565b8282529385019390850190613c07565b8096505050505050509250925092565b600181811c90821680613c5057607f821691505b602082108103613c7057634e487b7160e01b600052602260045260246000fd5b50919050565b6020808252602d908201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560408201526c1c881bdc88185c1c1c9bdd9959609a1b606082015260800190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b80820281158282048414176109fb576109fb613cd9565b602080825260129082015271696e76616c696420706172616d657465727360701b604082015260600190565b808201808211156109fb576109fb613cd9565b60208082526010908201526f34b73b30b634b210323ab930ba34b7b760811b604082015260600190565b60208082526011908201527034b73b30b634b21037b832b930ba34b7b760791b604082015260600190565b6060808252810184905260006001600160fb1b03851115613dba57600080fd5b8460051b8087608085013760208301949094525060408101919091520160800192915050565b60008351613df2818460208801613682565b835190830190613e06818360208801613682565b01949350505050565b60208082526025908201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060408201526437bbb732b960d91b606082015260800190565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090613ed9908301846136a6565b9695505050505050565b600060208284031215613ef557600080fd5b8151610ff481613636565b818103818111156109fb576109fb613cd956fea2646970667358221220f047e82e372fdca1378eb96ca9e2aba1a81cda9ab783cf9beca229c708c9775764736f6c63430008120033` + _stakingContractByteCode = `60806040523480156200001157600080fd5b5060405180604001604052806009815260200168109d58dad95d13919560ba1b815250604051806040016040528060038152602001621092d560ea1b81525081600090816200006191906200019b565b5060016200007082826200019b565b5050506200008d62000087620000a060201b60201c565b620000a4565b6006805460ff60a01b1916905562000267565b3390565b600680546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b634e487b7160e01b600052604160045260246000fd5b600181811c908216806200012157607f821691505b6020821081036200014257634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200019657600081815260208120601f850160051c81016020861015620001715750805b601f850160051c820191505b8181101562000192578281556001016200017d565b5050505b505050565b81516001600160401b03811115620001b757620001b7620000f6565b620001cf81620001c884546200010c565b8462000148565b602080601f831160018114620002075760008415620001ee5750858301515b600019600386901b1c1916600185901b17855562000192565b600085815260208120601f198616915b82811015620002385788860151825594840194600190910190840162000217565b5085821015620002575787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b613f4980620002776000396000f3fe6080604052600436106102ad5760003560e01c806378bfca1011610175578063b8f4bd7b116100dc578063e0028ecf11610095578063eb0ffb2e1161006f578063eb0ffb2e14610880578063eec7ee73146108a0578063f0b56b5d146108b3578063f2fde38b146108c857600080fd5b8063e0028ecf146107f7578063e449f34114610817578063e985e9c51461083757600080fd5b8063b8f4bd7b1461074e578063bbe33ea51461076e578063c87b56dd14610781578063c8e77923146107a1578063d0949f99146107c1578063d6605fd8146107d757600080fd5b8063960014bd1161012e578063960014bd146106a657806398ca3b76146106c65780639f7d5b00146106e6578063a22cb465146106fb578063b2383e551461071b578063b88d4fde1461072e57600080fd5b806378bfca10146105fe5780637acb77571461062b5780638456cb591461063e5780638da5cb5b1461065357806393b6ef591461067157806395d89b411461069157600080fd5b80633fd140df116102195780635d36598f116101d25780635d36598f146105565780636198e339146105765780636352211e1461059657806370a08231146105b6578063711563d4146105d6578063715018a6146105e957600080fd5b80633fd140df1461045957806342842e0e14610486578063431cd92a146104a657806343e06c59146104f75780635c975abb146105175780635ceb8b5b1461053657600080fd5b8063095ea7b31161026b578063095ea7b3146103a45780630f5b2ca5146103c45780631338736f146103e457806323b872dd146104045780632e17de78146104245780633f4ba83a1461044457600080fd5b8062f714ce146102b257806301ffc9a7146102d4578063025008ed1461030957806303459b161461031c57806306fdde031461034a578063081812fc1461036c575b600080fd5b3480156102be57600080fd5b506102d26102cd366004613606565b6108e8565b005b3480156102e057600080fd5b506102f46102ef36600461364c565b6109af565b60405190151581526020015b60405180910390f35b6102d2610317366004613669565b610a01565b34801561032857600080fd5b5061033c610337366004613695565b610b4d565b604051908152602001610300565b34801561035657600080fd5b5061035f610b73565b60405161030091906136fe565b34801561037857600080fd5b5061038c610387366004613695565b610c05565b6040516001600160a01b039091168152602001610300565b3480156103b057600080fd5b506102d26103bf366004613711565b610c2c565b3480156103d057600080fd5b506102d26103df366004613606565b610d41565b3480156103f057600080fd5b506102d26103ff36600461373d565b610dae565b34801561041057600080fd5b506102d261041f36600461375f565b610e21565b34801561043057600080fd5b506102d261043f366004613695565b610e52565b34801561045057600080fd5b506102d2610f01565b34801561046557600080fd5b506104796104743660046137eb565b610f13565b604051610300919061382c565b34801561049257600080fd5b506102d26104a136600461375f565b611095565b3480156104b257600080fd5b506104c66104c1366004613695565b6110b0565b6040805195865260208601949094529284019190915260608301526001600160a01b0316608082015260a001610300565b34801561050357600080fd5b506102f461051236600461373d565b61112c565b34801561052357600080fd5b50600654600160a01b900460ff166102f4565b34801561054257600080fd5b506102d26105513660046138b6565b611147565b34801561056257600080fd5b506102d26105713660046137eb565b6111ee565b34801561058257600080fd5b506102d2610591366004613695565b611284565b3480156105a257600080fd5b5061038c6105b1366004613695565b6112e6565b3480156105c257600080fd5b5061033c6105d1366004613901565b611346565b61033c6105e436600461391e565b6113cc565b3480156105f557600080fd5b506102d26114a5565b34801561060a57600080fd5b5061061e61061936600461373d565b6114b7565b604051610300919061395d565b61033c610639366004613606565b6115ec565b34801561064a57600080fd5b506102d2611670565b34801561065f57600080fd5b506006546001600160a01b031661038c565b34801561067d57600080fd5b5061033c61068c366004613695565b611680565b34801561069d57600080fd5b5061035f6116ab565b3480156106b257600080fd5b506104796106c13660046137eb565b6116ba565b3480156106d257600080fd5b506102d26106e13660046139b6565b611834565b3480156106f257600080fd5b50600b5461033c565b34801561070757600080fd5b506102d2610716366004613a0c565b6118ca565b6102d261072936600461373d565b6118d9565b34801561073a57600080fd5b506102d2610749366004613a85565b6119dd565b34801561075a57600080fd5b506102d26107693660046139b6565b611a15565b6102d261077c3660046138b6565b611b04565b34801561078d57600080fd5b5061035f61079c366004613695565b611ceb565b3480156107ad57600080fd5b506102d26107bc36600461373d565b611d5e565b3480156107cd57600080fd5b5061033c60001981565b3480156107e357600080fd5b506102d26107f236600461373d565b611f03565b34801561080357600080fd5b506102d261081236600461373d565b611fe8565b34801561082357600080fd5b506102d26108323660046137eb565b61205c565b34801561084357600080fd5b506102f4610852366004613b48565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205460ff1690565b34801561088c57600080fd5b506102d261089b36600461373d565b612138565b61033c6108ae366004613b76565b6121ae565b3480156108bf57600080fd5b5061033c600a81565b3480156108d457600080fd5b506102d26108e3366004613901565b6122b3565b6108f061232c565b816108fa81612379565b60008381526008602052604090206002810154610916906123ce565b156109605760405162461bcd60e51b81526020600482015260156024820152746e6f7420726561647920746f20776974686472617760581b60448201526064015b60405180910390fd5b61096984612442565b61097381846124e5565b6040516001600160a01b0384169085907fd964a27d45f595739c13d8b1160b57491050cacf3a2e5602207277d6228f64ee90600090a350505050565b60006001600160e01b031982166380ac58cd60e01b14806109e057506001600160e01b03198216635b5e139f60e01b145b806109fb57506301ffc9a760e01b6001600160e01b03198316145b92915050565b610a0961232c565b82610a1381612379565b6000848152600860205260409020610a2a816125a4565b8054600b80546000919083908110610a4457610a44613c3c565b9060005260206000209060030201905080600101548511610a775760405162461bcd60e51b815260040161095790613c52565b600034118015610a92575080548690610a909034613c92565b145b610acf5760405162461bcd60e51b815260206004820152600e60248201526d1a5b9d985b1a5908185b5bdd5b9d60921b6044820152606401610957565b60038301546001600160a01b03166000908152600a6020908152604080832085845290915290208054600019019055610b098387876125ee565b604080518781526020810187905288917fd29e04160a74f0dbab5e7b82ef0392d86d11ac2939e5883eb3353be4cfedb83e910160405180910390a250505050505050565b6000610b588261263a565b6000828152600860205260409020600201546109fb906123ce565b606060008054610b8290613ca5565b80601f0160208091040260200160405190810160405280929190818152602001828054610bae90613ca5565b8015610bfb5780601f10610bd057610100808354040283529160200191610bfb565b820191906000526020600020905b815481529060010190602001808311610bde57829003601f168201915b5050505050905090565b6000610c108261263a565b506000908152600460205260409020546001600160a01b031690565b6000610c37826112e6565b9050806001600160a01b0316836001600160a01b031603610ca45760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b6064820152608401610957565b336001600160a01b0382161480610cc05750610cc08133610852565b610d325760405162461bcd60e51b815260206004820152603d60248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60448201527f6b656e206f776e6572206f7220617070726f76656420666f7220616c6c0000006064820152608401610957565b610d3c8383612699565b505050565b610d4961232c565b81610d5381612379565b6000838152600860205260409020610d6b9083612707565b6040516001600160a01b038316815283907f6f08c7e76d830d5f3d0a18fd27f4d8c0049b24a8689ddb39625e0864d894a9c19060200160405180910390a2505050565b610db661232c565b81610dc081612379565b6000838152600860205260409020610dd781612805565b610de1818461284f565b837f907fece23ce39fbcbceb71e515043fe29408353fbb393b25b35eb8a70a4bad0b84604051610e1391815260200190565b60405180910390a250505050565b610e2b3382612919565b610e475760405162461bcd60e51b815260040161095790613cdf565b610d3c838383612997565b610e5a61232c565b80610e6481612379565b6000828152600860205260409020610e7b81612805565b610e8481612b08565b15610ec85760405162461bcd60e51b81526020600482015260146024820152736e6f7420726561647920746f20756e7374616b6560601b6044820152606401610957565b610ed181612bad565b60405183907f11725367022c3ff288940f4b5473aa61c2da6a24af7363a1128ee2401e8983b290600090a2505050565b610f09612be4565b610f11612c3e565b565b6060816001600160401b03811115610f2d57610f2d613a3f565b604051908082528060200260200182016040528015610f6057816020015b6060815260200190600190039081610f4b5790505b5090506000610f6e600b5490565b905060005b8381101561108d57816001600160401b03811115610f9357610f93613a3f565b604051908082528060200260200182016040528015610fbc578160200160208202803683370190505b50838281518110610fcf57610fcf613c3c565b60200260200101819052506000600a6000878785818110610ff257610ff2613c3c565b90506020020160208101906110079190613901565b6001600160a01b03166001600160a01b03168152602001908152602001600020905060005b8381101561108357600081815260208390526040902054855186908590811061105757611057613c3c565b6020026020010151828151811061107057611070613c3c565b602090810291909101015260010161102c565b5050600101610f73565b505092915050565b610d3c838383604051806020016040528060008152506119dd565b60008060008060006110c18661263a565b60008681526008602052604081208054600b805492939290919081106110e9576110e9613c3c565b6000918252602090912060039182020180546001918201549185015460028601549590930154909b919a509198509296506001600160a01b031694509092505050565b600061114061113b8484612c93565b612cfa565b9392505050565b61114f61232c565b60008060005b848110156111e65785858281811061116f5761116f613c3c565b90506020020135925061118183612379565b6000838152600860205260409020915061119a82612805565b6111a4828561284f565b827f907fece23ce39fbcbceb71e515043fe29408353fbb393b25b35eb8a70a4bad0b856040516111d691815260200190565b60405180910390a2600101611155565b505050505050565b6111f661232c565b60008060005b8381101561127d5784848281811061121657611216613c3c565b90506020020135925061122883612379565b60008381526008602052604090209150611241826125a4565b61124a82612d2b565b60405183907ff27b6ce5b2f5e68ddb2fd95a8a909d4ecf1daaac270935fff052feacb24f184290600090a26001016111fc565b5050505050565b61128c61232c565b8061129681612379565b60008281526008602052604090206112ad816125a4565b6112b681612d2b565b60405183907ff27b6ce5b2f5e68ddb2fd95a8a909d4ecf1daaac270935fff052feacb24f184290600090a2505050565b6000818152600260205260408120546001600160a01b0316806109fb5760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b6044820152606401610957565b60006001600160a01b0382166113b05760405162461bcd60e51b815260206004820152602960248201527f4552433732313a2061646472657373207a65726f206973206e6f7420612076616044820152683634b21037bbb732b960b91b6064820152608401610957565b506001600160a01b031660009081526003602052604090205490565b60006113d661232c565b6000821180156113ee5750346113ec8387613d2c565b145b61140a5760405162461bcd60e51b815260040161095790613d43565b60006114168686612c93565b905061142181612d7f565b600754600101915060005b8381101561149a5761143e8286612dcb565b6114488184613c92565b604080516001600160a01b0388168152602081018a90529081018890527f17700ceb1658b18206f427c1578048e87504106b14ec69e9b4586d9a95174a329060600160405180910390a260010161142c565b50505b949350505050565b6114ad612be4565b610f116000612e65565b60606000821180156114d45750600b546114d18385613c92565b11155b6114f05760405162461bcd60e51b815260040161095790613d43565b816001600160401b0381111561150857611508613a3f565b60405190808252806020026020018201604052801561155d57816020015b61154a60405180606001604052806000815260200160008152602001600081525090565b8152602001906001900390816115265790505b50905060005b828110156115e557600b8185018154811061158057611580613c3c565b906000526020600020906003020160405180606001604052908160008201548152602001600182015481526020016002820154815250508282815181106115c9576115c9613c3c565b60200260200101819052506115de8160010190565b9050611563565b5092915050565b60006115f661232c565b3460006116038286612c93565b905061160e81612d7f565b6116188185612dcb565b600754604080516001600160a01b03871681526020810185905290810187905281907f17700ceb1658b18206f427c1578048e87504106b14ec69e9b4586d9a95174a329060600160405180910390a295945050505050565b611678612be4565b610f11612eb7565b600061168b8261263a565b60008281526008602052604090206116a281612805565b61114081612b08565b606060018054610b8290613ca5565b6060816001600160401b038111156116d4576116d4613a3f565b60405190808252806020026020018201604052801561170757816020015b60608152602001906001900390816116f25790505b5090506000611715600b5490565b905060005b8381101561108d57816001600160401b0381111561173a5761173a613a3f565b604051908082528060200260200182016040528015611763578160200160208202803683370190505b5083828151811061177657611776613c3c565b602002602001018190525060006009600087878581811061179957611799613c3c565b90506020020160208101906117ae9190613901565b6001600160a01b03166001600160a01b03168152602001908152602001600020905060005b8381101561182a5760008181526020839052604090205485518690859081106117fe576117fe613c3c565b6020026020010151828151811061181757611817613c3c565b60209081029190910101526001016117d3565b505060010161171a565b61183c61232c565b6000805b8381101561127d5784848281811061185a5761185a613c3c565b90506020020135915061186c82612379565b60008281526008602052604090206118849084612707565b6040516001600160a01b038416815282907f6f08c7e76d830d5f3d0a18fd27f4d8c0049b24a8689ddb39625e0864d894a9c19060200160405180910390a2600101611840565b6118d5338383612efa565b5050565b6118e161232c565b816118eb81612379565b6000838152600860205260409020611902816125a4565b8054600b8054600091908390811061191c5761191c613c3c565b906000526020600020906003020190508481600001543461193d9190613c92565b1461195a5760405162461bcd60e51b815260040161095790613d6f565b60038301546001600160a01b03166000908152600a6020908152604080832085845290915290208054600019019055600181015461199b90849087906125ee565b857f1d9c4d2b3e13eb9ac08a42625750ac17ec6ca94b4755c49285e9467b4e48c89d866040516119cd91815260200190565b60405180910390a2505050505050565b6119e73383612919565b611a035760405162461bcd60e51b815260040161095790613cdf565b611a0f84848484612fc8565b50505050565b611a1d61232c565b60008060005b848110156111e657858582818110611a3d57611a3d613c3c565b905060200201359250611a4f83612379565b60008381526008602052604090206002810154909250611a6e906123ce565b15611ab35760405162461bcd60e51b81526020600482015260156024820152746e6f7420726561647920746f20776974686472617760581b6044820152606401610957565b611abc83612442565b611ac682856124e5565b6040516001600160a01b0385169084907fd964a27d45f595739c13d8b1160b57491050cacf3a2e5602207277d6228f64ee90600090a3600101611a23565b611b0c61232c565b60018211611b4d5760405162461bcd60e51b815260206004820152600e60248201526d0d2dcecc2d8d2c840d8cadccee8d60931b6044820152606401610957565b3460008080855b8015611ce15760001901878782818110611b7057611b70613c3c565b905060200201359350611b8284612379565b60008481526008602052604090209250611b9b83612805565b82546003840154600b80546001600160a01b039092169183908110611bc257611bc2613c3c565b906000526020600020906003020193508360010154881015611bf65760405162461bcd60e51b815260040161095790613c52565b8354611c029088613c92565b9650611c148560010154600019141590565b15611c49576001600160a01b038116600090815260096020908152604080832085845290915290208054600019019055611c75565b6001600160a01b0381166000908152600a60209081526040808320858452909152902080546000190190555b8215611c8957611c8486612442565b611cda565b6000196001860155611c9c85888a6125ee565b7fb3f4c8ca702dbbd32d9a25ce17b1942a5060284d9d69fc4fcac8fb0397891b128a8a898b604051611cd19493929190613d9a565b60405180910390a15b5050611b54565b5050505050505050565b6060611cf68261263a565b6000611d0d60408051602081019091526000815290565b90506000815111611d2d5760405180602001604052806000815250611140565b80611d3784612ffb565b604051602001611d48929190613de0565b6040516020818303038152906040529392505050565b611d66612be4565b81600003611daa5760405162461bcd60e51b8152602060048201526011602482015270185b5bdd5b9d081a5cc81a5b9d985b1a59607a1b6044820152606401610957565b6000828152600c6020908152604080832084845290915290205415611e095760405162461bcd60e51b81526020600482015260156024820152746475706c6963617465206275636b6574207479706560581b6044820152606401610957565b60408051606081018252838152602080820184815243838501908152600b8054600181018255600082815295517f0175b7a638427703f0dbe7bb9bbf987a2551717b34e79f33b5b1008d1fa01db960039092029182015592517f0175b7a638427703f0dbe7bb9bbf987a2551717b34e79f33b5b1008d1fa01dba84015590517f0175b7a638427703f0dbe7bb9bbf987a2551717b34e79f33b5b1008d1fa01dbb9092019190915554858352600c82528383208584528252918390209190915581518481529081018390527f6b39e3267efcd6611c8d7d2534c4715dcb4824322b90d85540a3a82967b6e7b791015b60405180910390a15050565b611f0b61232c565b81611f1581612379565b6000838152600860205260409020611f2c816125a4565b8054600b80546000919083908110611f4657611f46613c3c565b9060005260206000209060030201905080600101548511611f795760405162461bcd60e51b815260040161095790613d6f565b60038301546001600160a01b03166000908152600a60209081526040808320858452909152902080546000190190558054611fb6908490876125ee565b857fc599168ac63ff28ec278088a2c424383a36ca26c931eb41af05e014f19252ea4866040516119cd91815260200190565b611ff0612be4565b43600b611ffd8484612c93565b8154811061200d5761200d613c3c565b9060005260206000209060030201600201819055507f6b39e3267efcd6611c8d7d2534c4715dcb4824322b90d85540a3a82967b6e7b78282604051611ef7929190918252602082015260400190565b61206461232c565b60008060005b8381101561127d5784848281811061208457612084613c3c565b90506020020135925061209683612379565b600083815260086020526040902091506120af82612805565b6120b882612b08565b156120fc5760405162461bcd60e51b81526020600482015260146024820152736e6f7420726561647920746f20756e7374616b6560601b6044820152606401610957565b61210582612bad565b60405183907f11725367022c3ff288940f4b5473aa61c2da6a24af7363a1128ee2401e8983b290600090a260010161206a565b612140612be4565b600019600b61214f8484612c93565b8154811061215f5761215f613c3c565b9060005260206000209060030201600201819055507f099df2bf9247b43481cf1b791a4dd5fa1220c40c62940da539082fbcb30241d68282604051611ef7929190918252602082015260400190565b60006121b861232c565b348251856121c69190613d2c565b146121e35760405162461bcd60e51b815260040161095790613d43565b60006121ef8585612c93565b90506121fa81612d7f565b600754600101915060005b83518110156122aa576122318285838151811061222457612224613c3c565b6020026020010151612dcb565b61223b8184613c92565b7f17700ceb1658b18206f427c1578048e87504106b14ec69e9b4586d9a95174a3285838151811061226e5761226e613c3c565b602090810291909101810151604080516001600160a01b0390921682529181018a905290810188905260600160405180910390a2600101612205565b50509392505050565b6122bb612be4565b6001600160a01b0381166123205760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610957565b61232981612e65565b50565b600654600160a01b900460ff1615610f115760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606401610957565b612382816112e6565b6001600160a01b0316336001600160a01b0316146123295760405162461bcd60e51b81526020600482015260096024820152683737ba1037bbb732b960b91b6044820152606401610957565b6000600019820361241a5760405162461bcd60e51b81526020600482015260166024820152751b9bdd08185b881d5b9cdd185ad95908189d58dad95d60521b6044820152606401610957565b6000612427600a84613c92565b90504381116124395750600092915050565b43900392915050565b600061244d826112e6565b905061245d81600084600161308d565b612466826112e6565b600083815260046020908152604080832080546001600160a01b03199081169091556001600160a01b0385168085526003845282852080546000190190558785526002909352818420805490911690555192935084927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a45050565b6000600b8360000154815481106124fe576124fe613c3c565b600091825260208220600390910201546040519092506001600160a01b0384169083908381818185875af1925050503d8060008114612559576040519150601f19603f3d011682016040523d82523d6000602084013e61255e565b606091505b5050905080611a0f5760405162461bcd60e51b81526020600482015260126024820152713330b4b632b2103a37903a3930b739b332b960711b6044820152606401610957565b6001810154600019146123295760405162461bcd60e51b81526020600482015260126024820152713737ba1030903637b1b5b2b2103a37b5b2b760711b6044820152606401610957565b60006125fa8383612c93565b905061260581612d7f565b60038401546001600160a01b03166000908152600a602090815260408083208484529091529020805460010190559092555050565b6000818152600260205260409020546001600160a01b03166123295760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b6044820152606401610957565b600081815260046020526040902080546001600160a01b0319166001600160a01b03841690811790915581906126ce826112e6565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b61271082612805565b815460038301546001600160a01b0390811690831681036127435760405162461bcd60e51b815260040161095790613d6f565b600184015460001914612799576001600160a01b038181166000908152600960208181526040808420878552825280842080546000190190559387168352908152828220858352905220805460010190556127de565b6001600160a01b038181166000908152600a60208181526040808420878552825280842080546000190190559387168352908152828220858352905220805460010190555b505060039190910180546001600160a01b0319166001600160a01b03909216919091179055565b6002810154600019146123295760405162461bcd60e51b81526020600482015260126024820152713737ba10309039ba30b5b2b2103a37b5b2b760711b6044820152606401610957565b815460038301546001600160a01b031661286884612b08565b8310156128875760405162461bcd60e51b815260040161095790613c52565b60006128b7600b848154811061289f5761289f613c3c565b90600052602060002090600302016000015485612c93565b90506128c281612d7f565b60001960018681018290556001600160a01b039390931660008181526009602090815260408083209783529681528682208054909401909355968390558652600a8152838620918652529220805490920190915550565b600080612925836112e6565b9050806001600160a01b0316846001600160a01b0316148061296c57506001600160a01b0380821660009081526005602090815260408083209388168352929052205460ff165b8061149d5750836001600160a01b031661298584610c05565b6001600160a01b031614949350505050565b826001600160a01b03166129aa826112e6565b6001600160a01b0316146129d05760405162461bcd60e51b815260040161095790613e0f565b6001600160a01b038216612a325760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b6064820152608401610957565b612a3f838383600161308d565b826001600160a01b0316612a52826112e6565b6001600160a01b031614612a785760405162461bcd60e51b815260040161095790613e0f565b600081815260046020908152604080832080546001600160a01b03199081169091556001600160a01b0387811680865260038552838620805460001901905590871680865283862080546001019055868652600290945282852080549092168417909155905184937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b60018101546000906000198103612b5a5760405162461bcd60e51b81526020600482015260166024820152751b9bdd08185b881d5b9b1bd8dad95908189d58dad95d60521b6044820152606401610957565b6000600b846000015481548110612b7357612b73613c3c565b90600052602060002090600302016001015482612b909190613c92565b9050438111612ba3575060009392505050565b4390039392505050565b43600282015560038101546001600160a01b0316600090815260096020908152604080832093548352929052208054600019019055565b6006546001600160a01b03163314610f115760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610957565b612c4661315d565b6006805460ff60a01b191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b6000828152600c6020908152604080832084845290915281205480612cf05760405162461bcd60e51b8152602060048201526013602482015272696e76616c6964206275636b6574207479706560681b6044820152606401610957565b600019810161149d565b600043600b8381548110612d1057612d10613c3c565b90600052602060002090600302016002015411159050919050565b80546003820154436001938401556001600160a01b03166000818152600a60209081526040808320858452825280832080546000190190559282526009815282822093825292909252902080549091019055565b612d8881612cfa565b6123295760405162461bcd60e51b8152602060048201526014602482015273696e616374697665206275636b6574207479706560601b6044820152606401610957565b6007805460019081018083556040805160808101825286815260001960208083018281528385019283526001600160a01b0389811660608601818152600098895260088552878920965187559251868a0155935160028601559051600390940180546001600160a01b03191694909116939093179092558352600a81528183208784529052902080549091019055546118d59033906131ad565b600680546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b612ebf61232c565b6006805460ff60a01b1916600160a01b1790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258612c763390565b816001600160a01b0316836001600160a01b031603612f5b5760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c6572000000000000006044820152606401610957565b6001600160a01b03838116600081815260056020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b612fd3848484612997565b612fdf848484846131c7565b611a0f5760405162461bcd60e51b815260040161095790613e54565b60606000613008836132c5565b60010190506000816001600160401b0381111561302757613027613a3f565b6040519080825280601f01601f191660200182016040528015613051576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a850494508461305b57509392505050565b806001146130dd5760405162461bcd60e51b815260206004820152601f60248201527f6261746368207472616e73666572206973206e6f7420737570706f72746564006044820152606401610957565b6001600160a01b03831615806131055750600082815260086020526040902060020154600019145b6131515760405162461bcd60e51b815260206004820152601e60248201527f63616e6e6f74207472616e7366657220756e7374616b656420746f6b656e00006044820152606401610957565b611a0f8484848461339d565b600654600160a01b900460ff16610f115760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606401610957565b6118d5828260405180602001604052806000815250613425565b60006001600160a01b0384163b156132bd57604051630a85bd0160e11b81526001600160a01b0385169063150b7a029061320b903390899088908890600401613ea6565b6020604051808303816000875af1925050508015613246575060408051601f3d908101601f1916820190925261324391810190613ee3565b60015b6132a3573d808015613274576040519150601f19603f3d011682016040523d82523d6000602084013e613279565b606091505b50805160000361329b5760405162461bcd60e51b815260040161095790613e54565b805181602001fd5b6001600160e01b031916630a85bd0160e11b14905061149d565b50600161149d565b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b83106133045772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef81000000008310613330576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc10000831061334e57662386f26fc10000830492506010015b6305f5e1008310613366576305f5e100830492506008015b612710831061337a57612710830492506004015b6064831061338c576064830492506002015b600a83106109fb5760010192915050565b6001811115611a0f576001600160a01b038416156133e3576001600160a01b038416600090815260036020526040812080548392906133dd908490613f00565b90915550505b6001600160a01b03831615611a0f576001600160a01b0383166000908152600360205260408120805483929061341a908490613c92565b909155505050505050565b61342f8383613458565b61343c60008484846131c7565b610d3c5760405162461bcd60e51b815260040161095790613e54565b6001600160a01b0382166134ae5760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610957565b6000818152600260205260409020546001600160a01b0316156135135760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610957565b61352160008383600161308d565b6000818152600260205260409020546001600160a01b0316156135865760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610957565b6001600160a01b038216600081815260036020908152604080832080546001019055848352600290915280822080546001600160a01b0319168417905551839291907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b6001600160a01b038116811461232957600080fd5b6000806040838503121561361957600080fd5b82359150602083013561362b816135f1565b809150509250929050565b6001600160e01b03198116811461232957600080fd5b60006020828403121561365e57600080fd5b813561114081613636565b60008060006060848603121561367e57600080fd5b505081359360208301359350604090920135919050565b6000602082840312156136a757600080fd5b5035919050565b60005b838110156136c95781810151838201526020016136b1565b50506000910152565b600081518084526136ea8160208601602086016136ae565b601f01601f19169290920160200192915050565b60208152600061114060208301846136d2565b6000806040838503121561372457600080fd5b823561372f816135f1565b946020939093013593505050565b6000806040838503121561375057600080fd5b50508035926020909101359150565b60008060006060848603121561377457600080fd5b833561377f816135f1565b9250602084013561378f816135f1565b929592945050506040919091013590565b60008083601f8401126137b257600080fd5b5081356001600160401b038111156137c957600080fd5b6020830191508360208260051b85010111156137e457600080fd5b9250929050565b600080602083850312156137fe57600080fd5b82356001600160401b0381111561381457600080fd5b613820858286016137a0565b90969095509350505050565b6000602080830181845280855180835260408601915060408160051b87010192508387016000805b838110156138a857888603603f19018552825180518088529088019088880190845b818110156138925783518352928a0192918a0191600101613876565b5090975050509386019391860191600101613854565b509398975050505050505050565b6000806000604084860312156138cb57600080fd5b83356001600160401b038111156138e157600080fd5b6138ed868287016137a0565b909790965060209590950135949350505050565b60006020828403121561391357600080fd5b8135611140816135f1565b6000806000806080858703121561393457600080fd5b8435935060208501359250604085013561394d816135f1565b9396929550929360600135925050565b602080825282518282018190526000919060409081850190868401855b828110156139a9578151805185528681015187860152850151858501526060909301929085019060010161397a565b5091979650505050505050565b6000806000604084860312156139cb57600080fd5b83356001600160401b038111156139e157600080fd5b6139ed868287016137a0565b9094509250506020840135613a01816135f1565b809150509250925092565b60008060408385031215613a1f57600080fd5b8235613a2a816135f1565b91506020830135801515811461362b57600080fd5b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b0381118282101715613a7d57613a7d613a3f565b604052919050565b60008060008060808587031215613a9b57600080fd5b8435613aa6816135f1565b9350602085810135613ab7816135f1565b93506040860135925060608601356001600160401b0380821115613ada57600080fd5b818801915088601f830112613aee57600080fd5b813581811115613b0057613b00613a3f565b613b12601f8201601f19168501613a55565b91508082528984828501011115613b2857600080fd5b808484018584013760008482840101525080935050505092959194509250565b60008060408385031215613b5b57600080fd5b8235613b66816135f1565b9150602083013561362b816135f1565b600080600060608486031215613b8b57600080fd5b83359250602080850135925060408501356001600160401b0380821115613bb157600080fd5b818701915087601f830112613bc557600080fd5b813581811115613bd757613bd7613a3f565b8060051b9150613be8848301613a55565b818152918301840191848101908a841115613c0257600080fd5b938501935b83851015613c2c5784359250613c1c836135f1565b8282529385019390850190613c07565b8096505050505050509250925092565b634e487b7160e01b600052603260045260246000fd5b60208082526010908201526f34b73b30b634b210323ab930ba34b7b760811b604082015260600190565b634e487b7160e01b600052601160045260246000fd5b808201808211156109fb576109fb613c7c565b600181811c90821680613cb957607f821691505b602082108103613cd957634e487b7160e01b600052602260045260246000fd5b50919050565b6020808252602d908201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560408201526c1c881bdc88185c1c1c9bdd9959609a1b606082015260800190565b80820281158282048414176109fb576109fb613c7c565b602080825260129082015271696e76616c696420706172616d657465727360701b604082015260600190565b60208082526011908201527034b73b30b634b21037b832b930ba34b7b760791b604082015260600190565b6060808252810184905260006001600160fb1b03851115613dba57600080fd5b8460051b8087608085013760208301949094525060408101919091520160800192915050565b60008351613df28184602088016136ae565b835190830190613e068183602088016136ae565b01949350505050565b60208082526025908201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060408201526437bbb732b960d91b606082015260800190565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090613ed9908301846136d2565b9695505050505050565b600060208284031215613ef557600080fd5b815161114081613636565b818103818111156109fb576109fb613c7c56fea2646970667358221220363250bb8b8a89b6bd6144d6e10513e72fecd387ea46cd2679517a96409386b564736f6c63430008120033` _stakingContractABI = `[ { "inputs": [], @@ -118,6 +118,12 @@ const ( { "anonymous": false, "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + }, { "indexed": false, "internalType": "uint256", @@ -131,7 +137,7 @@ const ( "type": "uint256" } ], - "name": "BucketTypeActivated", + "name": "BucketExpanded", "type": "event" }, { @@ -150,18 +156,12 @@ const ( "type": "uint256" } ], - "name": "BucketTypeDeactivated", + "name": "BucketTypeActivated", "type": "event" }, { "anonymous": false, "inputs": [ - { - "indexed": true, - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - }, { "indexed": false, "internalType": "uint256", @@ -175,7 +175,7 @@ const ( "type": "uint256" } ], - "name": "BucketTypeExpanded", + "name": "BucketTypeDeactivated", "type": "event" }, { @@ -695,7 +695,7 @@ const ( "type": "uint256" } ], - "name": "expandBucketType", + "name": "expandBucket", "outputs": [], "stateMutability": "payable", "type": "function" @@ -1661,7 +1661,7 @@ func TestContractStaking(t *testing.T) { bt := simpleStake(_delegates[4], big.NewInt(10), big.NewInt(10)) tokenID := bt.Index - data, err := lsdABI.Pack("expandBucketType", big.NewInt(int64(tokenID)), big.NewInt(100), big.NewInt(100)) + data, err := lsdABI.Pack("expandBucket", big.NewInt(int64(tokenID)), big.NewInt(100), big.NewInt(100)) r.NoError(err) param = callParam{ contractAddr: contractAddresses, From a050ae4cd2a08af11be0822844b5fb52754999e5 Mon Sep 17 00:00:00 2001 From: envestcc Date: Tue, 6 Jun 2023 21:51:39 +0800 Subject: [PATCH 4/7] update contract --- blockchain/genesis/genesis.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/blockchain/genesis/genesis.go b/blockchain/genesis/genesis.go index eaca849e95..bc83aa397e 100644 --- a/blockchain/genesis/genesis.go +++ b/blockchain/genesis/genesis.go @@ -84,8 +84,8 @@ func defaultConfig() Genesis { ProbationIntensityRate: 90, UnproductiveDelegateMaxCacheSize: 20, // TODO (iip-13): replace the following with the address and height on mainnet - SystemStakingContractAddress: "io1uw3gvmhrjz5mwxpd966wxxt6fn5uuvwfpynrwj", - SystemStakingContractHeight: 20386536, + SystemStakingContractAddress: "io14g76t4d03c27pa4lthv98207wwa6e3ptvhcsq5", + SystemStakingContractHeight: 20635347, }, Rewarding: Rewarding{ InitBalanceStr: unit.ConvertIotxToRau(200000000).String(), From 3a5b5aeb96482144e21877e6ae6ce396e6814993 Mon Sep 17 00:00:00 2001 From: envestcc Date: Wed, 7 Jun 2023 12:11:44 +0800 Subject: [PATCH 5/7] remove handle increaseAmount & extendDuration --- blockindex/contractstaking/event_handler.go | 94 --------- e2etest/contract_staking_test.go | 203 ++++++++++---------- 2 files changed, 105 insertions(+), 192 deletions(-) diff --git a/blockindex/contractstaking/event_handler.go b/blockindex/contractstaking/event_handler.go index 56a0147b2a..dd95f9ba20 100644 --- a/blockindex/contractstaking/event_handler.go +++ b/blockindex/contractstaking/event_handler.go @@ -23,25 +23,6 @@ import ( const ( // StakingContractABI is the ABI of system staking contract StakingContractABI = `[ - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "AmountIncreased", - "type": "event" - }, { "anonymous": false, "inputs": [ @@ -149,25 +130,6 @@ const ( "name": "DelegateChanged", "type": "event" }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "duration", - "type": "uint256" - } - ], - "name": "DurationExtended", - "type": "event" - }, { "anonymous": false, "inputs": [ @@ -442,10 +404,6 @@ func (eh *contractStakingEventHandler) HandleEvent(ctx context.Context, blk *blo return eh.handleUnstakedEvent(event, blk.Height()) case "Merged": return eh.handleMergedEvent(event) - case "DurationExtended": - return eh.handleDurationExtendedEvent(event) - case "AmountIncreased": - return eh.handleAmountIncreasedEvent(event) case "BucketExpanded": return eh.handleBucketExpandedEvent(event) case "DelegateChanged": @@ -641,58 +599,6 @@ func (eh *contractStakingEventHandler) handleMergedEvent(event eventParam) error return eh.dirty.updateBucketInfo(tokenIDsParam[0].Uint64(), b) } -func (eh *contractStakingEventHandler) handleDurationExtendedEvent(event eventParam) error { - tokenIDParam, err := event.IndexedFieldUint256("tokenId") - if err != nil { - return err - } - durationParam, err := event.FieldUint256("duration") - if err != nil { - return err - } - - b, ok := eh.dirty.getBucketInfo(tokenIDParam.Uint64()) - if !ok { - return errors.Wrapf(ErrBucketNotExist, "token id %d", tokenIDParam.Uint64()) - } - bt, ok := eh.dirty.getBucketType(b.TypeIndex) - if !ok { - return errors.Wrapf(errBucketTypeNotExist, "id %d", b.TypeIndex) - } - newBtIdx, _, ok := eh.dirty.matchBucketType(bt.Amount, durationParam.Uint64()) - if !ok { - return errors.Wrapf(errBucketTypeNotExist, "amount %d, duration %d", bt.Amount.Int64(), durationParam.Uint64()) - } - b.TypeIndex = newBtIdx - return eh.dirty.updateBucketInfo(tokenIDParam.Uint64(), b) -} - -func (eh *contractStakingEventHandler) handleAmountIncreasedEvent(event eventParam) error { - tokenIDParam, err := event.IndexedFieldUint256("tokenId") - if err != nil { - return err - } - amountParam, err := event.FieldUint256("amount") - if err != nil { - return err - } - - b, ok := eh.dirty.getBucketInfo(tokenIDParam.Uint64()) - if !ok { - return errors.Wrapf(ErrBucketNotExist, "token id %d", tokenIDParam.Uint64()) - } - bt, ok := eh.dirty.getBucketType(b.TypeIndex) - if !ok { - return errors.Wrapf(errBucketTypeNotExist, "id %d", b.TypeIndex) - } - newBtIdx, _, ok := eh.dirty.matchBucketType(amountParam, bt.Duration) - if !ok { - return errors.Wrapf(errBucketTypeNotExist, "amount %d, duration %d", amountParam.Int64(), bt.Duration) - } - b.TypeIndex = newBtIdx - return eh.dirty.updateBucketInfo(tokenIDParam.Uint64(), b) -} - func (eh *contractStakingEventHandler) handleBucketExpandedEvent(event eventParam) error { tokenIDParam, err := event.IndexedFieldUint256("tokenId") if err != nil { diff --git a/e2etest/contract_staking_test.go b/e2etest/contract_staking_test.go index 5a01d43caa..4d7e296986 100644 --- a/e2etest/contract_staking_test.go +++ b/e2etest/contract_staking_test.go @@ -39,32 +39,13 @@ import ( const ( // _stakingContractByteCode is the byte code of the contract staking contract for testing, which changes the freeze blocks to 10 - _stakingContractByteCode = `60806040523480156200001157600080fd5b5060405180604001604052806009815260200168109d58dad95d13919560ba1b815250604051806040016040528060038152602001621092d560ea1b81525081600090816200006191906200019b565b5060016200007082826200019b565b5050506200008d62000087620000a060201b60201c565b620000a4565b6006805460ff60a01b1916905562000267565b3390565b600680546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b634e487b7160e01b600052604160045260246000fd5b600181811c908216806200012157607f821691505b6020821081036200014257634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200019657600081815260208120601f850160051c81016020861015620001715750805b601f850160051c820191505b8181101562000192578281556001016200017d565b5050505b505050565b81516001600160401b03811115620001b757620001b7620000f6565b620001cf81620001c884546200010c565b8462000148565b602080601f831160018114620002075760008415620001ee5750858301515b600019600386901b1c1916600185901b17855562000192565b600085815260208120601f198616915b82811015620002385788860151825594840194600190910190840162000217565b5085821015620002575787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b613f4980620002776000396000f3fe6080604052600436106102ad5760003560e01c806378bfca1011610175578063b8f4bd7b116100dc578063e0028ecf11610095578063eb0ffb2e1161006f578063eb0ffb2e14610880578063eec7ee73146108a0578063f0b56b5d146108b3578063f2fde38b146108c857600080fd5b8063e0028ecf146107f7578063e449f34114610817578063e985e9c51461083757600080fd5b8063b8f4bd7b1461074e578063bbe33ea51461076e578063c87b56dd14610781578063c8e77923146107a1578063d0949f99146107c1578063d6605fd8146107d757600080fd5b8063960014bd1161012e578063960014bd146106a657806398ca3b76146106c65780639f7d5b00146106e6578063a22cb465146106fb578063b2383e551461071b578063b88d4fde1461072e57600080fd5b806378bfca10146105fe5780637acb77571461062b5780638456cb591461063e5780638da5cb5b1461065357806393b6ef591461067157806395d89b411461069157600080fd5b80633fd140df116102195780635d36598f116101d25780635d36598f146105565780636198e339146105765780636352211e1461059657806370a08231146105b6578063711563d4146105d6578063715018a6146105e957600080fd5b80633fd140df1461045957806342842e0e14610486578063431cd92a146104a657806343e06c59146104f75780635c975abb146105175780635ceb8b5b1461053657600080fd5b8063095ea7b31161026b578063095ea7b3146103a45780630f5b2ca5146103c45780631338736f146103e457806323b872dd146104045780632e17de78146104245780633f4ba83a1461044457600080fd5b8062f714ce146102b257806301ffc9a7146102d4578063025008ed1461030957806303459b161461031c57806306fdde031461034a578063081812fc1461036c575b600080fd5b3480156102be57600080fd5b506102d26102cd366004613606565b6108e8565b005b3480156102e057600080fd5b506102f46102ef36600461364c565b6109af565b60405190151581526020015b60405180910390f35b6102d2610317366004613669565b610a01565b34801561032857600080fd5b5061033c610337366004613695565b610b4d565b604051908152602001610300565b34801561035657600080fd5b5061035f610b73565b60405161030091906136fe565b34801561037857600080fd5b5061038c610387366004613695565b610c05565b6040516001600160a01b039091168152602001610300565b3480156103b057600080fd5b506102d26103bf366004613711565b610c2c565b3480156103d057600080fd5b506102d26103df366004613606565b610d41565b3480156103f057600080fd5b506102d26103ff36600461373d565b610dae565b34801561041057600080fd5b506102d261041f36600461375f565b610e21565b34801561043057600080fd5b506102d261043f366004613695565b610e52565b34801561045057600080fd5b506102d2610f01565b34801561046557600080fd5b506104796104743660046137eb565b610f13565b604051610300919061382c565b34801561049257600080fd5b506102d26104a136600461375f565b611095565b3480156104b257600080fd5b506104c66104c1366004613695565b6110b0565b6040805195865260208601949094529284019190915260608301526001600160a01b0316608082015260a001610300565b34801561050357600080fd5b506102f461051236600461373d565b61112c565b34801561052357600080fd5b50600654600160a01b900460ff166102f4565b34801561054257600080fd5b506102d26105513660046138b6565b611147565b34801561056257600080fd5b506102d26105713660046137eb565b6111ee565b34801561058257600080fd5b506102d2610591366004613695565b611284565b3480156105a257600080fd5b5061038c6105b1366004613695565b6112e6565b3480156105c257600080fd5b5061033c6105d1366004613901565b611346565b61033c6105e436600461391e565b6113cc565b3480156105f557600080fd5b506102d26114a5565b34801561060a57600080fd5b5061061e61061936600461373d565b6114b7565b604051610300919061395d565b61033c610639366004613606565b6115ec565b34801561064a57600080fd5b506102d2611670565b34801561065f57600080fd5b506006546001600160a01b031661038c565b34801561067d57600080fd5b5061033c61068c366004613695565b611680565b34801561069d57600080fd5b5061035f6116ab565b3480156106b257600080fd5b506104796106c13660046137eb565b6116ba565b3480156106d257600080fd5b506102d26106e13660046139b6565b611834565b3480156106f257600080fd5b50600b5461033c565b34801561070757600080fd5b506102d2610716366004613a0c565b6118ca565b6102d261072936600461373d565b6118d9565b34801561073a57600080fd5b506102d2610749366004613a85565b6119dd565b34801561075a57600080fd5b506102d26107693660046139b6565b611a15565b6102d261077c3660046138b6565b611b04565b34801561078d57600080fd5b5061035f61079c366004613695565b611ceb565b3480156107ad57600080fd5b506102d26107bc36600461373d565b611d5e565b3480156107cd57600080fd5b5061033c60001981565b3480156107e357600080fd5b506102d26107f236600461373d565b611f03565b34801561080357600080fd5b506102d261081236600461373d565b611fe8565b34801561082357600080fd5b506102d26108323660046137eb565b61205c565b34801561084357600080fd5b506102f4610852366004613b48565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205460ff1690565b34801561088c57600080fd5b506102d261089b36600461373d565b612138565b61033c6108ae366004613b76565b6121ae565b3480156108bf57600080fd5b5061033c600a81565b3480156108d457600080fd5b506102d26108e3366004613901565b6122b3565b6108f061232c565b816108fa81612379565b60008381526008602052604090206002810154610916906123ce565b156109605760405162461bcd60e51b81526020600482015260156024820152746e6f7420726561647920746f20776974686472617760581b60448201526064015b60405180910390fd5b61096984612442565b61097381846124e5565b6040516001600160a01b0384169085907fd964a27d45f595739c13d8b1160b57491050cacf3a2e5602207277d6228f64ee90600090a350505050565b60006001600160e01b031982166380ac58cd60e01b14806109e057506001600160e01b03198216635b5e139f60e01b145b806109fb57506301ffc9a760e01b6001600160e01b03198316145b92915050565b610a0961232c565b82610a1381612379565b6000848152600860205260409020610a2a816125a4565b8054600b80546000919083908110610a4457610a44613c3c565b9060005260206000209060030201905080600101548511610a775760405162461bcd60e51b815260040161095790613c52565b600034118015610a92575080548690610a909034613c92565b145b610acf5760405162461bcd60e51b815260206004820152600e60248201526d1a5b9d985b1a5908185b5bdd5b9d60921b6044820152606401610957565b60038301546001600160a01b03166000908152600a6020908152604080832085845290915290208054600019019055610b098387876125ee565b604080518781526020810187905288917fd29e04160a74f0dbab5e7b82ef0392d86d11ac2939e5883eb3353be4cfedb83e910160405180910390a250505050505050565b6000610b588261263a565b6000828152600860205260409020600201546109fb906123ce565b606060008054610b8290613ca5565b80601f0160208091040260200160405190810160405280929190818152602001828054610bae90613ca5565b8015610bfb5780601f10610bd057610100808354040283529160200191610bfb565b820191906000526020600020905b815481529060010190602001808311610bde57829003601f168201915b5050505050905090565b6000610c108261263a565b506000908152600460205260409020546001600160a01b031690565b6000610c37826112e6565b9050806001600160a01b0316836001600160a01b031603610ca45760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b6064820152608401610957565b336001600160a01b0382161480610cc05750610cc08133610852565b610d325760405162461bcd60e51b815260206004820152603d60248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60448201527f6b656e206f776e6572206f7220617070726f76656420666f7220616c6c0000006064820152608401610957565b610d3c8383612699565b505050565b610d4961232c565b81610d5381612379565b6000838152600860205260409020610d6b9083612707565b6040516001600160a01b038316815283907f6f08c7e76d830d5f3d0a18fd27f4d8c0049b24a8689ddb39625e0864d894a9c19060200160405180910390a2505050565b610db661232c565b81610dc081612379565b6000838152600860205260409020610dd781612805565b610de1818461284f565b837f907fece23ce39fbcbceb71e515043fe29408353fbb393b25b35eb8a70a4bad0b84604051610e1391815260200190565b60405180910390a250505050565b610e2b3382612919565b610e475760405162461bcd60e51b815260040161095790613cdf565b610d3c838383612997565b610e5a61232c565b80610e6481612379565b6000828152600860205260409020610e7b81612805565b610e8481612b08565b15610ec85760405162461bcd60e51b81526020600482015260146024820152736e6f7420726561647920746f20756e7374616b6560601b6044820152606401610957565b610ed181612bad565b60405183907f11725367022c3ff288940f4b5473aa61c2da6a24af7363a1128ee2401e8983b290600090a2505050565b610f09612be4565b610f11612c3e565b565b6060816001600160401b03811115610f2d57610f2d613a3f565b604051908082528060200260200182016040528015610f6057816020015b6060815260200190600190039081610f4b5790505b5090506000610f6e600b5490565b905060005b8381101561108d57816001600160401b03811115610f9357610f93613a3f565b604051908082528060200260200182016040528015610fbc578160200160208202803683370190505b50838281518110610fcf57610fcf613c3c565b60200260200101819052506000600a6000878785818110610ff257610ff2613c3c565b90506020020160208101906110079190613901565b6001600160a01b03166001600160a01b03168152602001908152602001600020905060005b8381101561108357600081815260208390526040902054855186908590811061105757611057613c3c565b6020026020010151828151811061107057611070613c3c565b602090810291909101015260010161102c565b5050600101610f73565b505092915050565b610d3c838383604051806020016040528060008152506119dd565b60008060008060006110c18661263a565b60008681526008602052604081208054600b805492939290919081106110e9576110e9613c3c565b6000918252602090912060039182020180546001918201549185015460028601549590930154909b919a509198509296506001600160a01b031694509092505050565b600061114061113b8484612c93565b612cfa565b9392505050565b61114f61232c565b60008060005b848110156111e65785858281811061116f5761116f613c3c565b90506020020135925061118183612379565b6000838152600860205260409020915061119a82612805565b6111a4828561284f565b827f907fece23ce39fbcbceb71e515043fe29408353fbb393b25b35eb8a70a4bad0b856040516111d691815260200190565b60405180910390a2600101611155565b505050505050565b6111f661232c565b60008060005b8381101561127d5784848281811061121657611216613c3c565b90506020020135925061122883612379565b60008381526008602052604090209150611241826125a4565b61124a82612d2b565b60405183907ff27b6ce5b2f5e68ddb2fd95a8a909d4ecf1daaac270935fff052feacb24f184290600090a26001016111fc565b5050505050565b61128c61232c565b8061129681612379565b60008281526008602052604090206112ad816125a4565b6112b681612d2b565b60405183907ff27b6ce5b2f5e68ddb2fd95a8a909d4ecf1daaac270935fff052feacb24f184290600090a2505050565b6000818152600260205260408120546001600160a01b0316806109fb5760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b6044820152606401610957565b60006001600160a01b0382166113b05760405162461bcd60e51b815260206004820152602960248201527f4552433732313a2061646472657373207a65726f206973206e6f7420612076616044820152683634b21037bbb732b960b91b6064820152608401610957565b506001600160a01b031660009081526003602052604090205490565b60006113d661232c565b6000821180156113ee5750346113ec8387613d2c565b145b61140a5760405162461bcd60e51b815260040161095790613d43565b60006114168686612c93565b905061142181612d7f565b600754600101915060005b8381101561149a5761143e8286612dcb565b6114488184613c92565b604080516001600160a01b0388168152602081018a90529081018890527f17700ceb1658b18206f427c1578048e87504106b14ec69e9b4586d9a95174a329060600160405180910390a260010161142c565b50505b949350505050565b6114ad612be4565b610f116000612e65565b60606000821180156114d45750600b546114d18385613c92565b11155b6114f05760405162461bcd60e51b815260040161095790613d43565b816001600160401b0381111561150857611508613a3f565b60405190808252806020026020018201604052801561155d57816020015b61154a60405180606001604052806000815260200160008152602001600081525090565b8152602001906001900390816115265790505b50905060005b828110156115e557600b8185018154811061158057611580613c3c565b906000526020600020906003020160405180606001604052908160008201548152602001600182015481526020016002820154815250508282815181106115c9576115c9613c3c565b60200260200101819052506115de8160010190565b9050611563565b5092915050565b60006115f661232c565b3460006116038286612c93565b905061160e81612d7f565b6116188185612dcb565b600754604080516001600160a01b03871681526020810185905290810187905281907f17700ceb1658b18206f427c1578048e87504106b14ec69e9b4586d9a95174a329060600160405180910390a295945050505050565b611678612be4565b610f11612eb7565b600061168b8261263a565b60008281526008602052604090206116a281612805565b61114081612b08565b606060018054610b8290613ca5565b6060816001600160401b038111156116d4576116d4613a3f565b60405190808252806020026020018201604052801561170757816020015b60608152602001906001900390816116f25790505b5090506000611715600b5490565b905060005b8381101561108d57816001600160401b0381111561173a5761173a613a3f565b604051908082528060200260200182016040528015611763578160200160208202803683370190505b5083828151811061177657611776613c3c565b602002602001018190525060006009600087878581811061179957611799613c3c565b90506020020160208101906117ae9190613901565b6001600160a01b03166001600160a01b03168152602001908152602001600020905060005b8381101561182a5760008181526020839052604090205485518690859081106117fe576117fe613c3c565b6020026020010151828151811061181757611817613c3c565b60209081029190910101526001016117d3565b505060010161171a565b61183c61232c565b6000805b8381101561127d5784848281811061185a5761185a613c3c565b90506020020135915061186c82612379565b60008281526008602052604090206118849084612707565b6040516001600160a01b038416815282907f6f08c7e76d830d5f3d0a18fd27f4d8c0049b24a8689ddb39625e0864d894a9c19060200160405180910390a2600101611840565b6118d5338383612efa565b5050565b6118e161232c565b816118eb81612379565b6000838152600860205260409020611902816125a4565b8054600b8054600091908390811061191c5761191c613c3c565b906000526020600020906003020190508481600001543461193d9190613c92565b1461195a5760405162461bcd60e51b815260040161095790613d6f565b60038301546001600160a01b03166000908152600a6020908152604080832085845290915290208054600019019055600181015461199b90849087906125ee565b857f1d9c4d2b3e13eb9ac08a42625750ac17ec6ca94b4755c49285e9467b4e48c89d866040516119cd91815260200190565b60405180910390a2505050505050565b6119e73383612919565b611a035760405162461bcd60e51b815260040161095790613cdf565b611a0f84848484612fc8565b50505050565b611a1d61232c565b60008060005b848110156111e657858582818110611a3d57611a3d613c3c565b905060200201359250611a4f83612379565b60008381526008602052604090206002810154909250611a6e906123ce565b15611ab35760405162461bcd60e51b81526020600482015260156024820152746e6f7420726561647920746f20776974686472617760581b6044820152606401610957565b611abc83612442565b611ac682856124e5565b6040516001600160a01b0385169084907fd964a27d45f595739c13d8b1160b57491050cacf3a2e5602207277d6228f64ee90600090a3600101611a23565b611b0c61232c565b60018211611b4d5760405162461bcd60e51b815260206004820152600e60248201526d0d2dcecc2d8d2c840d8cadccee8d60931b6044820152606401610957565b3460008080855b8015611ce15760001901878782818110611b7057611b70613c3c565b905060200201359350611b8284612379565b60008481526008602052604090209250611b9b83612805565b82546003840154600b80546001600160a01b039092169183908110611bc257611bc2613c3c565b906000526020600020906003020193508360010154881015611bf65760405162461bcd60e51b815260040161095790613c52565b8354611c029088613c92565b9650611c148560010154600019141590565b15611c49576001600160a01b038116600090815260096020908152604080832085845290915290208054600019019055611c75565b6001600160a01b0381166000908152600a60209081526040808320858452909152902080546000190190555b8215611c8957611c8486612442565b611cda565b6000196001860155611c9c85888a6125ee565b7fb3f4c8ca702dbbd32d9a25ce17b1942a5060284d9d69fc4fcac8fb0397891b128a8a898b604051611cd19493929190613d9a565b60405180910390a15b5050611b54565b5050505050505050565b6060611cf68261263a565b6000611d0d60408051602081019091526000815290565b90506000815111611d2d5760405180602001604052806000815250611140565b80611d3784612ffb565b604051602001611d48929190613de0565b6040516020818303038152906040529392505050565b611d66612be4565b81600003611daa5760405162461bcd60e51b8152602060048201526011602482015270185b5bdd5b9d081a5cc81a5b9d985b1a59607a1b6044820152606401610957565b6000828152600c6020908152604080832084845290915290205415611e095760405162461bcd60e51b81526020600482015260156024820152746475706c6963617465206275636b6574207479706560581b6044820152606401610957565b60408051606081018252838152602080820184815243838501908152600b8054600181018255600082815295517f0175b7a638427703f0dbe7bb9bbf987a2551717b34e79f33b5b1008d1fa01db960039092029182015592517f0175b7a638427703f0dbe7bb9bbf987a2551717b34e79f33b5b1008d1fa01dba84015590517f0175b7a638427703f0dbe7bb9bbf987a2551717b34e79f33b5b1008d1fa01dbb9092019190915554858352600c82528383208584528252918390209190915581518481529081018390527f6b39e3267efcd6611c8d7d2534c4715dcb4824322b90d85540a3a82967b6e7b791015b60405180910390a15050565b611f0b61232c565b81611f1581612379565b6000838152600860205260409020611f2c816125a4565b8054600b80546000919083908110611f4657611f46613c3c565b9060005260206000209060030201905080600101548511611f795760405162461bcd60e51b815260040161095790613d6f565b60038301546001600160a01b03166000908152600a60209081526040808320858452909152902080546000190190558054611fb6908490876125ee565b857fc599168ac63ff28ec278088a2c424383a36ca26c931eb41af05e014f19252ea4866040516119cd91815260200190565b611ff0612be4565b43600b611ffd8484612c93565b8154811061200d5761200d613c3c565b9060005260206000209060030201600201819055507f6b39e3267efcd6611c8d7d2534c4715dcb4824322b90d85540a3a82967b6e7b78282604051611ef7929190918252602082015260400190565b61206461232c565b60008060005b8381101561127d5784848281811061208457612084613c3c565b90506020020135925061209683612379565b600083815260086020526040902091506120af82612805565b6120b882612b08565b156120fc5760405162461bcd60e51b81526020600482015260146024820152736e6f7420726561647920746f20756e7374616b6560601b6044820152606401610957565b61210582612bad565b60405183907f11725367022c3ff288940f4b5473aa61c2da6a24af7363a1128ee2401e8983b290600090a260010161206a565b612140612be4565b600019600b61214f8484612c93565b8154811061215f5761215f613c3c565b9060005260206000209060030201600201819055507f099df2bf9247b43481cf1b791a4dd5fa1220c40c62940da539082fbcb30241d68282604051611ef7929190918252602082015260400190565b60006121b861232c565b348251856121c69190613d2c565b146121e35760405162461bcd60e51b815260040161095790613d43565b60006121ef8585612c93565b90506121fa81612d7f565b600754600101915060005b83518110156122aa576122318285838151811061222457612224613c3c565b6020026020010151612dcb565b61223b8184613c92565b7f17700ceb1658b18206f427c1578048e87504106b14ec69e9b4586d9a95174a3285838151811061226e5761226e613c3c565b602090810291909101810151604080516001600160a01b0390921682529181018a905290810188905260600160405180910390a2600101612205565b50509392505050565b6122bb612be4565b6001600160a01b0381166123205760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610957565b61232981612e65565b50565b600654600160a01b900460ff1615610f115760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606401610957565b612382816112e6565b6001600160a01b0316336001600160a01b0316146123295760405162461bcd60e51b81526020600482015260096024820152683737ba1037bbb732b960b91b6044820152606401610957565b6000600019820361241a5760405162461bcd60e51b81526020600482015260166024820152751b9bdd08185b881d5b9cdd185ad95908189d58dad95d60521b6044820152606401610957565b6000612427600a84613c92565b90504381116124395750600092915050565b43900392915050565b600061244d826112e6565b905061245d81600084600161308d565b612466826112e6565b600083815260046020908152604080832080546001600160a01b03199081169091556001600160a01b0385168085526003845282852080546000190190558785526002909352818420805490911690555192935084927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a45050565b6000600b8360000154815481106124fe576124fe613c3c565b600091825260208220600390910201546040519092506001600160a01b0384169083908381818185875af1925050503d8060008114612559576040519150601f19603f3d011682016040523d82523d6000602084013e61255e565b606091505b5050905080611a0f5760405162461bcd60e51b81526020600482015260126024820152713330b4b632b2103a37903a3930b739b332b960711b6044820152606401610957565b6001810154600019146123295760405162461bcd60e51b81526020600482015260126024820152713737ba1030903637b1b5b2b2103a37b5b2b760711b6044820152606401610957565b60006125fa8383612c93565b905061260581612d7f565b60038401546001600160a01b03166000908152600a602090815260408083208484529091529020805460010190559092555050565b6000818152600260205260409020546001600160a01b03166123295760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b6044820152606401610957565b600081815260046020526040902080546001600160a01b0319166001600160a01b03841690811790915581906126ce826112e6565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b61271082612805565b815460038301546001600160a01b0390811690831681036127435760405162461bcd60e51b815260040161095790613d6f565b600184015460001914612799576001600160a01b038181166000908152600960208181526040808420878552825280842080546000190190559387168352908152828220858352905220805460010190556127de565b6001600160a01b038181166000908152600a60208181526040808420878552825280842080546000190190559387168352908152828220858352905220805460010190555b505060039190910180546001600160a01b0319166001600160a01b03909216919091179055565b6002810154600019146123295760405162461bcd60e51b81526020600482015260126024820152713737ba10309039ba30b5b2b2103a37b5b2b760711b6044820152606401610957565b815460038301546001600160a01b031661286884612b08565b8310156128875760405162461bcd60e51b815260040161095790613c52565b60006128b7600b848154811061289f5761289f613c3c565b90600052602060002090600302016000015485612c93565b90506128c281612d7f565b60001960018681018290556001600160a01b039390931660008181526009602090815260408083209783529681528682208054909401909355968390558652600a8152838620918652529220805490920190915550565b600080612925836112e6565b9050806001600160a01b0316846001600160a01b0316148061296c57506001600160a01b0380821660009081526005602090815260408083209388168352929052205460ff165b8061149d5750836001600160a01b031661298584610c05565b6001600160a01b031614949350505050565b826001600160a01b03166129aa826112e6565b6001600160a01b0316146129d05760405162461bcd60e51b815260040161095790613e0f565b6001600160a01b038216612a325760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b6064820152608401610957565b612a3f838383600161308d565b826001600160a01b0316612a52826112e6565b6001600160a01b031614612a785760405162461bcd60e51b815260040161095790613e0f565b600081815260046020908152604080832080546001600160a01b03199081169091556001600160a01b0387811680865260038552838620805460001901905590871680865283862080546001019055868652600290945282852080549092168417909155905184937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b60018101546000906000198103612b5a5760405162461bcd60e51b81526020600482015260166024820152751b9bdd08185b881d5b9b1bd8dad95908189d58dad95d60521b6044820152606401610957565b6000600b846000015481548110612b7357612b73613c3c565b90600052602060002090600302016001015482612b909190613c92565b9050438111612ba3575060009392505050565b4390039392505050565b43600282015560038101546001600160a01b0316600090815260096020908152604080832093548352929052208054600019019055565b6006546001600160a01b03163314610f115760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610957565b612c4661315d565b6006805460ff60a01b191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b6000828152600c6020908152604080832084845290915281205480612cf05760405162461bcd60e51b8152602060048201526013602482015272696e76616c6964206275636b6574207479706560681b6044820152606401610957565b600019810161149d565b600043600b8381548110612d1057612d10613c3c565b90600052602060002090600302016002015411159050919050565b80546003820154436001938401556001600160a01b03166000818152600a60209081526040808320858452825280832080546000190190559282526009815282822093825292909252902080549091019055565b612d8881612cfa565b6123295760405162461bcd60e51b8152602060048201526014602482015273696e616374697665206275636b6574207479706560601b6044820152606401610957565b6007805460019081018083556040805160808101825286815260001960208083018281528385019283526001600160a01b0389811660608601818152600098895260088552878920965187559251868a0155935160028601559051600390940180546001600160a01b03191694909116939093179092558352600a81528183208784529052902080549091019055546118d59033906131ad565b600680546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b612ebf61232c565b6006805460ff60a01b1916600160a01b1790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258612c763390565b816001600160a01b0316836001600160a01b031603612f5b5760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c6572000000000000006044820152606401610957565b6001600160a01b03838116600081815260056020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b612fd3848484612997565b612fdf848484846131c7565b611a0f5760405162461bcd60e51b815260040161095790613e54565b60606000613008836132c5565b60010190506000816001600160401b0381111561302757613027613a3f565b6040519080825280601f01601f191660200182016040528015613051576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a850494508461305b57509392505050565b806001146130dd5760405162461bcd60e51b815260206004820152601f60248201527f6261746368207472616e73666572206973206e6f7420737570706f72746564006044820152606401610957565b6001600160a01b03831615806131055750600082815260086020526040902060020154600019145b6131515760405162461bcd60e51b815260206004820152601e60248201527f63616e6e6f74207472616e7366657220756e7374616b656420746f6b656e00006044820152606401610957565b611a0f8484848461339d565b600654600160a01b900460ff16610f115760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606401610957565b6118d5828260405180602001604052806000815250613425565b60006001600160a01b0384163b156132bd57604051630a85bd0160e11b81526001600160a01b0385169063150b7a029061320b903390899088908890600401613ea6565b6020604051808303816000875af1925050508015613246575060408051601f3d908101601f1916820190925261324391810190613ee3565b60015b6132a3573d808015613274576040519150601f19603f3d011682016040523d82523d6000602084013e613279565b606091505b50805160000361329b5760405162461bcd60e51b815260040161095790613e54565b805181602001fd5b6001600160e01b031916630a85bd0160e11b14905061149d565b50600161149d565b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b83106133045772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef81000000008310613330576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc10000831061334e57662386f26fc10000830492506010015b6305f5e1008310613366576305f5e100830492506008015b612710831061337a57612710830492506004015b6064831061338c576064830492506002015b600a83106109fb5760010192915050565b6001811115611a0f576001600160a01b038416156133e3576001600160a01b038416600090815260036020526040812080548392906133dd908490613f00565b90915550505b6001600160a01b03831615611a0f576001600160a01b0383166000908152600360205260408120805483929061341a908490613c92565b909155505050505050565b61342f8383613458565b61343c60008484846131c7565b610d3c5760405162461bcd60e51b815260040161095790613e54565b6001600160a01b0382166134ae5760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610957565b6000818152600260205260409020546001600160a01b0316156135135760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610957565b61352160008383600161308d565b6000818152600260205260409020546001600160a01b0316156135865760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610957565b6001600160a01b038216600081815260036020908152604080832080546001019055848352600290915280822080546001600160a01b0319168417905551839291907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b6001600160a01b038116811461232957600080fd5b6000806040838503121561361957600080fd5b82359150602083013561362b816135f1565b809150509250929050565b6001600160e01b03198116811461232957600080fd5b60006020828403121561365e57600080fd5b813561114081613636565b60008060006060848603121561367e57600080fd5b505081359360208301359350604090920135919050565b6000602082840312156136a757600080fd5b5035919050565b60005b838110156136c95781810151838201526020016136b1565b50506000910152565b600081518084526136ea8160208601602086016136ae565b601f01601f19169290920160200192915050565b60208152600061114060208301846136d2565b6000806040838503121561372457600080fd5b823561372f816135f1565b946020939093013593505050565b6000806040838503121561375057600080fd5b50508035926020909101359150565b60008060006060848603121561377457600080fd5b833561377f816135f1565b9250602084013561378f816135f1565b929592945050506040919091013590565b60008083601f8401126137b257600080fd5b5081356001600160401b038111156137c957600080fd5b6020830191508360208260051b85010111156137e457600080fd5b9250929050565b600080602083850312156137fe57600080fd5b82356001600160401b0381111561381457600080fd5b613820858286016137a0565b90969095509350505050565b6000602080830181845280855180835260408601915060408160051b87010192508387016000805b838110156138a857888603603f19018552825180518088529088019088880190845b818110156138925783518352928a0192918a0191600101613876565b5090975050509386019391860191600101613854565b509398975050505050505050565b6000806000604084860312156138cb57600080fd5b83356001600160401b038111156138e157600080fd5b6138ed868287016137a0565b909790965060209590950135949350505050565b60006020828403121561391357600080fd5b8135611140816135f1565b6000806000806080858703121561393457600080fd5b8435935060208501359250604085013561394d816135f1565b9396929550929360600135925050565b602080825282518282018190526000919060409081850190868401855b828110156139a9578151805185528681015187860152850151858501526060909301929085019060010161397a565b5091979650505050505050565b6000806000604084860312156139cb57600080fd5b83356001600160401b038111156139e157600080fd5b6139ed868287016137a0565b9094509250506020840135613a01816135f1565b809150509250925092565b60008060408385031215613a1f57600080fd5b8235613a2a816135f1565b91506020830135801515811461362b57600080fd5b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b0381118282101715613a7d57613a7d613a3f565b604052919050565b60008060008060808587031215613a9b57600080fd5b8435613aa6816135f1565b9350602085810135613ab7816135f1565b93506040860135925060608601356001600160401b0380821115613ada57600080fd5b818801915088601f830112613aee57600080fd5b813581811115613b0057613b00613a3f565b613b12601f8201601f19168501613a55565b91508082528984828501011115613b2857600080fd5b808484018584013760008482840101525080935050505092959194509250565b60008060408385031215613b5b57600080fd5b8235613b66816135f1565b9150602083013561362b816135f1565b600080600060608486031215613b8b57600080fd5b83359250602080850135925060408501356001600160401b0380821115613bb157600080fd5b818701915087601f830112613bc557600080fd5b813581811115613bd757613bd7613a3f565b8060051b9150613be8848301613a55565b818152918301840191848101908a841115613c0257600080fd5b938501935b83851015613c2c5784359250613c1c836135f1565b8282529385019390850190613c07565b8096505050505050509250925092565b634e487b7160e01b600052603260045260246000fd5b60208082526010908201526f34b73b30b634b210323ab930ba34b7b760811b604082015260600190565b634e487b7160e01b600052601160045260246000fd5b808201808211156109fb576109fb613c7c565b600181811c90821680613cb957607f821691505b602082108103613cd957634e487b7160e01b600052602260045260246000fd5b50919050565b6020808252602d908201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560408201526c1c881bdc88185c1c1c9bdd9959609a1b606082015260800190565b80820281158282048414176109fb576109fb613c7c565b602080825260129082015271696e76616c696420706172616d657465727360701b604082015260600190565b60208082526011908201527034b73b30b634b21037b832b930ba34b7b760791b604082015260600190565b6060808252810184905260006001600160fb1b03851115613dba57600080fd5b8460051b8087608085013760208301949094525060408101919091520160800192915050565b60008351613df28184602088016136ae565b835190830190613e068183602088016136ae565b01949350505050565b60208082526025908201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060408201526437bbb732b960d91b606082015260800190565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090613ed9908301846136d2565b9695505050505050565b600060208284031215613ef557600080fd5b815161114081613636565b818103818111156109fb576109fb613c7c56fea2646970667358221220363250bb8b8a89b6bd6144d6e10513e72fecd387ea46cd2679517a96409386b564736f6c63430008120033` + _stakingContractByteCode = `60806040523480156200001157600080fd5b5060405180604001604052806009815260200168109d58dad95d13919560ba1b815250604051806040016040528060038152602001621092d560ea1b81525081600090816200006191906200019b565b5060016200007082826200019b565b5050506200008d62000087620000a060201b60201c565b620000a4565b6006805460ff60a01b1916905562000267565b3390565b600680546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b634e487b7160e01b600052604160045260246000fd5b600181811c908216806200012157607f821691505b6020821081036200014257634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200019657600081815260208120601f850160051c81016020861015620001715750805b601f850160051c820191505b8181101562000192578281556001016200017d565b5050505b505050565b81516001600160401b03811115620001b757620001b7620000f6565b620001cf81620001c884546200010c565b8462000148565b602080601f831160018114620002075760008415620001ee5750858301515b600019600386901b1c1916600185901b17855562000192565b600085815260208120601f198616915b82811015620002385788860151825594840194600190910190840162000217565b5085821015620002575787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b613cf580620002776000396000f3fe6080604052600436106102875760003560e01c8063715018a61161015a578063b8f4bd7b116100c1578063e449f3411161007a578063e449f341146107be578063e985e9c5146107de578063eb0ffb2e14610827578063eec7ee7314610847578063f0b56b5d1461085a578063f2fde38b1461086f57600080fd5b8063b8f4bd7b14610715578063bbe33ea514610735578063c87b56dd14610748578063c8e7792314610768578063d0949f9914610788578063e0028ecf1461079e57600080fd5b806395d89b411161011357806395d89b411461066b578063960014bd1461068057806398ca3b76146106a05780639f7d5b00146106c0578063a22cb465146106d5578063b88d4fde146106f557600080fd5b8063715018a6146105c357806378bfca10146105d85780637acb7757146106055780638456cb59146106185780638da5cb5b1461062d57806393b6ef591461064b57600080fd5b80633f4ba83a116101fe5780635ceb8b5b116101b75780635ceb8b5b146105105780635d36598f146105305780636198e339146105505780636352211e1461057057806370a0823114610590578063711563d4146105b057600080fd5b80633f4ba83a1461041e5780633fd140df1461043357806342842e0e14610460578063431cd92a1461048057806343e06c59146104d15780635c975abb146104f157600080fd5b8063081812fc11610250578063081812fc14610346578063095ea7b31461037e5780630f5b2ca51461039e5780631338736f146103be57806323b872dd146103de5780632e17de78146103fe57600080fd5b8062f714ce1461028c57806301ffc9a7146102ae578063025008ed146102e357806303459b16146102f657806306fdde0314610324575b600080fd5b34801561029857600080fd5b506102ac6102a73660046133dd565b61088f565b005b3480156102ba57600080fd5b506102ce6102c9366004613423565b610956565b60405190151581526020015b60405180910390f35b6102ac6102f1366004613440565b6109a8565b34801561030257600080fd5b5061031661031136600461346c565b610ae9565b6040519081526020016102da565b34801561033057600080fd5b50610339610b0f565b6040516102da91906134d5565b34801561035257600080fd5b5061036661036136600461346c565b610ba1565b6040516001600160a01b0390911681526020016102da565b34801561038a57600080fd5b506102ac6103993660046134e8565b610bc8565b3480156103aa57600080fd5b506102ac6103b93660046133dd565b610cdd565b3480156103ca57600080fd5b506102ac6103d9366004613514565b610d4a565b3480156103ea57600080fd5b506102ac6103f9366004613536565b610dbd565b34801561040a57600080fd5b506102ac61041936600461346c565b610dee565b34801561042a57600080fd5b506102ac610e9d565b34801561043f57600080fd5b5061045361044e3660046135c2565b610eaf565b6040516102da9190613603565b34801561046c57600080fd5b506102ac61047b366004613536565b611031565b34801561048c57600080fd5b506104a061049b36600461346c565b61104c565b6040805195865260208601949094529284019190915260608301526001600160a01b0316608082015260a0016102da565b3480156104dd57600080fd5b506102ce6104ec366004613514565b6110c8565b3480156104fd57600080fd5b50600654600160a01b900460ff166102ce565b34801561051c57600080fd5b506102ac61052b36600461368d565b6110e3565b34801561053c57600080fd5b506102ac61054b3660046135c2565b61118a565b34801561055c57600080fd5b506102ac61056b36600461346c565b611220565b34801561057c57600080fd5b5061036661058b36600461346c565b611282565b34801561059c57600080fd5b506103166105ab3660046136d8565b6112e2565b6103166105be3660046136f5565b611368565b3480156105cf57600080fd5b506102ac611441565b3480156105e457600080fd5b506105f86105f3366004613514565b611453565b6040516102da9190613734565b6103166106133660046133dd565b611588565b34801561062457600080fd5b506102ac61160c565b34801561063957600080fd5b506006546001600160a01b0316610366565b34801561065757600080fd5b5061031661066636600461346c565b61161c565b34801561067757600080fd5b50610339611647565b34801561068c57600080fd5b5061045361069b3660046135c2565b611656565b3480156106ac57600080fd5b506102ac6106bb36600461378d565b6117d0565b3480156106cc57600080fd5b50600b54610316565b3480156106e157600080fd5b506102ac6106f03660046137e3565b611866565b34801561070157600080fd5b506102ac61071036600461385c565b611875565b34801561072157600080fd5b506102ac61073036600461378d565b6118ad565b6102ac61074336600461368d565b61199c565b34801561075457600080fd5b5061033961076336600461346c565b611b83565b34801561077457600080fd5b506102ac610783366004613514565b611bf6565b34801561079457600080fd5b5061031660001981565b3480156107aa57600080fd5b506102ac6107b9366004613514565b611d9b565b3480156107ca57600080fd5b506102ac6107d93660046135c2565b611e0f565b3480156107ea57600080fd5b506102ce6107f936600461391f565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205460ff1690565b34801561083357600080fd5b506102ac610842366004613514565b611eeb565b61031661085536600461394d565b611f61565b34801561086657600080fd5b50610316600a81565b34801561087b57600080fd5b506102ac61088a3660046136d8565b612066565b6108976120df565b816108a18161212c565b600083815260086020526040902060028101546108bd90612181565b156109075760405162461bcd60e51b81526020600482015260156024820152746e6f7420726561647920746f20776974686472617760581b60448201526064015b60405180910390fd5b610910846121f5565b61091a8184612298565b6040516001600160a01b0384169085907fd964a27d45f595739c13d8b1160b57491050cacf3a2e5602207277d6228f64ee90600090a350505050565b60006001600160e01b031982166380ac58cd60e01b148061098757506001600160e01b03198216635b5e139f60e01b145b806109a257506301ffc9a760e01b6001600160e01b03198316145b92915050565b6109b06120df565b826109ba8161212c565b60008481526008602052604090206109d181612357565b8054600b805460009190839081106109eb576109eb613a13565b906000526020600020906003020190508060010154851015610a1f5760405162461bcd60e51b81526004016108fe90613a29565b80548690610a2d9034613a69565b14610a6b5760405162461bcd60e51b815260206004820152600e60248201526d1a5b9d985b1a5908185b5bdd5b9d60921b60448201526064016108fe565b60038301546001600160a01b03166000908152600a6020908152604080832085845290915290208054600019019055610aa58387876123a1565b604080518781526020810187905288917fd29e04160a74f0dbab5e7b82ef0392d86d11ac2939e5883eb3353be4cfedb83e910160405180910390a250505050505050565b6000610af4826123ed565b6000828152600860205260409020600201546109a290612181565b606060008054610b1e90613a7c565b80601f0160208091040260200160405190810160405280929190818152602001828054610b4a90613a7c565b8015610b975780601f10610b6c57610100808354040283529160200191610b97565b820191906000526020600020905b815481529060010190602001808311610b7a57829003601f168201915b5050505050905090565b6000610bac826123ed565b506000908152600460205260409020546001600160a01b031690565b6000610bd382611282565b9050806001600160a01b0316836001600160a01b031603610c405760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b60648201526084016108fe565b336001600160a01b0382161480610c5c5750610c5c81336107f9565b610cce5760405162461bcd60e51b815260206004820152603d60248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60448201527f6b656e206f776e6572206f7220617070726f76656420666f7220616c6c00000060648201526084016108fe565b610cd8838361244c565b505050565b610ce56120df565b81610cef8161212c565b6000838152600860205260409020610d0790836124ba565b6040516001600160a01b038316815283907f6f08c7e76d830d5f3d0a18fd27f4d8c0049b24a8689ddb39625e0864d894a9c19060200160405180910390a2505050565b610d526120df565b81610d5c8161212c565b6000838152600860205260409020610d73816125dc565b610d7d8184612626565b837f907fece23ce39fbcbceb71e515043fe29408353fbb393b25b35eb8a70a4bad0b84604051610daf91815260200190565b60405180910390a250505050565b610dc733826126f0565b610de35760405162461bcd60e51b81526004016108fe90613ab6565b610cd883838361276e565b610df66120df565b80610e008161212c565b6000828152600860205260409020610e17816125dc565b610e20816128df565b15610e645760405162461bcd60e51b81526020600482015260146024820152736e6f7420726561647920746f20756e7374616b6560601b60448201526064016108fe565b610e6d81612984565b60405183907f11725367022c3ff288940f4b5473aa61c2da6a24af7363a1128ee2401e8983b290600090a2505050565b610ea56129bb565b610ead612a15565b565b6060816001600160401b03811115610ec957610ec9613816565b604051908082528060200260200182016040528015610efc57816020015b6060815260200190600190039081610ee75790505b5090506000610f0a600b5490565b905060005b8381101561102957816001600160401b03811115610f2f57610f2f613816565b604051908082528060200260200182016040528015610f58578160200160208202803683370190505b50838281518110610f6b57610f6b613a13565b60200260200101819052506000600a6000878785818110610f8e57610f8e613a13565b9050602002016020810190610fa391906136d8565b6001600160a01b03166001600160a01b03168152602001908152602001600020905060005b8381101561101f576000818152602083905260409020548551869085908110610ff357610ff3613a13565b6020026020010151828151811061100c5761100c613a13565b6020908102919091010152600101610fc8565b5050600101610f0f565b505092915050565b610cd883838360405180602001604052806000815250611875565b600080600080600061105d866123ed565b60008681526008602052604081208054600b8054929392909190811061108557611085613a13565b6000918252602090912060039182020180546001918201549185015460028601549590930154909b919a509198509296506001600160a01b031694509092505050565b60006110dc6110d78484612a6a565b612ad1565b9392505050565b6110eb6120df565b60008060005b848110156111825785858281811061110b5761110b613a13565b90506020020135925061111d8361212c565b60008381526008602052604090209150611136826125dc565b6111408285612626565b827f907fece23ce39fbcbceb71e515043fe29408353fbb393b25b35eb8a70a4bad0b8560405161117291815260200190565b60405180910390a26001016110f1565b505050505050565b6111926120df565b60008060005b83811015611219578484828181106111b2576111b2613a13565b9050602002013592506111c48361212c565b600083815260086020526040902091506111dd82612357565b6111e682612b02565b60405183907ff27b6ce5b2f5e68ddb2fd95a8a909d4ecf1daaac270935fff052feacb24f184290600090a2600101611198565b5050505050565b6112286120df565b806112328161212c565b600082815260086020526040902061124981612357565b61125281612b02565b60405183907ff27b6ce5b2f5e68ddb2fd95a8a909d4ecf1daaac270935fff052feacb24f184290600090a2505050565b6000818152600260205260408120546001600160a01b0316806109a25760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b60448201526064016108fe565b60006001600160a01b03821661134c5760405162461bcd60e51b815260206004820152602960248201527f4552433732313a2061646472657373207a65726f206973206e6f7420612076616044820152683634b21037bbb732b960b91b60648201526084016108fe565b506001600160a01b031660009081526003602052604090205490565b60006113726120df565b60008211801561138a5750346113888387613b03565b145b6113a65760405162461bcd60e51b81526004016108fe90613b1a565b60006113b28686612a6a565b90506113bd81612b56565b600754600101915060005b83811015611436576113da8286612ba2565b6113e48184613a69565b604080516001600160a01b0388168152602081018a90529081018890527f17700ceb1658b18206f427c1578048e87504106b14ec69e9b4586d9a95174a329060600160405180910390a26001016113c8565b50505b949350505050565b6114496129bb565b610ead6000612c3c565b60606000821180156114705750600b5461146d8385613a69565b11155b61148c5760405162461bcd60e51b81526004016108fe90613b1a565b816001600160401b038111156114a4576114a4613816565b6040519080825280602002602001820160405280156114f957816020015b6114e660405180606001604052806000815260200160008152602001600081525090565b8152602001906001900390816114c25790505b50905060005b8281101561158157600b8185018154811061151c5761151c613a13565b9060005260206000209060030201604051806060016040529081600082015481526020016001820154815260200160028201548152505082828151811061156557611565613a13565b602002602001018190525061157a8160010190565b90506114ff565b5092915050565b60006115926120df565b34600061159f8286612a6a565b90506115aa81612b56565b6115b48185612ba2565b600754604080516001600160a01b03871681526020810185905290810187905281907f17700ceb1658b18206f427c1578048e87504106b14ec69e9b4586d9a95174a329060600160405180910390a295945050505050565b6116146129bb565b610ead612c8e565b6000611627826123ed565b600082815260086020526040902061163e816125dc565b6110dc816128df565b606060018054610b1e90613a7c565b6060816001600160401b0381111561167057611670613816565b6040519080825280602002602001820160405280156116a357816020015b606081526020019060019003908161168e5790505b50905060006116b1600b5490565b905060005b8381101561102957816001600160401b038111156116d6576116d6613816565b6040519080825280602002602001820160405280156116ff578160200160208202803683370190505b5083828151811061171257611712613a13565b602002602001018190525060006009600087878581811061173557611735613a13565b905060200201602081019061174a91906136d8565b6001600160a01b03166001600160a01b03168152602001908152602001600020905060005b838110156117c657600081815260208390526040902054855186908590811061179a5761179a613a13565b602002602001015182815181106117b3576117b3613a13565b602090810291909101015260010161176f565b50506001016116b6565b6117d86120df565b6000805b83811015611219578484828181106117f6576117f6613a13565b9050602002013591506118088261212c565b600082815260086020526040902061182090846124ba565b6040516001600160a01b038416815282907f6f08c7e76d830d5f3d0a18fd27f4d8c0049b24a8689ddb39625e0864d894a9c19060200160405180910390a26001016117dc565b611871338383612cd1565b5050565b61187f33836126f0565b61189b5760405162461bcd60e51b81526004016108fe90613ab6565b6118a784848484612d9f565b50505050565b6118b56120df565b60008060005b84811015611182578585828181106118d5576118d5613a13565b9050602002013592506118e78361212c565b6000838152600860205260409020600281015490925061190690612181565b1561194b5760405162461bcd60e51b81526020600482015260156024820152746e6f7420726561647920746f20776974686472617760581b60448201526064016108fe565b611954836121f5565b61195e8285612298565b6040516001600160a01b0385169084907fd964a27d45f595739c13d8b1160b57491050cacf3a2e5602207277d6228f64ee90600090a36001016118bb565b6119a46120df565b600182116119e55760405162461bcd60e51b815260206004820152600e60248201526d0d2dcecc2d8d2c840d8cadccee8d60931b60448201526064016108fe565b3460008080855b8015611b795760001901878782818110611a0857611a08613a13565b905060200201359350611a1a8461212c565b60008481526008602052604090209250611a33836125dc565b82546003840154600b80546001600160a01b039092169183908110611a5a57611a5a613a13565b906000526020600020906003020193508360010154881015611a8e5760405162461bcd60e51b81526004016108fe90613a29565b8354611a9a9088613a69565b9650611aac8560010154600019141590565b15611ae1576001600160a01b038116600090815260096020908152604080832085845290915290208054600019019055611b0d565b6001600160a01b0381166000908152600a60209081526040808320858452909152902080546000190190555b8215611b2157611b1c866121f5565b611b72565b6000196001860155611b3485888a6123a1565b7fb3f4c8ca702dbbd32d9a25ce17b1942a5060284d9d69fc4fcac8fb0397891b128a8a898b604051611b699493929190613b46565b60405180910390a15b50506119ec565b5050505050505050565b6060611b8e826123ed565b6000611ba560408051602081019091526000815290565b90506000815111611bc557604051806020016040528060008152506110dc565b80611bcf84612dd2565b604051602001611be0929190613b8c565b6040516020818303038152906040529392505050565b611bfe6129bb565b81600003611c425760405162461bcd60e51b8152602060048201526011602482015270185b5bdd5b9d081a5cc81a5b9d985b1a59607a1b60448201526064016108fe565b6000828152600c6020908152604080832084845290915290205415611ca15760405162461bcd60e51b81526020600482015260156024820152746475706c6963617465206275636b6574207479706560581b60448201526064016108fe565b60408051606081018252838152602080820184815243838501908152600b8054600181018255600082815295517f0175b7a638427703f0dbe7bb9bbf987a2551717b34e79f33b5b1008d1fa01db960039092029182015592517f0175b7a638427703f0dbe7bb9bbf987a2551717b34e79f33b5b1008d1fa01dba84015590517f0175b7a638427703f0dbe7bb9bbf987a2551717b34e79f33b5b1008d1fa01dbb9092019190915554858352600c82528383208584528252918390209190915581518481529081018390527f6b39e3267efcd6611c8d7d2534c4715dcb4824322b90d85540a3a82967b6e7b791015b60405180910390a15050565b611da36129bb565b43600b611db08484612a6a565b81548110611dc057611dc0613a13565b9060005260206000209060030201600201819055507f6b39e3267efcd6611c8d7d2534c4715dcb4824322b90d85540a3a82967b6e7b78282604051611d8f929190918252602082015260400190565b611e176120df565b60008060005b8381101561121957848482818110611e3757611e37613a13565b905060200201359250611e498361212c565b60008381526008602052604090209150611e62826125dc565b611e6b826128df565b15611eaf5760405162461bcd60e51b81526020600482015260146024820152736e6f7420726561647920746f20756e7374616b6560601b60448201526064016108fe565b611eb882612984565b60405183907f11725367022c3ff288940f4b5473aa61c2da6a24af7363a1128ee2401e8983b290600090a2600101611e1d565b611ef36129bb565b600019600b611f028484612a6a565b81548110611f1257611f12613a13565b9060005260206000209060030201600201819055507f099df2bf9247b43481cf1b791a4dd5fa1220c40c62940da539082fbcb30241d68282604051611d8f929190918252602082015260400190565b6000611f6b6120df565b34825185611f799190613b03565b14611f965760405162461bcd60e51b81526004016108fe90613b1a565b6000611fa28585612a6a565b9050611fad81612b56565b600754600101915060005b835181101561205d57611fe482858381518110611fd757611fd7613a13565b6020026020010151612ba2565b611fee8184613a69565b7f17700ceb1658b18206f427c1578048e87504106b14ec69e9b4586d9a95174a3285838151811061202157612021613a13565b602090810291909101810151604080516001600160a01b0390921682529181018a905290810188905260600160405180910390a2600101611fb8565b50509392505050565b61206e6129bb565b6001600160a01b0381166120d35760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016108fe565b6120dc81612c3c565b50565b600654600160a01b900460ff1615610ead5760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b60448201526064016108fe565b61213581611282565b6001600160a01b0316336001600160a01b0316146120dc5760405162461bcd60e51b81526020600482015260096024820152683737ba1037bbb732b960b91b60448201526064016108fe565b600060001982036121cd5760405162461bcd60e51b81526020600482015260166024820152751b9bdd08185b881d5b9cdd185ad95908189d58dad95d60521b60448201526064016108fe565b60006121da600a84613a69565b90504381116121ec5750600092915050565b43900392915050565b600061220082611282565b9050612210816000846001612e64565b61221982611282565b600083815260046020908152604080832080546001600160a01b03199081169091556001600160a01b0385168085526003845282852080546000190190558785526002909352818420805490911690555192935084927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a45050565b6000600b8360000154815481106122b1576122b1613a13565b600091825260208220600390910201546040519092506001600160a01b0384169083908381818185875af1925050503d806000811461230c576040519150601f19603f3d011682016040523d82523d6000602084013e612311565b606091505b50509050806118a75760405162461bcd60e51b81526020600482015260126024820152713330b4b632b2103a37903a3930b739b332b960711b60448201526064016108fe565b6001810154600019146120dc5760405162461bcd60e51b81526020600482015260126024820152713737ba1030903637b1b5b2b2103a37b5b2b760711b60448201526064016108fe565b60006123ad8383612a6a565b90506123b881612b56565b60038401546001600160a01b03166000908152600a602090815260408083208484529091529020805460010190559092555050565b6000818152600260205260409020546001600160a01b03166120dc5760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b60448201526064016108fe565b600081815260046020526040902080546001600160a01b0319166001600160a01b038416908117909155819061248182611282565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6124c3826125dc565b815460038301546001600160a01b03908116908316810361251a5760405162461bcd60e51b815260206004820152601160248201527034b73b30b634b21037b832b930ba34b7b760791b60448201526064016108fe565b600184015460001914612570576001600160a01b038181166000908152600960208181526040808420878552825280842080546000190190559387168352908152828220858352905220805460010190556125b5565b6001600160a01b038181166000908152600a60208181526040808420878552825280842080546000190190559387168352908152828220858352905220805460010190555b505060039190910180546001600160a01b0319166001600160a01b03909216919091179055565b6002810154600019146120dc5760405162461bcd60e51b81526020600482015260126024820152713737ba10309039ba30b5b2b2103a37b5b2b760711b60448201526064016108fe565b815460038301546001600160a01b031661263f846128df565b83101561265e5760405162461bcd60e51b81526004016108fe90613a29565b600061268e600b848154811061267657612676613a13565b90600052602060002090600302016000015485612a6a565b905061269981612b56565b60001960018681018290556001600160a01b039390931660008181526009602090815260408083209783529681528682208054909401909355968390558652600a8152838620918652529220805490920190915550565b6000806126fc83611282565b9050806001600160a01b0316846001600160a01b0316148061274357506001600160a01b0380821660009081526005602090815260408083209388168352929052205460ff165b806114395750836001600160a01b031661275c84610ba1565b6001600160a01b031614949350505050565b826001600160a01b031661278182611282565b6001600160a01b0316146127a75760405162461bcd60e51b81526004016108fe90613bbb565b6001600160a01b0382166128095760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b60648201526084016108fe565b6128168383836001612e64565b826001600160a01b031661282982611282565b6001600160a01b03161461284f5760405162461bcd60e51b81526004016108fe90613bbb565b600081815260046020908152604080832080546001600160a01b03199081169091556001600160a01b0387811680865260038552838620805460001901905590871680865283862080546001019055868652600290945282852080549092168417909155905184937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b600181015460009060001981036129315760405162461bcd60e51b81526020600482015260166024820152751b9bdd08185b881d5b9b1bd8dad95908189d58dad95d60521b60448201526064016108fe565b6000600b84600001548154811061294a5761294a613a13565b906000526020600020906003020160010154826129679190613a69565b905043811161297a575060009392505050565b4390039392505050565b43600282015560038101546001600160a01b0316600090815260096020908152604080832093548352929052208054600019019055565b6006546001600160a01b03163314610ead5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016108fe565b612a1d612f34565b6006805460ff60a01b191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b6000828152600c6020908152604080832084845290915281205480612ac75760405162461bcd60e51b8152602060048201526013602482015272696e76616c6964206275636b6574207479706560681b60448201526064016108fe565b6000198101611439565b600043600b8381548110612ae757612ae7613a13565b90600052602060002090600302016002015411159050919050565b80546003820154436001938401556001600160a01b03166000818152600a60209081526040808320858452825280832080546000190190559282526009815282822093825292909252902080549091019055565b612b5f81612ad1565b6120dc5760405162461bcd60e51b8152602060048201526014602482015273696e616374697665206275636b6574207479706560601b60448201526064016108fe565b6007805460019081018083556040805160808101825286815260001960208083018281528385019283526001600160a01b0389811660608601818152600098895260088552878920965187559251868a0155935160028601559051600390940180546001600160a01b03191694909116939093179092558352600a8152818320878452905290208054909101905554611871903390612f84565b600680546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b612c966120df565b6006805460ff60a01b1916600160a01b1790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258612a4d3390565b816001600160a01b0316836001600160a01b031603612d325760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c65720000000000000060448201526064016108fe565b6001600160a01b03838116600081815260056020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b612daa84848461276e565b612db684848484612f9e565b6118a75760405162461bcd60e51b81526004016108fe90613c00565b60606000612ddf8361309c565b60010190506000816001600160401b03811115612dfe57612dfe613816565b6040519080825280601f01601f191660200182016040528015612e28576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a8504945084612e3257509392505050565b80600114612eb45760405162461bcd60e51b815260206004820152601f60248201527f6261746368207472616e73666572206973206e6f7420737570706f727465640060448201526064016108fe565b6001600160a01b0383161580612edc5750600082815260086020526040902060020154600019145b612f285760405162461bcd60e51b815260206004820152601e60248201527f63616e6e6f74207472616e7366657220756e7374616b656420746f6b656e000060448201526064016108fe565b6118a784848484613174565b600654600160a01b900460ff16610ead5760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b60448201526064016108fe565b6118718282604051806020016040528060008152506131fc565b60006001600160a01b0384163b1561309457604051630a85bd0160e11b81526001600160a01b0385169063150b7a0290612fe2903390899088908890600401613c52565b6020604051808303816000875af192505050801561301d575060408051601f3d908101601f1916820190925261301a91810190613c8f565b60015b61307a573d80801561304b576040519150601f19603f3d011682016040523d82523d6000602084013e613050565b606091505b5080516000036130725760405162461bcd60e51b81526004016108fe90613c00565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050611439565b506001611439565b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b83106130db5772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef81000000008310613107576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc10000831061312557662386f26fc10000830492506010015b6305f5e100831061313d576305f5e100830492506008015b612710831061315157612710830492506004015b60648310613163576064830492506002015b600a83106109a25760010192915050565b60018111156118a7576001600160a01b038416156131ba576001600160a01b038416600090815260036020526040812080548392906131b4908490613cac565b90915550505b6001600160a01b038316156118a7576001600160a01b038316600090815260036020526040812080548392906131f1908490613a69565b909155505050505050565b613206838361322f565b6132136000848484612f9e565b610cd85760405162461bcd60e51b81526004016108fe90613c00565b6001600160a01b0382166132855760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f206164647265737360448201526064016108fe565b6000818152600260205260409020546001600160a01b0316156132ea5760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e7465640000000060448201526064016108fe565b6132f8600083836001612e64565b6000818152600260205260409020546001600160a01b03161561335d5760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e7465640000000060448201526064016108fe565b6001600160a01b038216600081815260036020908152604080832080546001019055848352600290915280822080546001600160a01b0319168417905551839291907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b6001600160a01b03811681146120dc57600080fd5b600080604083850312156133f057600080fd5b823591506020830135613402816133c8565b809150509250929050565b6001600160e01b0319811681146120dc57600080fd5b60006020828403121561343557600080fd5b81356110dc8161340d565b60008060006060848603121561345557600080fd5b505081359360208301359350604090920135919050565b60006020828403121561347e57600080fd5b5035919050565b60005b838110156134a0578181015183820152602001613488565b50506000910152565b600081518084526134c1816020860160208601613485565b601f01601f19169290920160200192915050565b6020815260006110dc60208301846134a9565b600080604083850312156134fb57600080fd5b8235613506816133c8565b946020939093013593505050565b6000806040838503121561352757600080fd5b50508035926020909101359150565b60008060006060848603121561354b57600080fd5b8335613556816133c8565b92506020840135613566816133c8565b929592945050506040919091013590565b60008083601f84011261358957600080fd5b5081356001600160401b038111156135a057600080fd5b6020830191508360208260051b85010111156135bb57600080fd5b9250929050565b600080602083850312156135d557600080fd5b82356001600160401b038111156135eb57600080fd5b6135f785828601613577565b90969095509350505050565b6000602080830181845280855180835260408601915060408160051b87010192508387016000805b8381101561367f57888603603f19018552825180518088529088019088880190845b818110156136695783518352928a0192918a019160010161364d565b509097505050938601939186019160010161362b565b509398975050505050505050565b6000806000604084860312156136a257600080fd5b83356001600160401b038111156136b857600080fd5b6136c486828701613577565b909790965060209590950135949350505050565b6000602082840312156136ea57600080fd5b81356110dc816133c8565b6000806000806080858703121561370b57600080fd5b84359350602085013592506040850135613724816133c8565b9396929550929360600135925050565b602080825282518282018190526000919060409081850190868401855b828110156137805781518051855286810151878601528501518585015260609093019290850190600101613751565b5091979650505050505050565b6000806000604084860312156137a257600080fd5b83356001600160401b038111156137b857600080fd5b6137c486828701613577565b90945092505060208401356137d8816133c8565b809150509250925092565b600080604083850312156137f657600080fd5b8235613801816133c8565b91506020830135801515811461340257600080fd5b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b038111828210171561385457613854613816565b604052919050565b6000806000806080858703121561387257600080fd5b843561387d816133c8565b935060208581013561388e816133c8565b93506040860135925060608601356001600160401b03808211156138b157600080fd5b818801915088601f8301126138c557600080fd5b8135818111156138d7576138d7613816565b6138e9601f8201601f1916850161382c565b915080825289848285010111156138ff57600080fd5b808484018584013760008482840101525080935050505092959194509250565b6000806040838503121561393257600080fd5b823561393d816133c8565b91506020830135613402816133c8565b60008060006060848603121561396257600080fd5b83359250602080850135925060408501356001600160401b038082111561398857600080fd5b818701915087601f83011261399c57600080fd5b8135818111156139ae576139ae613816565b8060051b91506139bf84830161382c565b818152918301840191848101908a8411156139d957600080fd5b938501935b83851015613a0357843592506139f3836133c8565b82825293850193908501906139de565b8096505050505050509250925092565b634e487b7160e01b600052603260045260246000fd5b60208082526010908201526f34b73b30b634b210323ab930ba34b7b760811b604082015260600190565b634e487b7160e01b600052601160045260246000fd5b808201808211156109a2576109a2613a53565b600181811c90821680613a9057607f821691505b602082108103613ab057634e487b7160e01b600052602260045260246000fd5b50919050565b6020808252602d908201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560408201526c1c881bdc88185c1c1c9bdd9959609a1b606082015260800190565b80820281158282048414176109a2576109a2613a53565b602080825260129082015271696e76616c696420706172616d657465727360701b604082015260600190565b6060808252810184905260006001600160fb1b03851115613b6657600080fd5b8460051b8087608085013760208301949094525060408101919091520160800192915050565b60008351613b9e818460208801613485565b835190830190613bb2818360208801613485565b01949350505050565b60208082526025908201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060408201526437bbb732b960d91b606082015260800190565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090613c85908301846134a9565b9695505050505050565b600060208284031215613ca157600080fd5b81516110dc8161340d565b818103818111156109a2576109a2613a5356fea2646970667358221220c678b66ffcd38f880d3bf9e74ca21c7c767e50fbfef0c4a68283be493d360a3364736f6c63430008120033` _stakingContractABI = `[ { "inputs": [], "stateMutability": "nonpayable", "type": "constructor" }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "AmountIncreased", - "type": "event" - }, { "anonymous": false, "inputs": [ @@ -197,25 +178,6 @@ const ( "name": "DelegateChanged", "type": "event" }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "duration", - "type": "uint256" - } - ], - "name": "DurationExtended", - "type": "event" - }, { "anonymous": false, "inputs": [ @@ -700,24 +662,6 @@ const ( "stateMutability": "payable", "type": "function" }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "_tokenId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_newDuration", - "type": "uint256" - } - ], - "name": "extendDuration", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, { "inputs": [ { @@ -737,24 +681,6 @@ const ( "stateMutability": "view", "type": "function" }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "_tokenId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_newAmount", - "type": "uint256" - } - ], - "name": "increaseAmount", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, { "inputs": [ { @@ -1616,7 +1542,7 @@ func TestContractStaking(t *testing.T) { tokenID := bt.Index r.EqualValues(10, bt.StakedDurationBlockNumber) // extend duration - data, err := lsdABI.Pack("extendDuration", big.NewInt(int64(tokenID)), big.NewInt(100)) + data, err := lsdABI.Pack("expandBucket", big.NewInt(int64(tokenID)), big.NewInt(10), big.NewInt(100)) r.NoError(err) param = callParam{ contractAddr: contractAddresses, @@ -1638,7 +1564,7 @@ func TestContractStaking(t *testing.T) { bt := simpleStake(_delegates[4], big.NewInt(10), big.NewInt(10)) tokenID := bt.Index - data, err := lsdABI.Pack("increaseAmount", big.NewInt(int64(tokenID)), big.NewInt(100)) + data, err := lsdABI.Pack("expandBucket", big.NewInt(int64(tokenID)), big.NewInt(100), big.NewInt(10)) r.NoError(err) param = callParam{ contractAddr: contractAddresses, @@ -1658,27 +1584,109 @@ func TestContractStaking(t *testing.T) { }) t.Run("expand bucket type", func(t *testing.T) { - bt := simpleStake(_delegates[4], big.NewInt(10), big.NewInt(10)) - tokenID := bt.Index - data, err := lsdABI.Pack("expandBucket", big.NewInt(int64(tokenID)), big.NewInt(100), big.NewInt(100)) - r.NoError(err) - param = callParam{ - contractAddr: contractAddresses, - bytecode: hex.EncodeToString(data), - amount: big.NewInt(90), - gasLimit: 1000000, - gasPrice: big.NewInt(0), - sk: identityset.PrivateKey(adminID), - } - receipts, _ = writeContract(bc, sf, dao, ap, []*callParam{¶m}, r) - r.Len(receipts, 1) - r.EqualValues("", receipts[0].ExecutionRevertMsg()) - r.EqualValues(iotextypes.ReceiptStatus_Success, receipts[0].Status) - bt, ok := indexer.Bucket(uint64(tokenID)) - r.True(ok) - r.EqualValues(100, bt.StakedAmount.Int64()) - r.EqualValues(100, bt.StakedDurationBlockNumber) + t.Run("invalid bucket type", func(t *testing.T) { + bt := simpleStake(_delegates[4], big.NewInt(10), big.NewInt(10)) + tokenID := bt.Index + data, err := lsdABI.Pack("expandBucket", big.NewInt(int64(tokenID)), big.NewInt(100), big.NewInt(1000)) + r.NoError(err) + param = callParam{ + contractAddr: contractAddresses, + bytecode: hex.EncodeToString(data), + amount: big.NewInt(90), + gasLimit: 1000000, + gasPrice: big.NewInt(0), + sk: identityset.PrivateKey(adminID), + } + receipts, _ = writeContract(bc, sf, dao, ap, []*callParam{¶m}, r) + r.Len(receipts, 1) + r.EqualValues("invalid bucket type", receipts[0].ExecutionRevertMsg()) + r.EqualValues(iotextypes.ReceiptStatus_ErrExecutionReverted, receipts[0].Status) + }) + + t.Run("shorter duration", func(t *testing.T) { + bt := simpleStake(_delegates[4], big.NewInt(10), big.NewInt(100)) + tokenID := bt.Index + data, err := lsdABI.Pack("expandBucket", big.NewInt(int64(tokenID)), big.NewInt(10), big.NewInt(10)) + r.NoError(err) + param = callParam{ + contractAddr: contractAddresses, + bytecode: hex.EncodeToString(data), + amount: big.NewInt(0), + gasLimit: 1000000, + gasPrice: big.NewInt(0), + sk: identityset.PrivateKey(adminID), + } + receipts, _ = writeContract(bc, sf, dao, ap, []*callParam{¶m}, r) + r.Len(receipts, 1) + r.EqualValues("invalid duration", receipts[0].ExecutionRevertMsg()) + r.EqualValues(iotextypes.ReceiptStatus_ErrExecutionReverted, receipts[0].Status) + }) + + t.Run("not enough pay", func(t *testing.T) { + bt := simpleStake(_delegates[4], big.NewInt(10), big.NewInt(100)) + tokenID := bt.Index + data, err := lsdABI.Pack("expandBucket", big.NewInt(int64(tokenID)), big.NewInt(100), big.NewInt(100)) + r.NoError(err) + param = callParam{ + contractAddr: contractAddresses, + bytecode: hex.EncodeToString(data), + amount: big.NewInt(0), + gasLimit: 1000000, + gasPrice: big.NewInt(0), + sk: identityset.PrivateKey(adminID), + } + receipts, _ = writeContract(bc, sf, dao, ap, []*callParam{¶m}, r) + r.Len(receipts, 1) + r.EqualValues("invalid amount", receipts[0].ExecutionRevertMsg()) + r.EqualValues(iotextypes.ReceiptStatus_ErrExecutionReverted, receipts[0].Status) + }) + + t.Run("success", func(t *testing.T) { + bt := simpleStake(_delegates[4], big.NewInt(10), big.NewInt(10)) + tokenID := bt.Index + data, err := lsdABI.Pack("expandBucket", big.NewInt(int64(tokenID)), big.NewInt(100), big.NewInt(100)) + r.NoError(err) + param = callParam{ + contractAddr: contractAddresses, + bytecode: hex.EncodeToString(data), + amount: big.NewInt(90), + gasLimit: 1000000, + gasPrice: big.NewInt(0), + sk: identityset.PrivateKey(adminID), + } + receipts, _ = writeContract(bc, sf, dao, ap, []*callParam{¶m}, r) + r.Len(receipts, 1) + r.EqualValues("", receipts[0].ExecutionRevertMsg()) + r.EqualValues(iotextypes.ReceiptStatus_Success, receipts[0].Status) + bt, ok := indexer.Bucket(uint64(tokenID)) + r.True(ok) + r.EqualValues(100, bt.StakedAmount.Int64()) + r.EqualValues(100, bt.StakedDurationBlockNumber) + }) + + t.Run("unchange", func(t *testing.T) { + bt := simpleStake(_delegates[4], big.NewInt(10), big.NewInt(10)) + tokenID := bt.Index + data, err := lsdABI.Pack("expandBucket", big.NewInt(int64(tokenID)), big.NewInt(10), big.NewInt(10)) + r.NoError(err) + param = callParam{ + contractAddr: contractAddresses, + bytecode: hex.EncodeToString(data), + amount: big.NewInt(0), + gasLimit: 1000000, + gasPrice: big.NewInt(0), + sk: identityset.PrivateKey(adminID), + } + receipts, _ = writeContract(bc, sf, dao, ap, []*callParam{¶m}, r) + r.Len(receipts, 1) + r.EqualValues("", receipts[0].ExecutionRevertMsg()) + r.EqualValues(iotextypes.ReceiptStatus_Success, receipts[0].Status) + bt, ok := indexer.Bucket(uint64(tokenID)) + r.True(ok) + r.EqualValues(10, bt.StakedAmount.Int64()) + r.EqualValues(10, bt.StakedDurationBlockNumber) + }) }) t.Run("change delegate", func(t *testing.T) { @@ -1707,7 +1715,6 @@ func TestContractStaking(t *testing.T) { r.True(ok) r.EqualValues(identityset.Address(delegateIdx).String(), bt.Candidate.String()) }) - } func prepareContractStakingBlockchain(ctx context.Context, cfg config.Config, r *require.Assertions) (blockchain.Blockchain, factory.Factory, blockdao.BlockDAO, actpool.ActPool, *contractstaking.Indexer) { From 04d95d12bb1eee3d6628e1452c5073627016163e Mon Sep 17 00:00:00 2001 From: envestcc Date: Wed, 7 Jun 2023 12:20:24 +0800 Subject: [PATCH 6/7] update contract deployment on TestNet --- blockchain/genesis/genesis.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/blockchain/genesis/genesis.go b/blockchain/genesis/genesis.go index bc83aa397e..525e4b94de 100644 --- a/blockchain/genesis/genesis.go +++ b/blockchain/genesis/genesis.go @@ -84,8 +84,8 @@ func defaultConfig() Genesis { ProbationIntensityRate: 90, UnproductiveDelegateMaxCacheSize: 20, // TODO (iip-13): replace the following with the address and height on mainnet - SystemStakingContractAddress: "io14g76t4d03c27pa4lthv98207wwa6e3ptvhcsq5", - SystemStakingContractHeight: 20635347, + SystemStakingContractAddress: "io1224slckr49ryfhsg3z3m484pgsm89esl2nd4jh", + SystemStakingContractHeight: 20645456, }, Rewarding: Rewarding{ InitBalanceStr: unit.ConvertIotxToRau(200000000).String(), From ead5608c4194c2bc13d80ce944809c6bd59d116e Mon Sep 17 00:00:00 2001 From: envestcc Date: Thu, 8 Jun 2023 11:01:35 +0800 Subject: [PATCH 7/7] revert config --- blockchain/genesis/genesis.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/blockchain/genesis/genesis.go b/blockchain/genesis/genesis.go index 525e4b94de..eaca849e95 100644 --- a/blockchain/genesis/genesis.go +++ b/blockchain/genesis/genesis.go @@ -84,8 +84,8 @@ func defaultConfig() Genesis { ProbationIntensityRate: 90, UnproductiveDelegateMaxCacheSize: 20, // TODO (iip-13): replace the following with the address and height on mainnet - SystemStakingContractAddress: "io1224slckr49ryfhsg3z3m484pgsm89esl2nd4jh", - SystemStakingContractHeight: 20645456, + SystemStakingContractAddress: "io1uw3gvmhrjz5mwxpd966wxxt6fn5uuvwfpynrwj", + SystemStakingContractHeight: 20386536, }, Rewarding: Rewarding{ InitBalanceStr: unit.ConvertIotxToRau(200000000).String(),