From 13cca06be83d36b8e247762a3c8c864c93a6d7d9 Mon Sep 17 00:00:00 2001 From: HaoyangLiu Date: Thu, 6 Aug 2020 17:25:39 +0800 Subject: [PATCH] add beforeUpgrade and afterUpgrade --- .../system-contract-upgrade.go | 34 ++++++++++++++----- params/config.go | 5 +++ 2 files changed, 30 insertions(+), 9 deletions(-) diff --git a/core/systemcontractupgrade/system-contract-upgrade.go b/core/systemcontractupgrade/system-contract-upgrade.go index 731a46ec3..a866ed500 100644 --- a/core/systemcontractupgrade/system-contract-upgrade.go +++ b/core/systemcontractupgrade/system-contract-upgrade.go @@ -12,9 +12,11 @@ import ( ) type UpgradeConfig struct { - ContractAddr common.Address - CommitUrl string - Code string + BeforeUpgrade beforeUpgrade + AfterUpgrade afterUpgrade + ContractAddr common.Address + CommitUrl string + Code string } type Upgrade struct { @@ -22,6 +24,9 @@ type Upgrade struct { Configs []*UpgradeConfig } +type beforeUpgrade func(blockNumber *big.Int, contractAddr common.Address, statedb *state.StateDB) +type afterUpgrade func(blockNumber *big.Int, contractAddr common.Address, statedb *state.StateDB) + var ( // genesis contracts validatorContract = common.HexToAddress("0x0000000000000000000000000000000000001000") @@ -40,9 +45,11 @@ var ( UpgradeName: "ramanujan", Configs: []*UpgradeConfig{ { - ContractAddr: tokenHubContract, - CommitUrl: "https://github.com/binance-chain/bsc-genesis-contract/commit/24884da1038d6f3f4bfb3aa0d23be0fb3e3a0cb6", - Code: "6080604052600436106103035760003560e01c8063a1a11bf511610190578063c81b1662116100dc578063ebf71d5311610095578063fc1a598f1161006f578063fc1a598f14610db0578063fc3e590814610983578063fd6a687914610de3578063ff9c0027146107815761034b565b8063ebf71d5314610d71578063f014847214610d86578063f9a2bbc714610d9b5761034b565b8063c81b166214610c7a578063c8509d8114610c8f578063dab2181f14610d14578063dc6f5e9014610983578063dc927faf14610d47578063e1c7392a14610d5c5761034b565b8063ab51bb9611610149578063b770186111610123578063b770186114610be4578063b99328c514610bf9578063b9fd21e314610c32578063bd46646114610c475761034b565b8063ab51bb96146109de578063ac431751146109f3578063b26e139d14610abe5761034b565b8063a1a11bf514610911578063a496fba214610926578063a5cd588b1461093b578063a78abc161461096e578063a7c9f02d14610983578063aa7415f5146109985761034b565b80636e0565201161024f578063831d65d11161020857806396713da9116101e257806396713da9146108995780639a854bbd146108ae5780639a99b4f0146108c35780639dc09262146108fc5761034b565b8063831d65d1146107d55780638b87b21f146105975780638eff336c1461085a5761034b565b80636e056520146106415780636e47b4821461076c57806370fd5bad1461078157806371d308631461079657806375d47a0a146107ab5780637942fd05146107c05761034b565b806343756e5c116102bc57806350432d321161029657806350432d32146105ed57806351e806721461060257806359b927891461061757806361368475146103505761034b565b806343756e5c146105ac578063493279b1146105c15780634bf6c882146103505761034b565b8063077b8f35146103505780630bee7a671461037b5780631182b875146103a9578063149d14d9146104a35780633d713223146104ca5780633dffc387146105975761034b565b3661034b573415610349576040805133815234602082015281517f6c98249d85d88c3753a04a22230f595e4dc8d3dc86c34af35deeeedc861b89db929181900390910190a15b005b600080fd5b34801561035c57600080fd5b50610365610df8565b6040805160ff9092168252519081900360200190f35b34801561038757600080fd5b50610390610dfd565b6040805163ffffffff9092168252519081900360200190f35b3480156103b557600080fd5b5061042e600480360360408110156103cc57600080fd5b60ff8235169190810190604081016020820135600160201b8111156103f057600080fd5b82018360208201111561040257600080fd5b803590602001918460018302840111600160201b8311171561042357600080fd5b509092509050610e02565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610468578181015183820152602001610450565b50505050905090810190601f1680156104955780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156104af57600080fd5b506104b8610f30565b60408051918252519081900360200190f35b3480156104d657600080fd5b5061057b600480360360208110156104ed57600080fd5b810190602081018135600160201b81111561050757600080fd5b82018360208201111561051957600080fd5b803590602001918460018302840111600160201b8311171561053a57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550610f36945050505050565b604080516001600160a01b039092168252519081900360200190f35b3480156105a357600080fd5b50610365610f5a565b3480156105b857600080fd5b5061057b610f5f565b3480156105cd57600080fd5b506105d6610f65565b6040805161ffff9092168252519081900360200190f35b3480156105f957600080fd5b506104b8610f6a565b34801561060e57600080fd5b5061057b610f75565b34801561062357600080fd5b5061057b6004803603602081101561063a57600080fd5b5035610f7b565b6107586004803603608081101561065757600080fd5b810190602081018135600160201b81111561067157600080fd5b82018360208201111561068357600080fd5b803590602001918460208302840111600160201b831117156106a457600080fd5b919390929091602081019035600160201b8111156106c157600080fd5b8201836020820111156106d357600080fd5b803590602001918460208302840111600160201b831117156106f457600080fd5b919390929091602081019035600160201b81111561071157600080fd5b82018360208201111561072357600080fd5b803590602001918460208302840111600160201b8311171561074457600080fd5b9193509150356001600160401b0316610f96565b604080519115158252519081900360200190f35b34801561077857600080fd5b5061057b61147c565b34801561078d57600080fd5b50610365611482565b3480156107a257600080fd5b506104b8611487565b3480156107b757600080fd5b5061057b61148d565b3480156107cc57600080fd5b50610365611493565b3480156107e157600080fd5b50610349600480360360408110156107f857600080fd5b60ff8235169190810190604081016020820135600160201b81111561081c57600080fd5b82018360208201111561082e57600080fd5b803590602001918460018302840111600160201b8311171561084f57600080fd5b509092509050611498565b34801561086657600080fd5b506103496004803603606081101561087d57600080fd5b508035906001600160a01b0360208201351690604001356115e1565b3480156108a557600080fd5b50610365611667565b3480156108ba57600080fd5b506104b861166c565b3480156108cf57600080fd5b506104b8600480360360408110156108e657600080fd5b506001600160a01b038135169060200135611678565b34801561090857600080fd5b5061057b61179c565b34801561091d57600080fd5b5061057b6117a2565b34801561093257600080fd5b506103656117a8565b34801561094757600080fd5b506104b86004803603602081101561095e57600080fd5b50356001600160a01b03166117ad565b34801561097a57600080fd5b506107586117bf565b34801561098f57600080fd5b506103656117c8565b610758600480360360808110156109ae57600080fd5b5080356001600160a01b0390811691602081013590911690604081013590606001356001600160401b03166117cd565b3480156109ea57600080fd5b506103906117a8565b3480156109ff57600080fd5b5061034960048036036040811015610a1657600080fd5b810190602081018135600160201b811115610a3057600080fd5b820183602082011115610a4257600080fd5b803590602001918460018302840111600160201b83111715610a6357600080fd5b919390929091602081019035600160201b811115610a8057600080fd5b820183602082011115610a9257600080fd5b803590602001918460018302840111600160201b83111715610ab357600080fd5b509092509050611e9f565b610758600480360360a0811015610ad457600080fd5b810190602081018135600160201b811115610aee57600080fd5b820183602082011115610b0057600080fd5b803590602001918460208302840111600160201b83111715610b2157600080fd5b919390929091602081019035600160201b811115610b3e57600080fd5b820183602082011115610b5057600080fd5b803590602001918460208302840111600160201b83111715610b7157600080fd5b919390929091602081019035600160201b811115610b8e57600080fd5b820183602082011115610ba057600080fd5b803590602001918460208302840111600160201b83111715610bc157600080fd5b919350915080356001600160a01b031690602001356001600160401b031661210e565b348015610bf057600080fd5b506104b8612901565b348015610c0557600080fd5b5061034960048036036040811015610c1c57600080fd5b50803590602001356001600160a01b0316612907565b348015610c3e57600080fd5b506104b861297d565b348015610c5357600080fd5b506104b860048036036020811015610c6a57600080fd5b50356001600160a01b0316612987565b348015610c8657600080fd5b5061057b6129a2565b348015610c9b57600080fd5b5061034960048036036040811015610cb257600080fd5b60ff8235169190810190604081016020820135600160201b811115610cd657600080fd5b820183602082011115610ce857600080fd5b803590602001918460018302840111600160201b83111715610d0957600080fd5b5090925090506129a8565b348015610d2057600080fd5b506104b860048036036020811015610d3757600080fd5b50356001600160a01b0316612a78565b348015610d5357600080fd5b5061057b612a93565b348015610d6857600080fd5b50610349612a99565b348015610d7d57600080fd5b50610365612b39565b348015610d9257600080fd5b50610365612b3e565b348015610da757600080fd5b5061057b612b43565b348015610dbc57600080fd5b5061042e60048036036020811015610dd357600080fd5b50356001600160a01b0316612b49565b348015610def57600080fd5b5061057b612c70565b600881565b606481565b60005460609060ff16610e4a576040805162461bcd60e51b81526020600482015260196024820152600080516020614f88833981519152604482015290519081900360640190fd5b3361200014610e8a5760405162461bcd60e51b815260040180806020018281038252602f815260200180614f36602f913960400191505060405180910390fd5b60ff841660021415610edc57610ed583838080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250612c7692505050565b9050610f29565b6040805162461bcd60e51b815260206004820152601860248201527f756e7265636f676e697a65642073796e207061636b6167650000000000000000604482015290519081900360640190fd5b9392505050565b60015490565b6020818101516000908152600490915260409020546001600160a01b03165b919050565b600181565b61100181565b606081565b662386f26fc1000081565b61200081565b6000908152600460205260409020546001600160a01b031690565b6000805460ff16610fdc576040805162461bcd60e51b81526020600482015260196024820152600080516020614f88833981519152604482015290519081900360640190fd5b86851461101a5760405162461bcd60e51b815260040180806020018281038252603b815260200180614efb603b913960400191505060405180910390fd5b8683146110585760405162461bcd60e51b815260040180806020018281038252603f815260200180614d9e603f913960400191505060405180910390fd5b42607801826001600160401b031610156110a35760405162461bcd60e51b8152600401808060200182810382526024815260200180614c8e6024913960400191505060405180910390fd5b6402540be4003406156110e75760405162461bcd60e51b8152600401808060200182810382526040815260200180614ffe6040913960400191505060405180910390fd5b6040805186815260208088028201019091528590600090819060609084801561111a578160200160208202803683370190505b50905060005b848110156111f5576402540be4008b8b8381811061113a57fe5b905060200201358161114857fe5b06156111855760405162461bcd60e51b815260040180806020018281038252603c815260200180614e0d603c913960400191505060405180910390fd5b6111aa8b8b8381811061119457fe5b9050602002013585612d9a90919063ffffffff16565b93506111d66402540be4008c8c848181106111c157fe5b90506020020135612df490919063ffffffff16565b8282815181106111e257fe5b6020908102919091010152600101611120565b5060015461121a9061120d908663ffffffff612e3616565b849063ffffffff612d9a16565b3410156112585760405162461bcd60e51b8152600401808060200182810382526056815260200180614fa86056913960600191505060405180910390fd5b611268348463ffffffff612e8f16565b9150611272614ae8565b6040518060c001604052806221272160e91b60001b815260200160006001600160a01b031681526020018381526020018e8e808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152505050908252506040805160208c810282810182019093528c82529283019290918d918d9182918501908490808284376000920191909152505050908252506001600160401b038916602090910152905061200063f7a251d7600361133584612ed1565b61134a876402540be40063ffffffff612df416565b6040518463ffffffff1660e01b8152600401808460ff1660ff16815260200180602001838152602001828103825284818151815260200191508051906020019080838360005b838110156113a8578181015183820152602001611390565b50505050905090810190601f1680156113d55780820380516001836020036101000a031916815260200191505b50945050505050602060405180830381600087803b1580156113f657600080fd5b505af115801561140a573d6000803e3d6000fd5b505050506040513d602081101561142057600080fd5b505060408051600081523360208201528082018690526060810185905290517f74eab09b0e53aefc23f2e1b16da593f95c2dd49c6f5a23720463d10d9c330b2a9181900360800190a15060019c9b505050505050505050505050565b61100581565b600281565b60015481565b61100881565b600b81565b60005460ff166114dd576040805162461bcd60e51b81526020600482015260196024820152600080516020614f88833981519152604482015290519081900360640190fd5b336120001461151d5760405162461bcd60e51b815260040180806020018281038252602f815260200180614f36602f913960400191505060405180910390fd5b60ff83166003141561156d5761156882828080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061318b92505050565b6115dc565b7f41ce201247b6ceb957dcdb217d0b8acb50b9ea0e12af9af4f5e7f38902101605838383604051808460ff1660ff168152602001806020018281038252848482818152602001925080828437600083820152604051601f909101601f1916909201829003965090945050505050a15b505050565b33611008146116215760405162461bcd60e51b8152600401808060200182810382526023815260200180614f656023913960400191505060405180910390fd5b600083815260046020908152604080832080546001600160a01b039096166001600160a01b03199096168617905593825260038152838220949094556002909352912055565b600981565b677ce66c50e284000081565b6000805460ff166116be576040805162461bcd60e51b81526020600482015260196024820152600080516020614f88833981519152604482015290519081900360640190fd5b33611005146116fe5760405162461bcd60e51b815260040180806020018281038252602f815260200180614c01602f913960400191505060405180910390fd5b600047831061170d574761170f565b825b90508015611793576040516001600160a01b0385169082156108fc029083906000818181858888f1935050505015801561174d573d6000803e3d6000fd5b50604080516001600160a01b03861681526020810183905281517ff8b71c64315fc33b2ead2adfa487955065152a8ac33d9d5193aafd7f45dc15a0929181900390910190a15b90505b92915050565b61100781565b61100681565b600081565b60026020526000908152604090205481565b60005460ff1681565b600381565b6000805460ff16611813576040805162461bcd60e51b81526020600482015260196024820152600080516020614f88833981519152604482015290519081900360640190fd5b42607801826001600160401b0316101561185e5760405162461bcd60e51b8152600401808060200182810382526024815260200180614c8e6024913960400191505060405180910390fd5b6402540be4003406156118a25760405162461bcd60e51b8152600401808060200182810382526040815260200180614ffe6040913960400191505060405180910390fd5b600080806001600160a01b038816611981576001546118c890879063ffffffff612d9a16565b3410156119065760405162461bcd60e51b8152600401808060200182810382526061815260200180614d186061913960800191505060405180910390fd5b6402540be40086061561194a5760405162461bcd60e51b815260040180806020018281038252603c815260200180614e0d603c913960400191505060405180910390fd5b61195a348763ffffffff612e8f16565b9050611971866402540be40063ffffffff612df416565b6221272160e91b93509150611c24565b6001600160a01b0388166000908152600360205260409020549250826119d85760405162461bcd60e51b8152600401808060200182810382526031815260200180614ce76031913960400191505060405180910390fd5b600154341015611a195760405162461bcd60e51b815260040180806020018281038252603f815260200180614e6a603f913960400191505060405180910390fd5b506001600160a01b0387166000908152600260205260409020543490600881111580611a645750600881118015611a645750611a62876007198301600a0a63ffffffff6131e716565b155b611a9f5760405162461bcd60e51b815260040180806020018281038252603c815260200180614e0d603c913960400191505060405180910390fd5b611aa98782613229565b9250611ab484613269565b15611afc576305f5e100831015611afc5760405162461bcd60e51b815260040180806020018281038252603a815260200180614c30603a913960400191505060405180910390fd5b600881101580611b165750600881108015611b1657508683115b611b515760405162461bcd60e51b8152600401808060200182810382526025815260200180614d796025913960400191505060405180910390fd5b677ce66c50e2840000831115611b985760405162461bcd60e51b8152600401808060200182810382526035815260200180614cb26035913960400191505060405180910390fd5b604080516323b872dd60e01b81523360048201523060248201526044810189905290516001600160a01b038b16916323b872dd9160648083019260209291908290030181600087803b158015611bed57600080fd5b505af1158015611c01573d6000803e3d6000fd5b505050506040513d6020811015611c1757600080fd5b5051611c2257600080fd5b505b611c2c614ae8565b6040805160c0810182528581526001600160a01b038b16602082015281516001808252818401845291928301918160200160208202803683375050508152604080516001808252818301909252602092830192909190808301908036833750505081526040805160018082528183019092526020928301929091908083019080368337019050508152602001876001600160401b03168152509050828160400151600081518110611cd957fe5b602002602001018181525050878160600151600081518110611cf757fe5b60200260200101906001600160a01b031690816001600160a01b031681525050338160800151600081518110611d2957fe5b6001600160a01b039092166020928302919091019091015261200063f7a251d76003611d5484612ed1565b611d69866402540be40063ffffffff612df416565b6040518463ffffffff1660e01b8152600401808460ff1660ff16815260200180602001838152602001828103825284818151815260200191508051906020019080838360005b83811015611dc7578181015183820152602001611daf565b50505050905090810190601f168015611df45780820380516001836020036101000a031916815260200191505b50945050505050602060405180830381600087803b158015611e1557600080fd5b505af1158015611e29573d6000803e3d6000fd5b505050506040513d6020811015611e3f57600080fd5b5050604080516001600160a01b038b1681523360208201528082018990526060810184905290517f74eab09b0e53aefc23f2e1b16da593f95c2dd49c6f5a23720463d10d9c330b2a9181900360800190a150600198975050505050505050565b3361100714611edf5760405162461bcd60e51b815260040180806020018281038252602e815260200180614ea9602e913960400191505060405180910390fd5b60208114611f34576040805162461bcd60e51b815260206004820152601b60248201527f65787065637465642076616c7565206c656e6774682069732033320000000000604482015290519081900360640190fd5b606084848080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050604080516020601f8801819004810282018101909252868152939450606093925086915085908190840183828082843760009201919091525050505060208301519091506772656c617946656560c01b81141561203c576020820151670de0b6b3a76400008111158015611fe357506402540be4008106155b612034576040805162461bcd60e51b815260206004820152601960248201527f7468652072656c6179466565206f7574206f662072616e676500000000000000604482015290519081900360640190fd5b600155612079565b6040805162461bcd60e51b815260206004820152600d60248201526c756e6b6e6f776e20706172616d60981b604482015290519081900360640190fd5b7f6cdb0ac70ab7f2e2d035cca5be60d89906f2dede7648ddbd7402189c1eeed17a878787876040518080602001806020018381038352878782818152602001925080828437600083820152601f01601f191690910184810383528581526020019050858580828437600083820152604051601f909101601f19169092018290039850909650505050505050a150505050505050565b6000805460ff16612154576040805162461bcd60e51b81526020600482015260196024820152600080516020614f88833981519152604482015290519081900360640190fd5b8786146121925760405162461bcd60e51b815260040180806020018281038252603b815260200180614efb603b913960400191505060405180910390fd5b8784146121d05760405162461bcd60e51b815260040180806020018281038252603f815260200180614d9e603f913960400191505060405180910390fd5b42607801826001600160401b0316101561221b5760405162461bcd60e51b8152600401808060200182810382526024815260200180614c8e6024913960400191505060405180910390fd5b6402540be40034061561225f5760405162461bcd60e51b8152600401808060200182810382526040815260200180614ffe6040913960400191505060405180910390fd5b856000805b8281101561229b576122918a8a8381811061227b57fe5b9050602002013583612d9a90919063ffffffff16565b9150600101612264565b50604080518981526020808b028201019091526060908980156122c8578160200160208202803683370190505b5090506000806001600160a01b03881661241d5760005b858160ff16101561239a576402540be4008d8d8360ff168181106122ff57fe5b905060200201358161230d57fe5b0615612360576040805162461bcd60e51b815260206004820152601760248201527f696e76616c6964207472616e7366657220616d6f756e74000000000000000000604482015290519081900360640190fd5b6123786402540be4008e8e8460ff168181106111c157fe5b848260ff168151811061238757fe5b60209081029190910101526001016122df565b506001546123bf906123b2908763ffffffff612e3616565b859063ffffffff612d9a16565b3410156123fd5760405162461bcd60e51b8152600401808060200182810382526056815260200180614fa86056913960600191505060405180910390fd5b61240d348563ffffffff612e8f16565b6221272160e91b925090506126e6565b6001600160a01b038816600090815260026020526040812054905b868110156125ae57600882111580612484575060088211801561248457506124826007198301600a0a8f8f8481811061246d57fe5b905060200201356131e790919063ffffffff16565b155b6124bf5760405162461bcd60e51b815260040180806020018281038252603c815260200180614e0d603c913960400191505060405180910390fd5b60006124dd8f8f848181106124d057fe5b9050602002013584613229565b905060088310158061250b575060088310801561250b57508e8e8381811061250157fe5b9050602002013581115b6125465760405162461bcd60e51b8152600401808060200182810382526025815260200180614d796025913960400191505060405180910390fd5b677ce66c50e284000081111561258d5760405162461bcd60e51b8152600401808060200182810382526035815260200180614cb26035913960400191505060405180910390fd5b8086838151811061259a57fe5b602090810291909101015250600101612438565b506001546125c2908763ffffffff612e3616565b3410156126005760405162461bcd60e51b815260040180806020018281038252604381526020018061503e6043913960600191505060405180910390fd5b6001600160a01b03891660009081526003602052604090205492503491508261265a5760405162461bcd60e51b8152600401808060200182810382526030815260200180614ddd6030913960400191505060405180910390fd5b604080516323b872dd60e01b81523360048201523060248201526044810187905290516001600160a01b038b16916323b872dd9160648083019260209291908290030181600087803b1580156126af57600080fd5b505af11580156126c3573d6000803e3d6000fd5b505050506040513d60208110156126d957600080fd5b50516126e457600080fd5b505b60608e8e808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509293506127289250614ae8915050565b6040518060c001604052808581526020018b6001600160a01b031681526020018681526020018381526020018d8d808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152505050908252506001600160401b038b16602090910152905061200063f7a251d760036127af84612ed1565b6127c4876402540be40063ffffffff612df416565b6040518463ffffffff1660e01b8152600401808460ff1660ff16815260200180602001838152602001828103825284818151815260200191508051906020019080838360005b8381101561282257818101518382015260200161280a565b50505050905090810190601f16801561284f5780820380516001836020036101000a031916815260200191505b50945050505050602060405180830381600087803b15801561287057600080fd5b505af1158015612884573d6000803e3d6000fd5b505050506040513d602081101561289a57600080fd5b5050604080516001600160a01b038c1681523360208201528082018890526060810185905290517f74eab09b0e53aefc23f2e1b16da593f95c2dd49c6f5a23720463d10d9c330b2a9181900360800190a15060019f9e505050505050505050505050505050565b61c35081565b33611008146129475760405162461bcd60e51b8152600401808060200182810382526023815260200180614f656023913960400191505060405180910390fd5b600091825260046020908152604080842080546001600160a01b03191690556001600160a01b0392909216835260039052812055565b6221272160e91b81565b6001600160a01b031660009081526003602052604090205490565b61100281565b60005460ff166129ed576040805162461bcd60e51b81526020600482015260196024820152600080516020614f88833981519152604482015290519081900360640190fd5b3361200014612a2d5760405162461bcd60e51b815260040180806020018281038252602f815260200180614f36602f913960400191505060405180910390fd5b60ff83166003141561156d5761156882828080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061336f92505050565b6001600160a01b031660009081526002602052604090205490565b61100381565b60005460ff1615612af1576040805162461bcd60e51b815260206004820152601960248201527f74686520636f6e747261637420616c726561647920696e697400000000000000604482015290519081900360640190fd5b662386f26fc1000060019081556000808052600260205260127fac33ff75c19e70fe83507db0d683fd3465c996598dc972688b7ace676c89077b55805460ff19169091179055565b600481565b600581565b61100081565b6001600160a01b03811660009081526003602090815260409182902054825182815280840190935260609290918391906020820181803683375050506020810183905290506000805b60208160ff161015612bd957828160ff1681518110612bad57fe5b01602001516001600160f81b03191615612bcc57600190910190612bd1565b612bd9565b600101612b92565b5060608160ff166040519080825280601f01601f191660200182016040528015612c0a576020820181803683370190505b50905060005b8260ff168160ff161015612c6657838160ff1681518110612c2d57fe5b602001015160f81c60f81b828260ff1681518110612c4757fe5b60200101906001600160f81b031916908160001a905350600101612c10565b5095945050505050565b61100481565b6060612c80614b33565b6000612c8b8461346d565b9150915080612ce1576040805162461bcd60e51b815260206004820152601f60248201527f756e7265636f676e697a6564207472616e73666572496e207061636b61676500604482015290519081900360640190fd5b6000612cec836135ab565b905063ffffffff811615612d80576040808401516020808601516001600160a01b03166000908152600290915291822054612d279190613229565b9050612d31614b68565b60405180608001604052808660000151815260200183815260200186608001516001600160a01b031681526020018463ffffffff168152509050612d74816138c1565b95505050505050610f55565b50506040805160008152602081019091529150610f559050565b600082820183811015611793576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b600061179383836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061399d565b600082612e4557506000611796565b82820282848281612e5257fe5b04146117935760405162461bcd60e51b8152600401808060200182810382526021815260200180614e496021913960400191505060405180910390fd5b600061179383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250613a3f565b60408051600680825260e08201909252606091829190816020015b6060815260200190600190039081612eec5750508351909150612f0e90613a99565b81600081518110612f1b57fe5b6020026020010181905250612f3c83602001516001600160a01b0316613aac565b81600181518110612f4957fe5b602002602001018190525060008360400151519050606081604051908082528060200260200182016040528015612f9457816020015b6060815260200190600190039081612f7f5790505b50905060005b82811015612fe157612fc286604001518281518110612fb557fe5b6020026020010151613a99565b828281518110612fce57fe5b6020908102919091010152600101612f9a565b50612feb81613acf565b83600281518110612ff857fe5b602002602001018190525060608260405190808252806020026020018201604052801561303957816020015b60608152602001906001900390816130245790505b50905060005b8381101561308f576130708760600151828151811061305a57fe5b60200260200101516001600160a01b0316613aac565b82828151811061307c57fe5b602090810291909101015260010161303f565b5061309981613acf565b846003815181106130a657fe5b60200260200101819052506060836040519080825280602002602001820160405280156130e757816020015b60608152602001906001900390816130d25790505b50905060005b84811015613127576131088860800151828151811061305a57fe5b82828151811061311457fe5b60209081029190910101526001016130ed565b5061313181613acf565b8560048151811061313e57fe5b602002602001018190525061315f8760a001516001600160401b0316613a99565b8560058151811061316c57fe5b602002602001018190525061318085613acf565b979650505050505050565b613193614b8f565b600061319e83613b59565b91509150806131de5760405162461bcd60e51b8152600401808060200182810382526024815260200180614ed76024913960400191505060405180910390fd5b6115dc82613d24565b600061179383836040518060400160405280601881526020017f536166654d6174683a206d6f64756c6f206279207a65726f0000000000000000815250614175565b600060088211156132525761324b836007198401600a0a63ffffffff612df416565b9050611796565b611793836008849003600a0a63ffffffff612e3616565b604080516020808252818301909252600091606091906020820181803683375050506020810184905290506000805b60208160ff1610156132df57828160ff16815181106132b357fe5b01602001516001600160f81b031916156132d2576001909101906132d7565b6132df565b600101613298565b50600860ff821610156132f757600092505050610f55565b816005820360ff168151811061330957fe5b6020910101516001600160f81b031916602d60f81b1461332e57600092505050610f55565b816001820360ff168151811061334057fe5b6020910101516001600160f81b031916604d60f81b1461336557600092505050610f55565b5060019392505050565b613377614ae8565b6000613382836141d7565b91509150806133c25760405162461bcd60e51b8152600401808060200182810382526024815260200180614c6a6024913960400191505060405180910390fd5b6133ca614b8f565b602080840180516001600160a01b0390811684526040808701518585015291511660009081526002909252812054905b84604001515181101561344b576134288560400151828151811061341a57fe5b602002602001015183614451565b8560400151828151811061343857fe5b60209081029190910101526001016133fa565b50608084015160408301526005606083015261346682613d24565b5050505050565b613475614b33565b600061347f614b33565b613487614bc6565b6134986134938661448a565b6144af565b90506000805b6134a7836144f9565b1561359e57806134c9576134c26134bd8461451a565b614568565b8452613596565b80600114156134f6576134e36134de8461451a565b6145c8565b6001600160a01b03166020850152613596565b80600214156135155761350b6134bd8461451a565b6040850152613596565b806003141561353d5761352a6134de8461451a565b6001600160a01b03166060850152613596565b8060041415613565576135526134de8461451a565b6001600160a01b03166080850152613596565b80600514156135915761357a6134bd8461451a565b6001600160401b031660a085015260019150613596565b61359e565b60010161349e565b5091935090915050915091565b60208101516000906001600160a01b03166136ac578160a001516001600160401b03164211156135dd57506001610f55565b81604001514710156135f157506003610f55565b81606001516001600160a01b03166108fc83604001519081150290604051600060405180830381858888f1935050505061362d57506004610f55565b7f471eb9cc1ffe55ffadf15b32595415eb9d80f22e761d24bd6dffc607e1284d5982602001518360600151846040015160405180846001600160a01b03166001600160a01b03168152602001836001600160a01b03166001600160a01b03168152602001828152602001935050505060405180910390a1506000610f55565b8160a001516001600160401b03164211156136c957506001610f55565b81516020808401516001600160a01b0316600090815260039091526040902054146136f657506002610f55565b602080830151604080516370a0823160e01b815230600482015290516000936001600160a01b03909316926370a082319261c3509260248083019392829003018187803b15801561374657600080fd5b5086fa15801561375a573d6000803e3d6000fd5b50505050506040513d602081101561377157600080fd5b5051604084015190915081101561378c575060039050610f55565b600083602001516001600160a01b031663a9059cbb61c350866060015187604001516040518463ffffffff1660e01b815260040180836001600160a01b03166001600160a01b0316815260200182815260200192505050602060405180830381600088803b1580156137fd57600080fd5b5087f1158015613811573d6000803e3d6000fd5b50505050506040513d602081101561382857600080fd5b5051905080156138b5577f471eb9cc1ffe55ffadf15b32595415eb9d80f22e761d24bd6dffc607e1284d5984602001518560600151866040015160405180846001600160a01b03166001600160a01b03168152602001836001600160a01b03166001600160a01b03168152602001828152602001935050505060405180910390a15060009150610f559050565b5060059150610f559050565b60408051600480825260a08201909252606091829190816020015b60608152602001906001900390816138dc57505083519091506138fe90613a99565b8160008151811061390b57fe5b60200260200101819052506139238360200151613a99565b8160018151811061393057fe5b602002602001018190525061395183604001516001600160a01b0316613aac565b8160028151811061395e57fe5b602002602001018190525061397c836060015163ffffffff16613a99565b8160038151811061398957fe5b6020026020010181905250610f2981613acf565b60008183613a295760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b838110156139ee5781810151838201526020016139d6565b50505050905090810190601f168015613a1b5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838581613a3557fe5b0495945050505050565b60008184841115613a915760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156139ee5781810151838201526020016139d6565b505050900390565b6060611796613aa7836145e2565b6146c8565b60408051600560a21b8318601482015260348101909152606090610f29816146c8565b6060815160001415613af05750604080516000815260208101909152610f55565b606082600081518110613aff57fe5b602002602001015190506000600190505b8351811015613b4057613b3682858381518110613b2957fe5b602002602001015161471a565b9150600101613b10565b50610f29613b53825160c060ff16614797565b8261471a565b613b61614b8f565b6000613b6b614b8f565b613b73614bc6565b613b7f6134938661448a565b90506000805b613b8e836144f9565b1561359e5780613bb457613ba46134de8461451a565b6001600160a01b03168452613d1c565b8060011415613c55576060613bd0613bcb8561451a565b61488f565b90508051604051908082528060200260200182016040528015613bfd578160200160208202803683370190505b50602086015260005b8151811015613c4e57613c2b828281518110613c1e57fe5b6020026020010151614568565b86602001518281518110613c3b57fe5b6020908102919091010152600101613c06565b5050613d1c565b8060021415613cf7576060613c6c613bcb8561451a565b90508051604051908082528060200260200182016040528015613c99578160200160208202803683370190505b50604086015260005b8151811015613c4e57613cc7828281518110613cba57fe5b60200260200101516145c8565b86604001518281518110613cd757fe5b6001600160a01b0390921660209283029190910190910152600101613ca2565b806003141561359157613d0c6134bd8461451a565b63ffffffff166060850152600191505b600101613b85565b80516001600160a01b0316613f1b5760005b816020015151811015613f155781604001518181518110613d5357fe5b60200260200101516001600160a01b03166108fc83602001518381518110613d7757fe5b60200260200101519081150290604051600060405180830381858888f19350505050613e57577f203f9f67a785f4f81be4d48b109aa0c498d1bc8097ecc2627063f480cc5fe73e826000015183604001518381518110613dd357fe5b602002602001015184602001518481518110613deb57fe5b6020026020010151856060015160405180856001600160a01b03166001600160a01b03168152602001846001600160a01b03166001600160a01b031681526020018381526020018263ffffffff1663ffffffff16815260200194505050505060405180910390a1613f0d565b7fd468d4fa5e8fb4adc119b29a983fd0785e04af5cb8b7a3a69a47270c54b6901a826000015183604001518381518110613e8d57fe5b602002602001015184602001518481518110613ea557fe5b6020026020010151856060015160405180856001600160a01b03166001600160a01b03168152602001846001600160a01b03166001600160a01b031681526020018381526020018263ffffffff1663ffffffff16815260200194505050505060405180910390a15b600101613d36565b50614172565b60005b81602001515181101561417057600082600001516001600160a01b031663a9059cbb61c35085604001518581518110613f5357fe5b602002602001015186602001518681518110613f6b57fe5b60200260200101516040518463ffffffff1660e01b815260040180836001600160a01b03166001600160a01b0316815260200182815260200192505050602060405180830381600088803b158015613fc257600080fd5b5087f1158015613fd6573d6000803e3d6000fd5b50505050506040513d6020811015613fed57600080fd5b5051905080156140b1577fd468d4fa5e8fb4adc119b29a983fd0785e04af5cb8b7a3a69a47270c54b6901a83600001518460400151848151811061402d57fe5b60200260200101518560200151858151811061404557fe5b6020026020010151866060015160405180856001600160a01b03166001600160a01b03168152602001846001600160a01b03166001600160a01b031681526020018381526020018263ffffffff1663ffffffff16815260200194505050505060405180910390a1614167565b7f203f9f67a785f4f81be4d48b109aa0c498d1bc8097ecc2627063f480cc5fe73e8360000151846040015184815181106140e757fe5b6020026020010151856020015185815181106140ff57fe5b6020026020010151866060015160405180856001600160a01b03166001600160a01b03168152602001846001600160a01b03166001600160a01b031681526020018381526020018263ffffffff1663ffffffff16815260200194505050505060405180910390a15b50600101613f1e565b505b50565b600081836141c45760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156139ee5781810151838201526020016139d6565b508284816141ce57fe5b06949350505050565b6141df614ae8565b60006141e9614ae8565b6141f1614bc6565b6141fd6134938661448a565b90506000805b61420c836144f9565b156144435780614229576142226134bd8461451a565b845261443b565b80600114156142515761423e6134de8461451a565b6001600160a01b0316602085015261443b565b80600214156142e0576060614268613bcb8561451a565b90508051604051908082528060200260200182016040528015614295578160200160208202803683370190505b50604086015260005b81518110156142d9576142b6828281518110613c1e57fe5b866040015182815181106142c657fe5b602090810291909101015260010161429e565b505061443b565b80600314156143755760606142f7613bcb8561451a565b90508051604051908082528060200260200182016040528015614324578160200160208202803683370190505b50606086015260005b81518110156142d957614345828281518110613cba57fe5b8660600151828151811061435557fe5b6001600160a01b039092166020928302919091019091015260010161432d565b806004141561440a57606061438c613bcb8561451a565b905080516040519080825280602002602001820160405280156143b9578160200160208202803683370190505b50608086015260005b81518110156142d9576143da828281518110613cba57fe5b866080015182815181106143ea57fe5b6001600160a01b03909216602092830291909101909101526001016143c2565b80600514156144365761441f6134bd8461451a565b6001600160401b031660a08501526001915061443b565b614443565b600101614203565b509195600195509350505050565b600060088211156144735761324b836007198401600a0a63ffffffff612e3616565b611793836008849003600a0a63ffffffff612df416565b614492614be6565b506040805180820190915281518152602082810190820152919050565b6144b7614bc6565b6144c082614960565b6144c957600080fd5b60006144d88360200151614990565b60208085015160408051808201909152868152920190820152915050919050565b6000614503614be6565b505080518051602091820151919092015191011190565b614522614be6565b61452b826144f9565b61453457600080fd5b60208201516000614544826149f3565b80830160209586015260408051808201909152908152938401919091525090919050565b80516000901580159061457d57508151602110155b61458657600080fd5b60006145958360200151614990565b835160208086015183018051939450918490039291908310156145bf57826020036101000a820491505b50949350505050565b80516000906015146145d957600080fd5b61179682614568565b604080516020808252818301909252606091829190602082018180368337505050602081018490529050600067ffffffffffffffff1984166146265750601861464a565b6fffffffffffffffffffffffffffffffff1984166146465750601061464a565b5060005b60208110156146805781818151811061465f57fe5b01602001516001600160f81b0319161561467857614680565b60010161464a565b60008160200390506060816040519080825280601f01601f1916602001820160405280156146b5576020820181803683370190505b5080830196909652508452509192915050565b6060815160011480156146fa5750607f60f81b826000815181106146e857fe5b01602001516001600160f81b03191611155b15614706575080610f55565b6117966147188351608060ff16614797565b835b6060806040519050835180825260208201818101602087015b8183101561474b578051835260209283019201614733565b50855184518101855292509050808201602086015b81831015614778578051835260209283019201614760565b508651929092011591909101601f01601f191660405250905092915050565b60606801000000000000000083106147e7576040805162461bcd60e51b815260206004820152600e60248201526d696e70757420746f6f206c6f6e6760901b604482015290519081900360640190fd5b604080516001808252818301909252606091602082018180368337019050509050603784116148415782840160f81b8160008151811061482357fe5b60200101906001600160f81b031916908160001a9053509050611796565b606061484c856145e2565b90508381510160370160f81b8260008151811061486557fe5b60200101906001600160f81b031916908160001a905350614886828261471a565b95945050505050565b606061489a82614960565b6148a357600080fd5b60006148ae83614a8c565b90506060816040519080825280602002602001820160405280156148ec57816020015b6148d9614be6565b8152602001906001900390816148d15790505b50905060006148fe8560200151614990565b60208601510190506000805b848110156149555761491b836149f3565b915060405180604001604052808381526020018481525084828151811061493e57fe5b60209081029190910101529181019160010161490a565b509195945050505050565b805160009061497157506000610f55565b6020820151805160001a9060c082101561336557600092505050610f55565b8051600090811a60808110156149aa576000915050610f55565b60b88110806149c5575060c081108015906149c5575060f881105b156149d4576001915050610f55565b60c08110156149e85760b519019050610f55565b60f519019050610f55565b80516000908190811a6080811015614a0e5760019150614a85565b60b8811015614a2357607e1981019150614a85565b60c0811015614a505760b78103600185019450806020036101000a85510460018201810193505050614a85565b60f8811015614a655760be1981019150614a85565b60f78103600185019450806020036101000a855104600182018101935050505b5092915050565b8051600090614a9d57506000610f55565b60008090506000614ab18460200151614990565b602085015185519181019250015b80821015614adf57614ad0826149f3565b60019093019290910190614abf565b50909392505050565b6040518060c001604052806000801916815260200160006001600160a01b0316815260200160608152602001606081526020016060815260200160006001600160401b031681525090565b6040805160c081018252600080825260208201819052918101829052606081018290526080810182905260a081019190915290565b60408051608081018252600080825260208201819052918101829052606081019190915290565b604051806080016040528060006001600160a01b031681526020016060815260200160608152602001600063ffffffff1681525090565b6040518060400160405280614bd9614be6565b8152602001600081525090565b60405180604001604052806000815260200160008152509056fe746865206d6573736167652073656e646572206d75737420626520696e63656e746976697a6520636f6e7472616374466f72206d696e69546f6b656e2c20746865207472616e7366657220616d6f756e74206d757374206e6f74206265206c657373207468616e2031756e7265636f676e697a6564207472616e736665724f75742073796e207061636b61676565787069726554696d65206d7573742062652074776f206d696e75746573206c61746572616d6f756e7420697320746f6f206c617267652c20657863656564206d6178696d756d206265703220746f6b656e20616d6f756e7474686520636f6e747261637420686173206e6f74206265656e20626f756e6420746f20616e79206265703220746f6b656e726563656976656420424e4220616d6f756e742073686f756c64206265206e6f206c657373207468616e207468652073756d206f66207472616e736665724f757420424e4220616d6f756e7420616e64206d696e696d756d2072656c6179466565616d6f756e7420697320746f6f206c617267652c2075696e74323536206f766572666c6f774c656e677468206f6620726563697069656e74416464727320646f65736e277420657175616c20746f206c656e677468206f6620726566756e64416464727374686520636f6e747261637420686173206e6f74206265656e2062696e6420746f20616e79206265703220746f6b656e696e76616c6964207472616e7366657220616d6f756e743a20707265636973696f6e206c6f737320696e20616d6f756e7420636f6e76657273696f6e536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77726563656976656420424e4220616d6f756e742073686f756c64206265206e6f206c657373207468616e20746865206d696e696d756d2072656c6179466565746865206d6573736167652073656e646572206d75737420626520676f7665726e616e636520636f6e7472616374756e7265636f676e697a6564207472616e736665724f75742061636b207061636b6167654c656e677468206f6620726563697069656e74416464727320646f65736e277420657175616c20746f206c656e677468206f6620616d6f756e7473746865206d6573736167652073656e646572206d7573742062652063726f737320636861696e20636f6e7472616374746865206d73672073656e646572206d75737420626520746f6b656e4d616e6167657274686520636f6e7472616374206e6f7420696e69742079657400000000000000726563656976656420424e4220616d6f756e742073686f756c64206265206e6f206c657373207468616e207468652073756d206f66207472616e7366657220424e4220616d6f756e7420616e642072656c6179466565696e76616c696420726563656976656420424e4220616d6f756e743a20707265636973696f6e206c6f737320696e20616d6f756e7420636f6e76657273696f6e726563656976656420424e4220616d6f756e742073686f756c64206265206e6f206c657373207468616e207468652072656c61794665652a62617463684c656e677468a2646970667358221220d1c73f520d8ef3e9a12aed51743c0ced82e8b8c6c19fe07a2210d126fa2a47fa64736f6c63430006040033", + BeforeUpgrade: nil, + AfterUpgrade: nil, + ContractAddr: tokenHubContract, + CommitUrl: "https://github.com/binance-chain/bsc-genesis-contract/commit/24884da1038d6f3f4bfb3aa0d23be0fb3e3a0cb6", + Code: "6080604052600436106103035760003560e01c8063a1a11bf511610190578063c81b1662116100dc578063ebf71d5311610095578063fc1a598f1161006f578063fc1a598f14610db0578063fc3e590814610983578063fd6a687914610de3578063ff9c0027146107815761034b565b8063ebf71d5314610d71578063f014847214610d86578063f9a2bbc714610d9b5761034b565b8063c81b166214610c7a578063c8509d8114610c8f578063dab2181f14610d14578063dc6f5e9014610983578063dc927faf14610d47578063e1c7392a14610d5c5761034b565b8063ab51bb9611610149578063b770186111610123578063b770186114610be4578063b99328c514610bf9578063b9fd21e314610c32578063bd46646114610c475761034b565b8063ab51bb96146109de578063ac431751146109f3578063b26e139d14610abe5761034b565b8063a1a11bf514610911578063a496fba214610926578063a5cd588b1461093b578063a78abc161461096e578063a7c9f02d14610983578063aa7415f5146109985761034b565b80636e0565201161024f578063831d65d11161020857806396713da9116101e257806396713da9146108995780639a854bbd146108ae5780639a99b4f0146108c35780639dc09262146108fc5761034b565b8063831d65d1146107d55780638b87b21f146105975780638eff336c1461085a5761034b565b80636e056520146106415780636e47b4821461076c57806370fd5bad1461078157806371d308631461079657806375d47a0a146107ab5780637942fd05146107c05761034b565b806343756e5c116102bc57806350432d321161029657806350432d32146105ed57806351e806721461060257806359b927891461061757806361368475146103505761034b565b806343756e5c146105ac578063493279b1146105c15780634bf6c882146103505761034b565b8063077b8f35146103505780630bee7a671461037b5780631182b875146103a9578063149d14d9146104a35780633d713223146104ca5780633dffc387146105975761034b565b3661034b573415610349576040805133815234602082015281517f6c98249d85d88c3753a04a22230f595e4dc8d3dc86c34af35deeeedc861b89db929181900390910190a15b005b600080fd5b34801561035c57600080fd5b50610365610df8565b6040805160ff9092168252519081900360200190f35b34801561038757600080fd5b50610390610dfd565b6040805163ffffffff9092168252519081900360200190f35b3480156103b557600080fd5b5061042e600480360360408110156103cc57600080fd5b60ff8235169190810190604081016020820135600160201b8111156103f057600080fd5b82018360208201111561040257600080fd5b803590602001918460018302840111600160201b8311171561042357600080fd5b509092509050610e02565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610468578181015183820152602001610450565b50505050905090810190601f1680156104955780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156104af57600080fd5b506104b8610f30565b60408051918252519081900360200190f35b3480156104d657600080fd5b5061057b600480360360208110156104ed57600080fd5b810190602081018135600160201b81111561050757600080fd5b82018360208201111561051957600080fd5b803590602001918460018302840111600160201b8311171561053a57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550610f36945050505050565b604080516001600160a01b039092168252519081900360200190f35b3480156105a357600080fd5b50610365610f5a565b3480156105b857600080fd5b5061057b610f5f565b3480156105cd57600080fd5b506105d6610f65565b6040805161ffff9092168252519081900360200190f35b3480156105f957600080fd5b506104b8610f6a565b34801561060e57600080fd5b5061057b610f75565b34801561062357600080fd5b5061057b6004803603602081101561063a57600080fd5b5035610f7b565b6107586004803603608081101561065757600080fd5b810190602081018135600160201b81111561067157600080fd5b82018360208201111561068357600080fd5b803590602001918460208302840111600160201b831117156106a457600080fd5b919390929091602081019035600160201b8111156106c157600080fd5b8201836020820111156106d357600080fd5b803590602001918460208302840111600160201b831117156106f457600080fd5b919390929091602081019035600160201b81111561071157600080fd5b82018360208201111561072357600080fd5b803590602001918460208302840111600160201b8311171561074457600080fd5b9193509150356001600160401b0316610f96565b604080519115158252519081900360200190f35b34801561077857600080fd5b5061057b61147c565b34801561078d57600080fd5b50610365611482565b3480156107a257600080fd5b506104b8611487565b3480156107b757600080fd5b5061057b61148d565b3480156107cc57600080fd5b50610365611493565b3480156107e157600080fd5b50610349600480360360408110156107f857600080fd5b60ff8235169190810190604081016020820135600160201b81111561081c57600080fd5b82018360208201111561082e57600080fd5b803590602001918460018302840111600160201b8311171561084f57600080fd5b509092509050611498565b34801561086657600080fd5b506103496004803603606081101561087d57600080fd5b508035906001600160a01b0360208201351690604001356115e1565b3480156108a557600080fd5b50610365611667565b3480156108ba57600080fd5b506104b861166c565b3480156108cf57600080fd5b506104b8600480360360408110156108e657600080fd5b506001600160a01b038135169060200135611678565b34801561090857600080fd5b5061057b61179c565b34801561091d57600080fd5b5061057b6117a2565b34801561093257600080fd5b506103656117a8565b34801561094757600080fd5b506104b86004803603602081101561095e57600080fd5b50356001600160a01b03166117ad565b34801561097a57600080fd5b506107586117bf565b34801561098f57600080fd5b506103656117c8565b610758600480360360808110156109ae57600080fd5b5080356001600160a01b0390811691602081013590911690604081013590606001356001600160401b03166117cd565b3480156109ea57600080fd5b506103906117a8565b3480156109ff57600080fd5b5061034960048036036040811015610a1657600080fd5b810190602081018135600160201b811115610a3057600080fd5b820183602082011115610a4257600080fd5b803590602001918460018302840111600160201b83111715610a6357600080fd5b919390929091602081019035600160201b811115610a8057600080fd5b820183602082011115610a9257600080fd5b803590602001918460018302840111600160201b83111715610ab357600080fd5b509092509050611e9f565b610758600480360360a0811015610ad457600080fd5b810190602081018135600160201b811115610aee57600080fd5b820183602082011115610b0057600080fd5b803590602001918460208302840111600160201b83111715610b2157600080fd5b919390929091602081019035600160201b811115610b3e57600080fd5b820183602082011115610b5057600080fd5b803590602001918460208302840111600160201b83111715610b7157600080fd5b919390929091602081019035600160201b811115610b8e57600080fd5b820183602082011115610ba057600080fd5b803590602001918460208302840111600160201b83111715610bc157600080fd5b919350915080356001600160a01b031690602001356001600160401b031661210e565b348015610bf057600080fd5b506104b8612901565b348015610c0557600080fd5b5061034960048036036040811015610c1c57600080fd5b50803590602001356001600160a01b0316612907565b348015610c3e57600080fd5b506104b861297d565b348015610c5357600080fd5b506104b860048036036020811015610c6a57600080fd5b50356001600160a01b0316612987565b348015610c8657600080fd5b5061057b6129a2565b348015610c9b57600080fd5b5061034960048036036040811015610cb257600080fd5b60ff8235169190810190604081016020820135600160201b811115610cd657600080fd5b820183602082011115610ce857600080fd5b803590602001918460018302840111600160201b83111715610d0957600080fd5b5090925090506129a8565b348015610d2057600080fd5b506104b860048036036020811015610d3757600080fd5b50356001600160a01b0316612a78565b348015610d5357600080fd5b5061057b612a93565b348015610d6857600080fd5b50610349612a99565b348015610d7d57600080fd5b50610365612b39565b348015610d9257600080fd5b50610365612b3e565b348015610da757600080fd5b5061057b612b43565b348015610dbc57600080fd5b5061042e60048036036020811015610dd357600080fd5b50356001600160a01b0316612b49565b348015610def57600080fd5b5061057b612c70565b600881565b606481565b60005460609060ff16610e4a576040805162461bcd60e51b81526020600482015260196024820152600080516020614f88833981519152604482015290519081900360640190fd5b3361200014610e8a5760405162461bcd60e51b815260040180806020018281038252602f815260200180614f36602f913960400191505060405180910390fd5b60ff841660021415610edc57610ed583838080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250612c7692505050565b9050610f29565b6040805162461bcd60e51b815260206004820152601860248201527f756e7265636f676e697a65642073796e207061636b6167650000000000000000604482015290519081900360640190fd5b9392505050565b60015490565b6020818101516000908152600490915260409020546001600160a01b03165b919050565b600181565b61100181565b606081565b662386f26fc1000081565b61200081565b6000908152600460205260409020546001600160a01b031690565b6000805460ff16610fdc576040805162461bcd60e51b81526020600482015260196024820152600080516020614f88833981519152604482015290519081900360640190fd5b86851461101a5760405162461bcd60e51b815260040180806020018281038252603b815260200180614efb603b913960400191505060405180910390fd5b8683146110585760405162461bcd60e51b815260040180806020018281038252603f815260200180614d9e603f913960400191505060405180910390fd5b42607801826001600160401b031610156110a35760405162461bcd60e51b8152600401808060200182810382526024815260200180614c8e6024913960400191505060405180910390fd5b6402540be4003406156110e75760405162461bcd60e51b8152600401808060200182810382526040815260200180614ffe6040913960400191505060405180910390fd5b6040805186815260208088028201019091528590600090819060609084801561111a578160200160208202803683370190505b50905060005b848110156111f5576402540be4008b8b8381811061113a57fe5b905060200201358161114857fe5b06156111855760405162461bcd60e51b815260040180806020018281038252603c815260200180614e0d603c913960400191505060405180910390fd5b6111aa8b8b8381811061119457fe5b9050602002013585612d9a90919063ffffffff16565b93506111d66402540be4008c8c848181106111c157fe5b90506020020135612df490919063ffffffff16565b8282815181106111e257fe5b6020908102919091010152600101611120565b5060015461121a9061120d908663ffffffff612e3616565b849063ffffffff612d9a16565b3410156112585760405162461bcd60e51b8152600401808060200182810382526056815260200180614fa86056913960600191505060405180910390fd5b611268348463ffffffff612e8f16565b9150611272614ae8565b6040518060c001604052806221272160e91b60001b815260200160006001600160a01b031681526020018381526020018e8e808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152505050908252506040805160208c810282810182019093528c82529283019290918d918d9182918501908490808284376000920191909152505050908252506001600160401b038916602090910152905061200063f7a251d7600361133584612ed1565b61134a876402540be40063ffffffff612df416565b6040518463ffffffff1660e01b8152600401808460ff1660ff16815260200180602001838152602001828103825284818151815260200191508051906020019080838360005b838110156113a8578181015183820152602001611390565b50505050905090810190601f1680156113d55780820380516001836020036101000a031916815260200191505b50945050505050602060405180830381600087803b1580156113f657600080fd5b505af115801561140a573d6000803e3d6000fd5b505050506040513d602081101561142057600080fd5b505060408051600081523360208201528082018690526060810185905290517f74eab09b0e53aefc23f2e1b16da593f95c2dd49c6f5a23720463d10d9c330b2a9181900360800190a15060019c9b505050505050505050505050565b61100581565b600281565b60015481565b61100881565b600b81565b60005460ff166114dd576040805162461bcd60e51b81526020600482015260196024820152600080516020614f88833981519152604482015290519081900360640190fd5b336120001461151d5760405162461bcd60e51b815260040180806020018281038252602f815260200180614f36602f913960400191505060405180910390fd5b60ff83166003141561156d5761156882828080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061318b92505050565b6115dc565b7f41ce201247b6ceb957dcdb217d0b8acb50b9ea0e12af9af4f5e7f38902101605838383604051808460ff1660ff168152602001806020018281038252848482818152602001925080828437600083820152604051601f909101601f1916909201829003965090945050505050a15b505050565b33611008146116215760405162461bcd60e51b8152600401808060200182810382526023815260200180614f656023913960400191505060405180910390fd5b600083815260046020908152604080832080546001600160a01b039096166001600160a01b03199096168617905593825260038152838220949094556002909352912055565b600981565b677ce66c50e284000081565b6000805460ff166116be576040805162461bcd60e51b81526020600482015260196024820152600080516020614f88833981519152604482015290519081900360640190fd5b33611005146116fe5760405162461bcd60e51b815260040180806020018281038252602f815260200180614c01602f913960400191505060405180910390fd5b600047831061170d574761170f565b825b90508015611793576040516001600160a01b0385169082156108fc029083906000818181858888f1935050505015801561174d573d6000803e3d6000fd5b50604080516001600160a01b03861681526020810183905281517ff8b71c64315fc33b2ead2adfa487955065152a8ac33d9d5193aafd7f45dc15a0929181900390910190a15b90505b92915050565b61100781565b61100681565b600081565b60026020526000908152604090205481565b60005460ff1681565b600381565b6000805460ff16611813576040805162461bcd60e51b81526020600482015260196024820152600080516020614f88833981519152604482015290519081900360640190fd5b42607801826001600160401b0316101561185e5760405162461bcd60e51b8152600401808060200182810382526024815260200180614c8e6024913960400191505060405180910390fd5b6402540be4003406156118a25760405162461bcd60e51b8152600401808060200182810382526040815260200180614ffe6040913960400191505060405180910390fd5b600080806001600160a01b038816611981576001546118c890879063ffffffff612d9a16565b3410156119065760405162461bcd60e51b8152600401808060200182810382526061815260200180614d186061913960800191505060405180910390fd5b6402540be40086061561194a5760405162461bcd60e51b815260040180806020018281038252603c815260200180614e0d603c913960400191505060405180910390fd5b61195a348763ffffffff612e8f16565b9050611971866402540be40063ffffffff612df416565b6221272160e91b93509150611c24565b6001600160a01b0388166000908152600360205260409020549250826119d85760405162461bcd60e51b8152600401808060200182810382526031815260200180614ce76031913960400191505060405180910390fd5b600154341015611a195760405162461bcd60e51b815260040180806020018281038252603f815260200180614e6a603f913960400191505060405180910390fd5b506001600160a01b0387166000908152600260205260409020543490600881111580611a645750600881118015611a645750611a62876007198301600a0a63ffffffff6131e716565b155b611a9f5760405162461bcd60e51b815260040180806020018281038252603c815260200180614e0d603c913960400191505060405180910390fd5b611aa98782613229565b9250611ab484613269565b15611afc576305f5e100831015611afc5760405162461bcd60e51b815260040180806020018281038252603a815260200180614c30603a913960400191505060405180910390fd5b600881101580611b165750600881108015611b1657508683115b611b515760405162461bcd60e51b8152600401808060200182810382526025815260200180614d796025913960400191505060405180910390fd5b677ce66c50e2840000831115611b985760405162461bcd60e51b8152600401808060200182810382526035815260200180614cb26035913960400191505060405180910390fd5b604080516323b872dd60e01b81523360048201523060248201526044810189905290516001600160a01b038b16916323b872dd9160648083019260209291908290030181600087803b158015611bed57600080fd5b505af1158015611c01573d6000803e3d6000fd5b505050506040513d6020811015611c1757600080fd5b5051611c2257600080fd5b505b611c2c614ae8565b6040805160c0810182528581526001600160a01b038b16602082015281516001808252818401845291928301918160200160208202803683375050508152604080516001808252818301909252602092830192909190808301908036833750505081526040805160018082528183019092526020928301929091908083019080368337019050508152602001876001600160401b03168152509050828160400151600081518110611cd957fe5b602002602001018181525050878160600151600081518110611cf757fe5b60200260200101906001600160a01b031690816001600160a01b031681525050338160800151600081518110611d2957fe5b6001600160a01b039092166020928302919091019091015261200063f7a251d76003611d5484612ed1565b611d69866402540be40063ffffffff612df416565b6040518463ffffffff1660e01b8152600401808460ff1660ff16815260200180602001838152602001828103825284818151815260200191508051906020019080838360005b83811015611dc7578181015183820152602001611daf565b50505050905090810190601f168015611df45780820380516001836020036101000a031916815260200191505b50945050505050602060405180830381600087803b158015611e1557600080fd5b505af1158015611e29573d6000803e3d6000fd5b505050506040513d6020811015611e3f57600080fd5b5050604080516001600160a01b038b1681523360208201528082018990526060810184905290517f74eab09b0e53aefc23f2e1b16da593f95c2dd49c6f5a23720463d10d9c330b2a9181900360800190a150600198975050505050505050565b3361100714611edf5760405162461bcd60e51b815260040180806020018281038252602e815260200180614ea9602e913960400191505060405180910390fd5b60208114611f34576040805162461bcd60e51b815260206004820152601b60248201527f65787065637465642076616c7565206c656e6774682069732033320000000000604482015290519081900360640190fd5b606084848080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050604080516020601f8801819004810282018101909252868152939450606093925086915085908190840183828082843760009201919091525050505060208301519091506772656c617946656560c01b81141561203c576020820151670de0b6b3a76400008111158015611fe357506402540be4008106155b612034576040805162461bcd60e51b815260206004820152601960248201527f7468652072656c6179466565206f7574206f662072616e676500000000000000604482015290519081900360640190fd5b600155612079565b6040805162461bcd60e51b815260206004820152600d60248201526c756e6b6e6f776e20706172616d60981b604482015290519081900360640190fd5b7f6cdb0ac70ab7f2e2d035cca5be60d89906f2dede7648ddbd7402189c1eeed17a878787876040518080602001806020018381038352878782818152602001925080828437600083820152601f01601f191690910184810383528581526020019050858580828437600083820152604051601f909101601f19169092018290039850909650505050505050a150505050505050565b6000805460ff16612154576040805162461bcd60e51b81526020600482015260196024820152600080516020614f88833981519152604482015290519081900360640190fd5b8786146121925760405162461bcd60e51b815260040180806020018281038252603b815260200180614efb603b913960400191505060405180910390fd5b8784146121d05760405162461bcd60e51b815260040180806020018281038252603f815260200180614d9e603f913960400191505060405180910390fd5b42607801826001600160401b0316101561221b5760405162461bcd60e51b8152600401808060200182810382526024815260200180614c8e6024913960400191505060405180910390fd5b6402540be40034061561225f5760405162461bcd60e51b8152600401808060200182810382526040815260200180614ffe6040913960400191505060405180910390fd5b856000805b8281101561229b576122918a8a8381811061227b57fe5b9050602002013583612d9a90919063ffffffff16565b9150600101612264565b50604080518981526020808b028201019091526060908980156122c8578160200160208202803683370190505b5090506000806001600160a01b03881661241d5760005b858160ff16101561239a576402540be4008d8d8360ff168181106122ff57fe5b905060200201358161230d57fe5b0615612360576040805162461bcd60e51b815260206004820152601760248201527f696e76616c6964207472616e7366657220616d6f756e74000000000000000000604482015290519081900360640190fd5b6123786402540be4008e8e8460ff168181106111c157fe5b848260ff168151811061238757fe5b60209081029190910101526001016122df565b506001546123bf906123b2908763ffffffff612e3616565b859063ffffffff612d9a16565b3410156123fd5760405162461bcd60e51b8152600401808060200182810382526056815260200180614fa86056913960600191505060405180910390fd5b61240d348563ffffffff612e8f16565b6221272160e91b925090506126e6565b6001600160a01b038816600090815260026020526040812054905b868110156125ae57600882111580612484575060088211801561248457506124826007198301600a0a8f8f8481811061246d57fe5b905060200201356131e790919063ffffffff16565b155b6124bf5760405162461bcd60e51b815260040180806020018281038252603c815260200180614e0d603c913960400191505060405180910390fd5b60006124dd8f8f848181106124d057fe5b9050602002013584613229565b905060088310158061250b575060088310801561250b57508e8e8381811061250157fe5b9050602002013581115b6125465760405162461bcd60e51b8152600401808060200182810382526025815260200180614d796025913960400191505060405180910390fd5b677ce66c50e284000081111561258d5760405162461bcd60e51b8152600401808060200182810382526035815260200180614cb26035913960400191505060405180910390fd5b8086838151811061259a57fe5b602090810291909101015250600101612438565b506001546125c2908763ffffffff612e3616565b3410156126005760405162461bcd60e51b815260040180806020018281038252604381526020018061503e6043913960600191505060405180910390fd5b6001600160a01b03891660009081526003602052604090205492503491508261265a5760405162461bcd60e51b8152600401808060200182810382526030815260200180614ddd6030913960400191505060405180910390fd5b604080516323b872dd60e01b81523360048201523060248201526044810187905290516001600160a01b038b16916323b872dd9160648083019260209291908290030181600087803b1580156126af57600080fd5b505af11580156126c3573d6000803e3d6000fd5b505050506040513d60208110156126d957600080fd5b50516126e457600080fd5b505b60608e8e808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509293506127289250614ae8915050565b6040518060c001604052808581526020018b6001600160a01b031681526020018681526020018381526020018d8d808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152505050908252506001600160401b038b16602090910152905061200063f7a251d760036127af84612ed1565b6127c4876402540be40063ffffffff612df416565b6040518463ffffffff1660e01b8152600401808460ff1660ff16815260200180602001838152602001828103825284818151815260200191508051906020019080838360005b8381101561282257818101518382015260200161280a565b50505050905090810190601f16801561284f5780820380516001836020036101000a031916815260200191505b50945050505050602060405180830381600087803b15801561287057600080fd5b505af1158015612884573d6000803e3d6000fd5b505050506040513d602081101561289a57600080fd5b5050604080516001600160a01b038c1681523360208201528082018890526060810185905290517f74eab09b0e53aefc23f2e1b16da593f95c2dd49c6f5a23720463d10d9c330b2a9181900360800190a15060019f9e505050505050505050505050505050565b61c35081565b33611008146129475760405162461bcd60e51b8152600401808060200182810382526023815260200180614f656023913960400191505060405180910390fd5b600091825260046020908152604080842080546001600160a01b03191690556001600160a01b0392909216835260039052812055565b6221272160e91b81565b6001600160a01b031660009081526003602052604090205490565b61100281565b60005460ff166129ed576040805162461bcd60e51b81526020600482015260196024820152600080516020614f88833981519152604482015290519081900360640190fd5b3361200014612a2d5760405162461bcd60e51b815260040180806020018281038252602f815260200180614f36602f913960400191505060405180910390fd5b60ff83166003141561156d5761156882828080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061336f92505050565b6001600160a01b031660009081526002602052604090205490565b61100381565b60005460ff1615612af1576040805162461bcd60e51b815260206004820152601960248201527f74686520636f6e747261637420616c726561647920696e697400000000000000604482015290519081900360640190fd5b662386f26fc1000060019081556000808052600260205260127fac33ff75c19e70fe83507db0d683fd3465c996598dc972688b7ace676c89077b55805460ff19169091179055565b600481565b600581565b61100081565b6001600160a01b03811660009081526003602090815260409182902054825182815280840190935260609290918391906020820181803683375050506020810183905290506000805b60208160ff161015612bd957828160ff1681518110612bad57fe5b01602001516001600160f81b03191615612bcc57600190910190612bd1565b612bd9565b600101612b92565b5060608160ff166040519080825280601f01601f191660200182016040528015612c0a576020820181803683370190505b50905060005b8260ff168160ff161015612c6657838160ff1681518110612c2d57fe5b602001015160f81c60f81b828260ff1681518110612c4757fe5b60200101906001600160f81b031916908160001a905350600101612c10565b5095945050505050565b61100481565b6060612c80614b33565b6000612c8b8461346d565b9150915080612ce1576040805162461bcd60e51b815260206004820152601f60248201527f756e7265636f676e697a6564207472616e73666572496e207061636b61676500604482015290519081900360640190fd5b6000612cec836135ab565b905063ffffffff811615612d80576040808401516020808601516001600160a01b03166000908152600290915291822054612d279190613229565b9050612d31614b68565b60405180608001604052808660000151815260200183815260200186608001516001600160a01b031681526020018463ffffffff168152509050612d74816138c1565b95505050505050610f55565b50506040805160008152602081019091529150610f559050565b600082820183811015611793576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b600061179383836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061399d565b600082612e4557506000611796565b82820282848281612e5257fe5b04146117935760405162461bcd60e51b8152600401808060200182810382526021815260200180614e496021913960400191505060405180910390fd5b600061179383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250613a3f565b60408051600680825260e08201909252606091829190816020015b6060815260200190600190039081612eec5750508351909150612f0e90613a99565b81600081518110612f1b57fe5b6020026020010181905250612f3c83602001516001600160a01b0316613aac565b81600181518110612f4957fe5b602002602001018190525060008360400151519050606081604051908082528060200260200182016040528015612f9457816020015b6060815260200190600190039081612f7f5790505b50905060005b82811015612fe157612fc286604001518281518110612fb557fe5b6020026020010151613a99565b828281518110612fce57fe5b6020908102919091010152600101612f9a565b50612feb81613acf565b83600281518110612ff857fe5b602002602001018190525060608260405190808252806020026020018201604052801561303957816020015b60608152602001906001900390816130245790505b50905060005b8381101561308f576130708760600151828151811061305a57fe5b60200260200101516001600160a01b0316613aac565b82828151811061307c57fe5b602090810291909101015260010161303f565b5061309981613acf565b846003815181106130a657fe5b60200260200101819052506060836040519080825280602002602001820160405280156130e757816020015b60608152602001906001900390816130d25790505b50905060005b84811015613127576131088860800151828151811061305a57fe5b82828151811061311457fe5b60209081029190910101526001016130ed565b5061313181613acf565b8560048151811061313e57fe5b602002602001018190525061315f8760a001516001600160401b0316613a99565b8560058151811061316c57fe5b602002602001018190525061318085613acf565b979650505050505050565b613193614b8f565b600061319e83613b59565b91509150806131de5760405162461bcd60e51b8152600401808060200182810382526024815260200180614ed76024913960400191505060405180910390fd5b6115dc82613d24565b600061179383836040518060400160405280601881526020017f536166654d6174683a206d6f64756c6f206279207a65726f0000000000000000815250614175565b600060088211156132525761324b836007198401600a0a63ffffffff612df416565b9050611796565b611793836008849003600a0a63ffffffff612e3616565b604080516020808252818301909252600091606091906020820181803683375050506020810184905290506000805b60208160ff1610156132df57828160ff16815181106132b357fe5b01602001516001600160f81b031916156132d2576001909101906132d7565b6132df565b600101613298565b50600860ff821610156132f757600092505050610f55565b816005820360ff168151811061330957fe5b6020910101516001600160f81b031916602d60f81b1461332e57600092505050610f55565b816001820360ff168151811061334057fe5b6020910101516001600160f81b031916604d60f81b1461336557600092505050610f55565b5060019392505050565b613377614ae8565b6000613382836141d7565b91509150806133c25760405162461bcd60e51b8152600401808060200182810382526024815260200180614c6a6024913960400191505060405180910390fd5b6133ca614b8f565b602080840180516001600160a01b0390811684526040808701518585015291511660009081526002909252812054905b84604001515181101561344b576134288560400151828151811061341a57fe5b602002602001015183614451565b8560400151828151811061343857fe5b60209081029190910101526001016133fa565b50608084015160408301526005606083015261346682613d24565b5050505050565b613475614b33565b600061347f614b33565b613487614bc6565b6134986134938661448a565b6144af565b90506000805b6134a7836144f9565b1561359e57806134c9576134c26134bd8461451a565b614568565b8452613596565b80600114156134f6576134e36134de8461451a565b6145c8565b6001600160a01b03166020850152613596565b80600214156135155761350b6134bd8461451a565b6040850152613596565b806003141561353d5761352a6134de8461451a565b6001600160a01b03166060850152613596565b8060041415613565576135526134de8461451a565b6001600160a01b03166080850152613596565b80600514156135915761357a6134bd8461451a565b6001600160401b031660a085015260019150613596565b61359e565b60010161349e565b5091935090915050915091565b60208101516000906001600160a01b03166136ac578160a001516001600160401b03164211156135dd57506001610f55565b81604001514710156135f157506003610f55565b81606001516001600160a01b03166108fc83604001519081150290604051600060405180830381858888f1935050505061362d57506004610f55565b7f471eb9cc1ffe55ffadf15b32595415eb9d80f22e761d24bd6dffc607e1284d5982602001518360600151846040015160405180846001600160a01b03166001600160a01b03168152602001836001600160a01b03166001600160a01b03168152602001828152602001935050505060405180910390a1506000610f55565b8160a001516001600160401b03164211156136c957506001610f55565b81516020808401516001600160a01b0316600090815260039091526040902054146136f657506002610f55565b602080830151604080516370a0823160e01b815230600482015290516000936001600160a01b03909316926370a082319261c3509260248083019392829003018187803b15801561374657600080fd5b5086fa15801561375a573d6000803e3d6000fd5b50505050506040513d602081101561377157600080fd5b5051604084015190915081101561378c575060039050610f55565b600083602001516001600160a01b031663a9059cbb61c350866060015187604001516040518463ffffffff1660e01b815260040180836001600160a01b03166001600160a01b0316815260200182815260200192505050602060405180830381600088803b1580156137fd57600080fd5b5087f1158015613811573d6000803e3d6000fd5b50505050506040513d602081101561382857600080fd5b5051905080156138b5577f471eb9cc1ffe55ffadf15b32595415eb9d80f22e761d24bd6dffc607e1284d5984602001518560600151866040015160405180846001600160a01b03166001600160a01b03168152602001836001600160a01b03166001600160a01b03168152602001828152602001935050505060405180910390a15060009150610f559050565b5060059150610f559050565b60408051600480825260a08201909252606091829190816020015b60608152602001906001900390816138dc57505083519091506138fe90613a99565b8160008151811061390b57fe5b60200260200101819052506139238360200151613a99565b8160018151811061393057fe5b602002602001018190525061395183604001516001600160a01b0316613aac565b8160028151811061395e57fe5b602002602001018190525061397c836060015163ffffffff16613a99565b8160038151811061398957fe5b6020026020010181905250610f2981613acf565b60008183613a295760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b838110156139ee5781810151838201526020016139d6565b50505050905090810190601f168015613a1b5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838581613a3557fe5b0495945050505050565b60008184841115613a915760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156139ee5781810151838201526020016139d6565b505050900390565b6060611796613aa7836145e2565b6146c8565b60408051600560a21b8318601482015260348101909152606090610f29816146c8565b6060815160001415613af05750604080516000815260208101909152610f55565b606082600081518110613aff57fe5b602002602001015190506000600190505b8351811015613b4057613b3682858381518110613b2957fe5b602002602001015161471a565b9150600101613b10565b50610f29613b53825160c060ff16614797565b8261471a565b613b61614b8f565b6000613b6b614b8f565b613b73614bc6565b613b7f6134938661448a565b90506000805b613b8e836144f9565b1561359e5780613bb457613ba46134de8461451a565b6001600160a01b03168452613d1c565b8060011415613c55576060613bd0613bcb8561451a565b61488f565b90508051604051908082528060200260200182016040528015613bfd578160200160208202803683370190505b50602086015260005b8151811015613c4e57613c2b828281518110613c1e57fe5b6020026020010151614568565b86602001518281518110613c3b57fe5b6020908102919091010152600101613c06565b5050613d1c565b8060021415613cf7576060613c6c613bcb8561451a565b90508051604051908082528060200260200182016040528015613c99578160200160208202803683370190505b50604086015260005b8151811015613c4e57613cc7828281518110613cba57fe5b60200260200101516145c8565b86604001518281518110613cd757fe5b6001600160a01b0390921660209283029190910190910152600101613ca2565b806003141561359157613d0c6134bd8461451a565b63ffffffff166060850152600191505b600101613b85565b80516001600160a01b0316613f1b5760005b816020015151811015613f155781604001518181518110613d5357fe5b60200260200101516001600160a01b03166108fc83602001518381518110613d7757fe5b60200260200101519081150290604051600060405180830381858888f19350505050613e57577f203f9f67a785f4f81be4d48b109aa0c498d1bc8097ecc2627063f480cc5fe73e826000015183604001518381518110613dd357fe5b602002602001015184602001518481518110613deb57fe5b6020026020010151856060015160405180856001600160a01b03166001600160a01b03168152602001846001600160a01b03166001600160a01b031681526020018381526020018263ffffffff1663ffffffff16815260200194505050505060405180910390a1613f0d565b7fd468d4fa5e8fb4adc119b29a983fd0785e04af5cb8b7a3a69a47270c54b6901a826000015183604001518381518110613e8d57fe5b602002602001015184602001518481518110613ea557fe5b6020026020010151856060015160405180856001600160a01b03166001600160a01b03168152602001846001600160a01b03166001600160a01b031681526020018381526020018263ffffffff1663ffffffff16815260200194505050505060405180910390a15b600101613d36565b50614172565b60005b81602001515181101561417057600082600001516001600160a01b031663a9059cbb61c35085604001518581518110613f5357fe5b602002602001015186602001518681518110613f6b57fe5b60200260200101516040518463ffffffff1660e01b815260040180836001600160a01b03166001600160a01b0316815260200182815260200192505050602060405180830381600088803b158015613fc257600080fd5b5087f1158015613fd6573d6000803e3d6000fd5b50505050506040513d6020811015613fed57600080fd5b5051905080156140b1577fd468d4fa5e8fb4adc119b29a983fd0785e04af5cb8b7a3a69a47270c54b6901a83600001518460400151848151811061402d57fe5b60200260200101518560200151858151811061404557fe5b6020026020010151866060015160405180856001600160a01b03166001600160a01b03168152602001846001600160a01b03166001600160a01b031681526020018381526020018263ffffffff1663ffffffff16815260200194505050505060405180910390a1614167565b7f203f9f67a785f4f81be4d48b109aa0c498d1bc8097ecc2627063f480cc5fe73e8360000151846040015184815181106140e757fe5b6020026020010151856020015185815181106140ff57fe5b6020026020010151866060015160405180856001600160a01b03166001600160a01b03168152602001846001600160a01b03166001600160a01b031681526020018381526020018263ffffffff1663ffffffff16815260200194505050505060405180910390a15b50600101613f1e565b505b50565b600081836141c45760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156139ee5781810151838201526020016139d6565b508284816141ce57fe5b06949350505050565b6141df614ae8565b60006141e9614ae8565b6141f1614bc6565b6141fd6134938661448a565b90506000805b61420c836144f9565b156144435780614229576142226134bd8461451a565b845261443b565b80600114156142515761423e6134de8461451a565b6001600160a01b0316602085015261443b565b80600214156142e0576060614268613bcb8561451a565b90508051604051908082528060200260200182016040528015614295578160200160208202803683370190505b50604086015260005b81518110156142d9576142b6828281518110613c1e57fe5b866040015182815181106142c657fe5b602090810291909101015260010161429e565b505061443b565b80600314156143755760606142f7613bcb8561451a565b90508051604051908082528060200260200182016040528015614324578160200160208202803683370190505b50606086015260005b81518110156142d957614345828281518110613cba57fe5b8660600151828151811061435557fe5b6001600160a01b039092166020928302919091019091015260010161432d565b806004141561440a57606061438c613bcb8561451a565b905080516040519080825280602002602001820160405280156143b9578160200160208202803683370190505b50608086015260005b81518110156142d9576143da828281518110613cba57fe5b866080015182815181106143ea57fe5b6001600160a01b03909216602092830291909101909101526001016143c2565b80600514156144365761441f6134bd8461451a565b6001600160401b031660a08501526001915061443b565b614443565b600101614203565b509195600195509350505050565b600060088211156144735761324b836007198401600a0a63ffffffff612e3616565b611793836008849003600a0a63ffffffff612df416565b614492614be6565b506040805180820190915281518152602082810190820152919050565b6144b7614bc6565b6144c082614960565b6144c957600080fd5b60006144d88360200151614990565b60208085015160408051808201909152868152920190820152915050919050565b6000614503614be6565b505080518051602091820151919092015191011190565b614522614be6565b61452b826144f9565b61453457600080fd5b60208201516000614544826149f3565b80830160209586015260408051808201909152908152938401919091525090919050565b80516000901580159061457d57508151602110155b61458657600080fd5b60006145958360200151614990565b835160208086015183018051939450918490039291908310156145bf57826020036101000a820491505b50949350505050565b80516000906015146145d957600080fd5b61179682614568565b604080516020808252818301909252606091829190602082018180368337505050602081018490529050600067ffffffffffffffff1984166146265750601861464a565b6fffffffffffffffffffffffffffffffff1984166146465750601061464a565b5060005b60208110156146805781818151811061465f57fe5b01602001516001600160f81b0319161561467857614680565b60010161464a565b60008160200390506060816040519080825280601f01601f1916602001820160405280156146b5576020820181803683370190505b5080830196909652508452509192915050565b6060815160011480156146fa5750607f60f81b826000815181106146e857fe5b01602001516001600160f81b03191611155b15614706575080610f55565b6117966147188351608060ff16614797565b835b6060806040519050835180825260208201818101602087015b8183101561474b578051835260209283019201614733565b50855184518101855292509050808201602086015b81831015614778578051835260209283019201614760565b508651929092011591909101601f01601f191660405250905092915050565b60606801000000000000000083106147e7576040805162461bcd60e51b815260206004820152600e60248201526d696e70757420746f6f206c6f6e6760901b604482015290519081900360640190fd5b604080516001808252818301909252606091602082018180368337019050509050603784116148415782840160f81b8160008151811061482357fe5b60200101906001600160f81b031916908160001a9053509050611796565b606061484c856145e2565b90508381510160370160f81b8260008151811061486557fe5b60200101906001600160f81b031916908160001a905350614886828261471a565b95945050505050565b606061489a82614960565b6148a357600080fd5b60006148ae83614a8c565b90506060816040519080825280602002602001820160405280156148ec57816020015b6148d9614be6565b8152602001906001900390816148d15790505b50905060006148fe8560200151614990565b60208601510190506000805b848110156149555761491b836149f3565b915060405180604001604052808381526020018481525084828151811061493e57fe5b60209081029190910101529181019160010161490a565b509195945050505050565b805160009061497157506000610f55565b6020820151805160001a9060c082101561336557600092505050610f55565b8051600090811a60808110156149aa576000915050610f55565b60b88110806149c5575060c081108015906149c5575060f881105b156149d4576001915050610f55565b60c08110156149e85760b519019050610f55565b60f519019050610f55565b80516000908190811a6080811015614a0e5760019150614a85565b60b8811015614a2357607e1981019150614a85565b60c0811015614a505760b78103600185019450806020036101000a85510460018201810193505050614a85565b60f8811015614a655760be1981019150614a85565b60f78103600185019450806020036101000a855104600182018101935050505b5092915050565b8051600090614a9d57506000610f55565b60008090506000614ab18460200151614990565b602085015185519181019250015b80821015614adf57614ad0826149f3565b60019093019290910190614abf565b50909392505050565b6040518060c001604052806000801916815260200160006001600160a01b0316815260200160608152602001606081526020016060815260200160006001600160401b031681525090565b6040805160c081018252600080825260208201819052918101829052606081018290526080810182905260a081019190915290565b60408051608081018252600080825260208201819052918101829052606081019190915290565b604051806080016040528060006001600160a01b031681526020016060815260200160608152602001600063ffffffff1681525090565b6040518060400160405280614bd9614be6565b8152602001600081525090565b60405180604001604052806000815260200160008152509056fe746865206d6573736167652073656e646572206d75737420626520696e63656e746976697a6520636f6e7472616374466f72206d696e69546f6b656e2c20746865207472616e7366657220616d6f756e74206d757374206e6f74206265206c657373207468616e2031756e7265636f676e697a6564207472616e736665724f75742073796e207061636b61676565787069726554696d65206d7573742062652074776f206d696e75746573206c61746572616d6f756e7420697320746f6f206c617267652c20657863656564206d6178696d756d206265703220746f6b656e20616d6f756e7474686520636f6e747261637420686173206e6f74206265656e20626f756e6420746f20616e79206265703220746f6b656e726563656976656420424e4220616d6f756e742073686f756c64206265206e6f206c657373207468616e207468652073756d206f66207472616e736665724f757420424e4220616d6f756e7420616e64206d696e696d756d2072656c6179466565616d6f756e7420697320746f6f206c617267652c2075696e74323536206f766572666c6f774c656e677468206f6620726563697069656e74416464727320646f65736e277420657175616c20746f206c656e677468206f6620726566756e64416464727374686520636f6e747261637420686173206e6f74206265656e2062696e6420746f20616e79206265703220746f6b656e696e76616c6964207472616e7366657220616d6f756e743a20707265636973696f6e206c6f737320696e20616d6f756e7420636f6e76657273696f6e536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77726563656976656420424e4220616d6f756e742073686f756c64206265206e6f206c657373207468616e20746865206d696e696d756d2072656c6179466565746865206d6573736167652073656e646572206d75737420626520676f7665726e616e636520636f6e7472616374756e7265636f676e697a6564207472616e736665724f75742061636b207061636b6167654c656e677468206f6620726563697069656e74416464727320646f65736e277420657175616c20746f206c656e677468206f6620616d6f756e7473746865206d6573736167652073656e646572206d7573742062652063726f737320636861696e20636f6e7472616374746865206d73672073656e646572206d75737420626520746f6b656e4d616e6167657274686520636f6e7472616374206e6f7420696e69742079657400000000000000726563656976656420424e4220616d6f756e742073686f756c64206265206e6f206c657373207468616e207468652073756d206f66207472616e7366657220424e4220616d6f756e7420616e642072656c6179466565696e76616c696420726563656976656420424e4220616d6f756e743a20707265636973696f6e206c6f737320696e20616d6f756e7420636f6e76657273696f6e726563656976656420424e4220616d6f756e742073686f756c64206265206e6f206c657373207468616e207468652072656c61794665652a62617463684c656e677468a2646970667358221220d1c73f520d8ef3e9a12aed51743c0ced82e8b8c6c19fe07a2210d126fa2a47fa64736f6c63430006040033", }, }, } @@ -53,13 +60,13 @@ func UpgradeBuildInSystemContract(config *params.ChainConfig, blockNumber *big.I return } - logger := log.New("type", "system-contract-upgrade") - if config.IsRamanujan(blockNumber) { + logger := log.New("system-contract-upgrade") + if config.IsOnRamanujan(blockNumber) { applySystemContractUpgrade(ramanujanUpgrade, blockNumber, statedb, logger) } /* - apply other upgrade + apply other upgrades */ } @@ -67,11 +74,20 @@ func applySystemContractUpgrade(upgrade *Upgrade, blockNumber *big.Int, statedb logger.Info(fmt.Sprintf("Apply upgrade %s at height %d", upgrade.UpgradeName, blockNumber.Int64())) for _, cfg := range upgrade.Configs { logger.Info(fmt.Sprintf("Upgrade contract %s to commit %s", cfg.ContractAddr.String(), cfg.CommitUrl)) + + if cfg.BeforeUpgrade != nil { + cfg.BeforeUpgrade(blockNumber, cfg.ContractAddr, statedb) + } + newContractCode, err := hex.DecodeString(cfg.Code) if err != nil { logger.Info(fmt.Sprintf("failed to decode new contract code: %s", err.Error())) continue } statedb.SetCode(cfg.ContractAddr, newContractCode) + + if cfg.AfterUpgrade != nil { + cfg.AfterUpgrade(blockNumber, cfg.ContractAddr, statedb) + } } } diff --git a/params/config.go b/params/config.go index aea6da3ff..b68618c90 100644 --- a/params/config.go +++ b/params/config.go @@ -444,6 +444,11 @@ func (c *ChainConfig) IsRamanujan(num *big.Int) bool { return isForked(c.RamanujanBlock, num) } +// IsOnRamanujan returns whether num is equal to the IsRamanujan fork block +func (c *ChainConfig) IsOnRamanujan(num *big.Int) bool { + return configNumEqual(c.RamanujanBlock, num) +} + // IsMuirGlacier returns whether num is either equal to the Muir Glacier (EIP-2384) fork block or greater. func (c *ChainConfig) IsMuirGlacier(num *big.Int) bool { return isForked(c.MuirGlacierBlock, num)