diff --git a/core/chain_makers.go b/core/chain_makers.go index f0026089ac..cc17cd74cd 100644 --- a/core/chain_makers.go +++ b/core/chain_makers.go @@ -308,7 +308,7 @@ func GenerateChain(config *params.ChainConfig, parent *types.Block, engine conse if config.DAOForkSupport && config.DAOForkBlock != nil && config.DAOForkBlock.Cmp(b.header.Number) == 0 { misc.ApplyDAOHardFork(statedb) } - systemcontracts.UpgradeBuildInSystemContract(config, b.header.Number, statedb) + systemcontracts.UpgradeBuildInSystemContract(config, b.header.Number, parent.Time(), b.header.Time, statedb) // Execute any user modifications to the block if gen != nil { gen(i, b) diff --git a/core/state_processor.go b/core/state_processor.go index 5b6411d80f..25cb7df409 100644 --- a/core/state_processor.go +++ b/core/state_processor.go @@ -74,7 +74,11 @@ func (p *StateProcessor) Process(block *types.Block, statedb *state.StateDB, cfg misc.ApplyDAOHardFork(statedb) } // Handle upgrade build-in system contract code - systemcontracts.UpgradeBuildInSystemContract(p.config, block.Number(), statedb) + lastBlock := p.bc.GetBlockByHash(block.ParentHash()) + if lastBlock == nil { + return statedb, nil, nil, 0, fmt.Errorf("could not get parent block") + } + systemcontracts.UpgradeBuildInSystemContract(p.config, blockNumber, lastBlock.Time(), block.Time(), statedb) var ( context = NewEVMBlockContext(header, p.bc, nil) diff --git a/core/systemcontracts/upgrade.go b/core/systemcontracts/upgrade.go index d644533a39..ab32e470e0 100644 --- a/core/systemcontracts/upgrade.go +++ b/core/systemcontracts/upgrade.go @@ -56,7 +56,9 @@ var ( platoUpgrade = make(map[string]*Upgrade) - latestUpgrade = platoUpgrade + keplerUpgrade = make(map[string]*Upgrade) + + latestUpgrade = keplerUpgrade ) func init() { @@ -697,10 +699,43 @@ func init() { }, } + keplerUpgrade[mainNet] = &Upgrade{ + UpgradeName: "kepler", + Configs: []*UpgradeConfig{ + { + ContractAddr: common.HexToAddress(SlashContract), + CommitUrl: "https://github.com/NathanBSC/bsc-genesis-contract/commit/a9a7ff5b74df13017b56b040bd484bc7726adb2d", + Code: "608060405234801561001057600080fd5b50600436106102955760003560e01c80638256ace611610167578063c81b1662116100ce578063e1c7392a11610087578063e1c7392a146104d3578063eb57bff7146104db578063f9a2bbc7146104e3578063fc3e5908146104eb578063fc4333cd146104f3578063fd6a6879146104fb57610295565b8063c81b166214610482578063c8509d811461048a578063c96be4cb1461049d578063cc844b73146104b0578063d2a42e4b146104c3578063dc927faf146104cb57610295565b8063a78abc1611610120578063a78abc1614610447578063ab51bb961461044f578063ac0af62914610457578063ac4317511461045f578063ae61dc3b14610472578063c80d4b8f1461047a57610295565b80638256ace61461040c578063831d65d11461041457806396713da9146104275780639bc8e4f21461042f5780639dc0926214610437578063a1a11bf51461043f57610295565b8063493279b11161020b5780636e47b482116101c45780636e47b482146103dc57806370fd5bad146103e4578063718a8aa8146103ec57806375d47a0a146103f45780637912a65d146103fc5780637942fd051461040457610295565b8063493279b1146103925780634bf6c882146103a757806351e80672146103af578063567a372d146103b75780635bfb4990146103bf57806362b72cf5146103d457610295565b806335aa2e441161025d57806335aa2e441461032457806337c8dab914610337578063389f4f71146103585780633a63f4b11461036d5780633dffc3871461037557806343756e5c1461038a57610295565b80630bee7a671461029a5780630e2374a5146102b85780631182b875146102cd57806322d1e80b146102ed57806323bac5a214610302575b600080fd5b6102a2610503565b6040516102af9190613550565b60405180910390f35b6102c0610508565b6040516102af9190612d6c565b6102e06102db366004612ca2565b61050e565b6040516102af9190612da4565b6102f5610574565b6040516102af9190612d99565b610315610310366004612a50565b61057d565b6040516102af93929190613538565b6102c0610332366004612c72565b6105a0565b61034a610345366004612a50565b6105c7565b6040516102af92919061352a565b61036061061e565b6040516102af9190613500565b610360610624565b61037d61062a565b6040516102af9190613561565b6102c061062f565b61039a610635565b6040516102af91906134f1565b61037d61063a565b6102c061063f565b610360610645565b6103d26103cd366004612a50565b61064b565b005b6103606106f6565b6102c06106fc565b61037d610702565b61037d610707565b6102c061070c565b610360610712565b61037d610717565b61034a61071c565b6103d2610422366004612ca2565b610726565b61037d610838565b61036061083d565b6102c0610848565b6102c061084e565b6102f5610854565b6102a261085d565b610360610862565b6103d261046d366004612b56565b610867565b610360610e17565b610360610e1e565b6102c0610e23565b6103d2610498366004612ca2565b610e29565b6103d26104ab366004612a50565b610e9a565b6103d26104be366004612bbf565b61128b565b61036061187e565b6102c0611883565b6103d2611889565b6103606118c5565b6102c06118cb565b61037d6118d1565b6103d26118d6565b6102c0611d1f565b606481565b61200181565b6060336120001461053a5760405162461bcd60e51b815260040161053190613349565b60405180910390fd5b60005460ff1661055c5760405162461bcd60e51b815260040161053190612e9f565b60405162461bcd60e51b81526004016105319061343a565b60075460ff1681565b600260208190526000918252604090912080546001820154919092015460ff1683565b600181815481106105ad57fe5b6000918252602090912001546001600160a01b0316905081565b6000806105d2612837565b5050506001600160a01b0316600090815260026020818152604092839020835160608101855281548082526001830154938201849052919093015460ff16151592909301919091529091565b60055481565b60065481565b600181565b61100181565b603881565b600881565b61200081565b60045481565b336110001461066c5760405162461bcd60e51b81526004016105319061312e565b60005460ff1661068e5760405162461bcd60e51b815260040161053190612e9f565b61200063f7a251d7600b6106a184611d25565b60006040518463ffffffff1660e01b81526004016106c19392919061356f565b600060405180830381600087803b1580156106db57600080fd5b505af11580156106ef573d6000803e3d6000fd5b5050505050565b60035481565b61100581565b600281565b601081565b61100881565b603281565b600b81565b6004546005549091565b33612000146107475760405162461bcd60e51b815260040161053190613349565b60005460ff166107695760405162461bcd60e51b815260040161053190612e9f565b61077161285a565b60006107b284848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611df792505050565b9150915080156107f95781516040517f7f0956d47419b9525356e7111652b653b530ec6f5096dccc04589bc38e629967916107ec91613550565b60405180910390a16106ef565b81516040517f7d45f62d17443dd4547bca8a8112c60e2385669318dc300ec61a5d2492f262e79161082991613550565b60405180910390a15050505050565b600981565b662386f26fc1000081565b61100781565b61100681565b60005460ff1681565b600081565b600481565b60005460ff166108895760405162461bcd60e51b815260040161053190612e9f565b33611007146108aa5760405162461bcd60e51b815260040161053190613206565b61091584848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250506040805180820190915260148152731b5a5cd9195b59585b9bdc951a1c995cda1bdb1960621b60208201529150611e779050565b156109b0576020811461093a5760405162461bcd60e51b8152600401610531906130ba565b604080516020601f840181900481028201810190925282815260009161097891858580838501838280828437600092019190915250611ed192505050565b90506001811015801561098c575060055481105b6109a85760405162461bcd60e51b815260040161053190613304565b600455610dd4565b610a1684848080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505060408051808201909152600f81526e19995b1bdb9e551a1c995cda1bdb19608a1b60208201529150611e779050565b15610ab25760208114610a3b5760405162461bcd60e51b815260040161053190613254565b604080516020601f8401819004810282018101909252828152600091610a7991858580838501838280828437600092019190915250611ed192505050565b90506103e88111158015610a8e575060045481115b610aaa5760405162461bcd60e51b815260040161053190612f58565b600555610dd4565b610b2684848080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505060408051808201909152601881527f66696e616c697479536c617368526577617264526174696f000000000000000060208201529150611e779050565b15610bc05760208114610b4b5760405162461bcd60e51b815260040161053190613471565b604080516020601f8401819004810282018101909252828152600091610b8991858580838501838280828437600092019190915250611ed192505050565b9050600a8110158015610b9c5750606481105b610bb85760405162461bcd60e51b81526004016105319061306e565b600655610dd4565b610c3484848080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505060408051808201909152601881527f656e61626c654d616c6963696f7573566f7465536c617368000000000000000060208201529150611e779050565b15610cab5760208114610c595760405162461bcd60e51b815260040161053190612f8d565b604080516020601f8401819004810282018101909252828152610c959190848480838501838280828437600092019190915250611ed692505050565b6007805460ff1916911515919091179055610dd4565b610d1f84848080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505060408051808201909152601781527f6d616c6963696f7573566f7465536c61736853636f706500000000000000000060208201529150611e779050565b15610dbc5760208114610d445760405162461bcd60e51b815260040161053190612de9565b604080516020601f8401819004810282018101909252828152600091610d8291858580838501838280828437600092019190915250611ed192505050565b90506170808110158015610d985750620d2f0081105b610db45760405162461bcd60e51b815260040161053190612ed6565b600855610dd4565b60405162461bcd60e51b8152600401610531906133e5565b7f6cdb0ac70ab7f2e2d035cca5be60d89906f2dede7648ddbd7402189c1eeed17a84848484604051610e099493929190612db7565b60405180910390a150505050565b6201518081565b609681565b61100281565b3361200014610e4a5760405162461bcd60e51b815260040161053190613349565b60005460ff16610e6c5760405162461bcd60e51b815260040161053190612e9f565b6040517f07db600eebe2ac176be8dcebad61858c245a4961bb32ca2aa3d159b09aa0810e90600090a1505050565b334114610eb95760405162461bcd60e51b815260040161053190613398565b60005460ff16610edb5760405162461bcd60e51b815260040161053190612e9f565b6003544311610efc5760405162461bcd60e51b8152600401610531906134bc565b3a15610f1a5760405162461bcd60e51b8152600401610531906131a9565b60405163155853f360e21b8152611000906355614fcc90610f3f908490600401612d6c565b60206040518083038186803b158015610f5757600080fd5b505afa158015610f6b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f8f9190612b36565b610f9857611284565b610fa0612837565b506001600160a01b0381166000908152600260208181526040928390208351606081018552815481526001820154928101929092529091015460ff161580159282019290925290610ffb576020810180516001019052611054565b60016040820181905260208201819052805480820182556000919091527fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf60180546001600160a01b0319166001600160a01b0384161790555b43815260055460208201518161106657fe5b066111b257600060208201526040516335409f7f60e01b8152611000906335409f7f90611097908590600401612d6c565b600060405180830381600087803b1580156110b157600080fd5b505af11580156110c5573d6000803e3d6000fd5b505050506120006001600160a01b031663f7a251d7600b6110e585611d25565b60006040518463ffffffff1660e01b81526004016111059392919061356f565b600060405180830381600087803b15801561111f57600080fd5b505af1925050508015611130575060015b6111ad573d80801561115e576040519150601f19603f3d011682016040523d82523d6000602084013e611163565b606091505b50826001600160a01b03167fd7bc86ff5d08c8ab043edec743302aba2520e6635172a428bc956721db9e2d1c8360200151836040516111a3929190613509565b60405180910390a2505b61121e565b6004548160200151816111c157fe5b0661121e576040516375abf10160e11b81526110009063eb57e202906111eb908590600401612d6c565b600060405180830381600087803b15801561120557600080fd5b505af1158015611219573d6000803e3d6000fd5b505050505b6001600160a01b0382166000818152600260208181526040808420865181559186015160018301558581015191909201805460ff1916911515919091179055517fddb6012116e51abf5436d956a4f0ebd927e92c576ff96d7918290c8782291e3e9190a2505b5043600355565b60005460ff166112ad5760405162461bcd60e51b815260040161053190612e9f565b604051630a83aaa960e31b81526110069063541d5548906112d2903390600401612d6c565b60206040518083038186803b1580156112ea57600080fd5b505afa1580156112fe573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113229190612b36565b61133e5760405162461bcd60e51b815260040161053190612e33565b60075460ff166113605760405162461bcd60e51b815260040161053190612e6a565b60065461136d5760146006555b60085461137c57620151806008555b6008548151604001514391011180156113a057504360085482602001516040015101115b6113bc5760405162461bcd60e51b81526004016105319061340c565b8060200151602001518160000151602001511480156113ea5750806020015160600151816000015160600151145b156114075760405162461bcd60e51b815260040161053190613101565b8051604081015190511080156114265750602081015160408101519051105b6114425760405162461bcd60e51b815260040161053190613037565b6020810151518151511080156114675750806000015160400151816020015160400151105b8061149257508051516020820151511080156114925750806020015160400151816000015160400151105b806114ac5750806020015160400151816000015160400151145b6114c85760405162461bcd60e51b815260040161053190612f21565b604080820151905163ea321e4960e01b81526110009163ea321e49916114f19190600401612da4565b60206040518083038186803b15801561150957600080fd5b505afa15801561151d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115419190612b36565b61155d5760405162461bcd60e51b8152600401610531906131d7565b61156f81600001518260400151611efe565b8015611588575061158881602001518260400151611efe565b6115a45760405162461bcd60e51b815260040161053190612fd8565b6060806110006001600160a01b0316633b071dcc6040518163ffffffff1660e01b815260040160006040518083038186803b1580156115e257600080fd5b505afa1580156115f6573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261161e9190810190612a73565b9150915060005b815181101561175b5761164f82828151811061163d57fe5b602002602001015185604001516120d6565b15611753576006546040516309a99b4f60e41b815260646110028031909302049190639a99b4f0906116879033908590600401612d80565b602060405180830381600087803b1580156116a157600080fd5b505af11580156116b5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116d99190612c8a565b506110006001600160a01b03166335409f7f8584815181106116f757fe5b60200260200101516040518263ffffffff1660e01b815260040161171b9190612d6c565b600060405180830381600087803b15801561173557600080fd5b505af1158015611749573d6000803e3d6000fd5b505050505061175b565b600101611625565b50600061176d8460400151600061213a565b90506120006001600160a01b031663f7a251d7600b61178f8760400151612156565b60006040518463ffffffff1660e01b81526004016117af9392919061356f565b600060405180830381600087803b1580156117c957600080fd5b505af19250505080156117da575060015b61184c573d808015611808576040519150601f19603f3d011682016040523d82523d6000602084013e61180d565b606091505b50817fd58d1183100bd0932c0588f31c4205d6bc6168909765a96c41adbed3115f36288260405161183e9190612da4565b60405180910390a250611878565b60405181907f7b78aadacff901d8b63d0dba4f86283d4db8aef27f9ed70413dd860f1c9532b690600090a25b50505050565b601481565b61100381565b60005460ff16156118ac5760405162461bcd60e51b815260040161053190613296565b603260045560966005556000805460ff19166001179055565b60085481565b61100081565b600381565b33611000146118f75760405162461bcd60e51b81526004016105319061312e565b60005460ff166119195760405162461bcd60e51b815260040161053190612e9f565b60015461192557611d1d565b600154600090600019015b808211611cf1576000805b82841015611a545761194b612837565b600260006001878154811061195c57fe5b60009182526020808320909101546001600160a01b0316835282810193909352604091820190208151606081018352815481526001820154938101939093526002015460ff161515908201526005549091506004900481602001511115611a3e576004600554816119c957fe5b048160200151038160200181815250508060026000600188815481106119eb57fe5b6000918252602080832091909101546001600160a01b0316835282810193909352604091820190208351815591830151600183015591909101516002909101805460ff1916911515919091179055611a48565b6001925050611a54565b5083600101935061193b565b828411611beb57611a63612837565b6002600060018681548110611a7457fe5b60009182526020808320909101546001600160a01b0316835282810193909352604091820190208151606081018352815481526001820154938101939093526002015460ff161515908201526005549091506004900481602001511115611b5c57600460055481611ae157fe5b04816020015103816020018181525050806002600060018781548110611b0357fe5b6000918252602080832091909101546001600160a01b03168352828101939093526040918201902083518155918301516001808401919091559201516002909101805460ff19169115159190911790559150611beb9050565b6002600060018681548110611b6d57fe5b60009182526020808320909101546001600160a01b031683528201929092526040018120818155600181810192909255600201805460ff19169055805480611bb157fe5b600082815260209020810160001990810180546001600160a01b031916905501905583611bde5750611beb565b5060001990920191611a54565b818015611bf55750805b15611cd4576002600060018681548110611c0b57fe5b60009182526020808320909101546001600160a01b031683528201929092526040018120818155600181810192909255600201805460ff19169055805484908110611c5257fe5b600091825260209091200154600180546001600160a01b039092169186908110611c7857fe5b9060005260206000200160006101000a8154816001600160a01b0302191690836001600160a01b031602179055506001805480611cb157fe5b600082815260209020810160001990810180546001600160a01b03191690550190555b82611ce0575050611cf1565b505060019091019060001901611930565b6040517fcfdb3b6ccaeccbdc68be3c59c840e3b3c90f0a7c491f5fff1cf56cfda200dd9c90600090a150505b565b61100481565b60408051600480825260a08201909252606091829190816020015b6060815260200190600190039081611d40579050509050611d69836001600160a01b0316612191565b81600081518110611d7657fe5b6020026020010181905250611d8a436121b4565b81600181518110611d9757fe5b6020908102919091010152611dac60386121b4565b81600281518110611db957fe5b6020026020010181905250611dcd426121b4565b81600381518110611dda57fe5b6020026020010181905250611dee816121c7565b9150505b919050565b611dff61285a565b6000611e0961285a565b611e1161286c565b611e22611e1d86612251565b612276565b90506000805b611e31836122c0565b15611e6a5780611e5d57611e4c611e47846122e1565b61232f565b63ffffffff16845260019150611e62565b611e6a565b600101611e28565b5091935090915050915091565b600081604051602001611e8a9190612d50565b6040516020818303038152906040528051906020012083604051602001611eb19190612d50565b604051602081830303815290604052805190602001201490505b92915050565b015190565b8082015160009060ff811615611ef0576001915081611ef6565b60009150815b505092915050565b60408051600480825260a0820190925260009160609190816020015b6060815260200190600190039081611f1a575050604080516020808252818301909252919250606091908082018180368337019050509050611f5f85600001516121b4565b82600081518110611f6c57fe5b6020026020010181905250611f8760208660200151836123b1565b611f90816123c1565b82600181518110611f9d57fe5b6020026020010181905250611fb585604001516121b4565b82600281518110611fc257fe5b6020026020010181905250611fdd60208660600151836123b1565b611fe6816123c1565b82600381518110611ff357fe5b6020026020010181905250612019602061200c846121c7565b80519060200120836123b1565b6040805160b080825260e08201909252606091602082018180368337019050509050612049818360006020612417565b61205b81876080015160206060612417565b612069818660806030612417565b604080516001808252818301909252606091602082018180368337019050509050815160016020830182602086016066600019fa6120a657600080fd5b5060016120b482600061246a565b60ff16146120c9576000945050505050611ecb565b5060019695505050505050565b8151815160009160019181148083146120f25760009250612130565b600160208701838101602088015b60028483851001141561212b57805183511461211f5760009650600093505b60209283019201612100565b505050505b5090949350505050565b6000816020018351101561214d57600080fd5b50016020015190565b60408051600480825260a08201909252606091829190816020015b6060815260200190600190039081612171579050509050611d69836123c1565b60408051600560a21b8318601482015260348101909152606090611dee816123c1565b6060611ecb6121c283612486565b6123c1565b60608151600014156121e85750604080516000815260208101909152611df2565b6060826000815181106121f757fe5b602002602001015190506000600190505b83518110156122385761222e8285838151811061222157fe5b602002602001015161256c565b9150600101612208565b50611dee61224b825160c060ff166125e9565b8261256c565b61225961288c565b506040805180820190915281518152602082810190820152919050565b61227e61286c565b612287826126bb565b61229057600080fd5b600061229f83602001516126f5565b60208085015160408051808201909152868152920190820152915050919050565b60006122ca61288c565b505080518051602091820151919092015191011190565b6122e961288c565b6122f2826122c0565b6122fb57600080fd5b6020820151600061230b82612758565b80830160209586015260408051808201909152908152938401919091525090919050565b80516000901580159061234457508151602110155b61234d57600080fd5b600061235c83602001516126f5565b905080836000015110156123825760405162461bcd60e51b8152600401610531906132cd565b8251602080850151830180519284900392918310156123a857826020036101000a820491505b50949350505050565b9091018181526020918201910152565b6060815160011480156123f35750607f60f81b826000815181106123e157fe5b01602001516001600160f81b03191611155b156123ff575080611df2565b611ecb6124118351608060ff166125e9565b8361256c565b60005b818110156106ef5783818151811061242e57fe5b602001015160f81c60f81b85848060010195508151811061244b57fe5b60200101906001600160f81b031916908160001a90535060010161241a565b6000816001018351101561247d57600080fd5b50016001015190565b604080516020808252818301909252606091829190602082018180368337505050602081018490529050600067ffffffffffffffff1984166124ca575060186124ee565b6fffffffffffffffffffffffffffffffff1984166124ea575060106124ee565b5060005b60208110156125245781818151811061250357fe5b01602001516001600160f81b0319161561251c57612524565b6001016124ee565b60008160200390506060816040519080825280601f01601f191660200182016040528015612559576020820181803683370190505b5080830196909652508452509192915050565b6060806040519050835180825260208201818101602087015b8183101561259d578051835260209283019201612585565b50855184518101855292509050808201602086015b818310156125ca5780518352602092830192016125b2565b508651929092011591909101601f01601f191660405250905092915050565b60606801000000000000000083106126135760405162461bcd60e51b81526004016105319061300f565b6040805160018082528183019092526060916020820181803683370190505090506037841161266d5782840160f81b8160008151811061264f57fe5b60200101906001600160f81b031916908160001a9053509050611ecb565b606061267885612486565b90508381510160370160f81b8260008151811061269157fe5b60200101906001600160f81b031916908160001a9053506126b2828261256c565b95945050505050565b80516000906126cc57506000611df2565b6020820151805160001a9060c08210156126eb57600092505050611df2565b5060019392505050565b8051600090811a608081101561270f576000915050611df2565b60b881108061272a575060c0811080159061272a575060f881105b15612739576001915050611df2565b60c081101561274d5760b519019050611df2565b60f519019050611df2565b80516000908190811a60808110156127735760019150612830565b60b881101561278857607e1981019150612830565b60c08110156127d957600060b78203600186019550806020036101000a8651049150600181018201935050808310156127d35760405162461bcd60e51b81526004016105319061317e565b50612830565b60f88110156127ee5760be1981019150612830565b600060f78203600186019550806020036101000a865104915060018101820193505080831015611ef65760405162461bcd60e51b81526004016105319061317e565b5092915050565b604051806060016040528060008152602001600081526020016000151581525090565b60408051602081019091526000815290565b604051806040016040528061287f61288c565b8152602001600081525090565b604051806040016040528060008152602001600081525090565b600082601f8301126128b6578081fd5b81516128c96128c4826135c2565b61359b565b818152915060208083019084810160005b8481101561293f578151870188603f8201126128f557600080fd5b838101516129056128c4826135e2565b81815260408b8184860101111561291b57600080fd5b61292a83888401838701613606565b508652505092820192908201906001016128da565b505050505092915050565b60008083601f84011261295b578182fd5b50813567ffffffffffffffff811115612972578182fd5b60208301915083602082850101111561298a57600080fd5b9250929050565b600082601f8301126129a1578081fd5b81356129af6128c4826135e2565b91508082528360208285010111156129c657600080fd5b8060208401602084013760009082016020015292915050565b600060a082840312156129f0578081fd5b6129fa60a061359b565b905081358152602082013560208201526040820135604082015260608201356060820152608082013567ffffffffffffffff811115612a3857600080fd5b612a4484828501612991565b60808301525092915050565b600060208284031215612a61578081fd5b8135612a6c81613632565b9392505050565b60008060408385031215612a85578081fd5b825167ffffffffffffffff80821115612a9c578283fd5b81850186601f820112612aad578384fd5b80519250612abd6128c4846135c2565b80848252602080830192508084018a828389028701011115612add578788fd5b8794505b86851015612b08578051612af481613632565b845260019490940193928101928101612ae1565b508801519096509350505080821115612b1f578283fd5b50612b2c858286016128a6565b9150509250929050565b600060208284031215612b47578081fd5b81518015158114612a6c578182fd5b60008060008060408587031215612b6b578182fd5b843567ffffffffffffffff80821115612b82578384fd5b612b8e8883890161294a565b90965094506020870135915080821115612ba6578384fd5b50612bb38782880161294a565b95989497509550505050565b600060208284031215612bd0578081fd5b813567ffffffffffffffff80821115612be7578283fd5b81840160608187031215612bf9578384fd5b612c03606061359b565b9250803582811115612c13578485fd5b612c1f878284016129df565b845250602081013582811115612c33578485fd5b612c3f878284016129df565b602085015250604081013582811115612c56578485fd5b612c6287828401612991565b6040850152509195945050505050565b600060208284031215612c83578081fd5b5035919050565b600060208284031215612c9b578081fd5b5051919050565b600080600060408486031215612cb6578283fd5b833560ff81168114612cc6578384fd5b9250602084013567ffffffffffffffff811115612ce1578283fd5b612ced8682870161294a565b9497909650939450505050565b60008284528282602086013780602084860101526020601f19601f85011685010190509392505050565b60008151808452612d3c816020860160208601613606565b601f01601f19169290920160200192915050565b60008251612d62818460208701613606565b9190910192915050565b6001600160a01b0391909116815260200190565b6001600160a01b03929092168252602082015260400190565b901515815260200190565b600060208252612a6c6020830184612d24565b600060408252612dcb604083018688612cfa565b8281036020840152612dde818587612cfa565b979650505050505050565b6020808252602a908201527f6c656e677468206f66206d616c6963696f7573566f7465536c61736853636f706040820152690ca40dad2e6dac2e8c6d60b31b606082015260800190565b6020808252601f908201527f746865206d73672073656e646572206973206e6f7420612072656c6179657200604082015260600190565b6020808252818101527f6d616c6963696f757320766f746520736c617368206e6f7420656e61626c6564604082015260600190565b60208082526019908201527f74686520636f6e7472616374206e6f7420696e69742079657400000000000000604082015260600190565b6020808252602b908201527f746865206d616c6963696f757320766f746520736c6173682073636f7065206f60408201526a7574206f662072616e676560a81b606082015260800190565b6020808252601a908201527f6e6f2076696f6c6174696f6e206f6620766f74652072756c6573000000000000604082015260600190565b6020808252818101527f7468652066656c6f6e795468726573686f6c64206f7574206f662072616e6765604082015260600190565b6020808252602b908201527f6c656e677468206f6620656e61626c654d616c6963696f7573566f7465536c6160408201526a0e6d040dad2e6dac2e8c6d60ab1b606082015260800190565b60208082526017908201527f766572696679207369676e6174757265206661696c6564000000000000000000604082015260600190565b6020808252600e908201526d696e70757420746f6f206c6f6e6760901b604082015260600190565b60208082526019908201527f7372634e756d20626967676572207468616e207461724e756d00000000000000604082015260600190565b6020808252602c908201527f7468652066696e616c69747920736c6173682072657761726420726174696f2060408201526b6f7574206f662072616e676560a01b606082015260800190565b60208082526027908201527f6c656e677468206f66206d697364656d65616e6f725468726573686f6c64206d6040820152660d2e6dac2e8c6d60cb1b606082015260800190565b60208082526013908201527274776f206964656e746963616c20766f74657360681b604082015260600190565b60208082526030908201527f746865206d6573736167652073656e646572206d7573742062652076616c696460408201526f185d1bdc94d95d0818dbdb9d1c9858dd60821b606082015260800190565b6020808252601190820152706164646974696f6e206f766572666c6f7760781b604082015260600190565b6020808252601490820152736761737072696365206973206e6f74207a65726f60601b604082015260600190565b6020808252601590820152741d9bdd195059191c881a5cc81b9bdd08199bdd5b99605a1b604082015260600190565b6020808252602e908201527f746865206d6573736167652073656e646572206d75737420626520676f76657260408201526d1b985b98d94818dbdb9d1c9858dd60921b606082015260800190565b60208082526022908201527f6c656e677468206f662066656c6f6e795468726573686f6c64206d69736d61746040820152610c6d60f31b606082015260800190565b60208082526019908201527f74686520636f6e747261637420616c726561647920696e697400000000000000604082015260600190565b6020808252601a908201527f6c656e677468206973206c657373207468616e206f6666736574000000000000604082015260600190565b60208082526025908201527f746865206d697364656d65616e6f725468726573686f6c64206f7574206f662060408201526472616e676560d81b606082015260800190565b6020808252602f908201527f746865206d6573736167652073656e646572206d7573742062652063726f737360408201526e0818da185a5b8818dbdb9d1c9858dd608a1b606082015260800190565b6020808252602d908201527f746865206d6573736167652073656e646572206d75737420626520746865206260408201526c3637b1b590383937b23ab1b2b960991b606082015260800190565b6020808252600d908201526c756e6b6e6f776e20706172616d60981b604082015260600190565b6020808252601490820152731d185c99d95d08189b1bd8dac81d1bdbc81bdb1960621b604082015260600190565b6020808252601e908201527f7265636569766520756e65787065637465642073796e207061636b6167650000604082015260600190565b6020808252602b908201527f6c656e677468206f662066696e616c697479536c61736852657761726452617460408201526a0d2de40dad2e6dac2e8c6d60ab1b606082015260800190565b6020808252818101527f63616e206e6f7420736c61736820747769636520696e206f6e6520626c6f636b604082015260600190565b61ffff91909116815260200190565b90815260200190565b6000838252604060208301526135226040830184612d24565b949350505050565b918252602082015260400190565b92835260208301919091521515604082015260600190565b63ffffffff91909116815260200190565b60ff91909116815260200190565b600060ff851682526060602083015261358b6060830185612d24565b9050826040830152949350505050565b60405181810167ffffffffffffffff811182821017156135ba57600080fd5b604052919050565b600067ffffffffffffffff8211156135d8578081fd5b5060209081020190565b600067ffffffffffffffff8211156135f8578081fd5b50601f01601f191660200190565b60005b83811015613621578181015183820152602001613609565b838111156118785750506000910152565b6001600160a01b038116811461364757600080fd5b5056fea164736f6c6343000604000a", + }, + }, + } + + keplerUpgrade[chapelNet] = &Upgrade{ + UpgradeName: "kepler", + Configs: []*UpgradeConfig{ + { + ContractAddr: common.HexToAddress(SlashContract), + CommitUrl: "https://github.com/NathanBSC/bsc-genesis-contract/commit/a9a7ff5b74df13017b56b040bd484bc7726adb2d", + Code: "608060405234801561001057600080fd5b50600436106102955760003560e01c80638256ace611610167578063c81b1662116100ce578063e1c7392a11610087578063e1c7392a146104d3578063eb57bff7146104db578063f9a2bbc7146104e3578063fc3e5908146104eb578063fc4333cd146104f3578063fd6a6879146104fb57610295565b8063c81b166214610482578063c8509d811461048a578063c96be4cb1461049d578063cc844b73146104b0578063d2a42e4b146104c3578063dc927faf146104cb57610295565b8063a78abc1611610120578063a78abc1614610447578063ab51bb961461044f578063ac0af62914610457578063ac4317511461045f578063ae61dc3b14610472578063c80d4b8f1461047a57610295565b80638256ace61461040c578063831d65d11461041457806396713da9146104275780639bc8e4f21461042f5780639dc0926214610437578063a1a11bf51461043f57610295565b8063493279b11161020b5780636e47b482116101c45780636e47b482146103dc57806370fd5bad146103e4578063718a8aa8146103ec57806375d47a0a146103f45780637912a65d146103fc5780637942fd051461040457610295565b8063493279b1146103925780634bf6c882146103a757806351e80672146103af578063567a372d146103b75780635bfb4990146103bf57806362b72cf5146103d457610295565b806335aa2e441161025d57806335aa2e441461032457806337c8dab914610337578063389f4f71146103585780633a63f4b11461036d5780633dffc3871461037557806343756e5c1461038a57610295565b80630bee7a671461029a5780630e2374a5146102b85780631182b875146102cd57806322d1e80b146102ed57806323bac5a214610302575b600080fd5b6102a2610503565b6040516102af9190613550565b60405180910390f35b6102c0610508565b6040516102af9190612d6c565b6102e06102db366004612ca2565b61050e565b6040516102af9190612da4565b6102f5610574565b6040516102af9190612d99565b610315610310366004612a50565b61057d565b6040516102af93929190613538565b6102c0610332366004612c72565b6105a0565b61034a610345366004612a50565b6105c7565b6040516102af92919061352a565b61036061061e565b6040516102af9190613500565b610360610624565b61037d61062a565b6040516102af9190613561565b6102c061062f565b61039a610635565b6040516102af91906134f1565b61037d61063a565b6102c061063f565b610360610645565b6103d26103cd366004612a50565b61064b565b005b6103606106f6565b6102c06106fc565b61037d610702565b61037d610707565b6102c061070c565b610360610712565b61037d610717565b61034a61071c565b6103d2610422366004612ca2565b610726565b61037d610838565b61036061083d565b6102c0610848565b6102c061084e565b6102f5610854565b6102a261085d565b610360610862565b6103d261046d366004612b56565b610867565b610360610e17565b610360610e1e565b6102c0610e23565b6103d2610498366004612ca2565b610e29565b6103d26104ab366004612a50565b610e9a565b6103d26104be366004612bbf565b61128b565b61036061187e565b6102c0611883565b6103d2611889565b6103606118c5565b6102c06118cb565b61037d6118d1565b6103d26118d6565b6102c0611d1f565b606481565b61200181565b6060336120001461053a5760405162461bcd60e51b815260040161053190613349565b60405180910390fd5b60005460ff1661055c5760405162461bcd60e51b815260040161053190612e9f565b60405162461bcd60e51b81526004016105319061343a565b60075460ff1681565b600260208190526000918252604090912080546001820154919092015460ff1683565b600181815481106105ad57fe5b6000918252602090912001546001600160a01b0316905081565b6000806105d2612837565b5050506001600160a01b0316600090815260026020818152604092839020835160608101855281548082526001830154938201849052919093015460ff16151592909301919091529091565b60055481565b60065481565b600181565b61100181565b606181565b600881565b61200081565b60045481565b336110001461066c5760405162461bcd60e51b81526004016105319061312e565b60005460ff1661068e5760405162461bcd60e51b815260040161053190612e9f565b61200063f7a251d7600b6106a184611d25565b60006040518463ffffffff1660e01b81526004016106c19392919061356f565b600060405180830381600087803b1580156106db57600080fd5b505af11580156106ef573d6000803e3d6000fd5b5050505050565b60035481565b61100581565b600281565b601081565b61100881565b603281565b600b81565b6004546005549091565b33612000146107475760405162461bcd60e51b815260040161053190613349565b60005460ff166107695760405162461bcd60e51b815260040161053190612e9f565b61077161285a565b60006107b284848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611df792505050565b9150915080156107f95781516040517f7f0956d47419b9525356e7111652b653b530ec6f5096dccc04589bc38e629967916107ec91613550565b60405180910390a16106ef565b81516040517f7d45f62d17443dd4547bca8a8112c60e2385669318dc300ec61a5d2492f262e79161082991613550565b60405180910390a15050505050565b600981565b662386f26fc1000081565b61100781565b61100681565b60005460ff1681565b600081565b600481565b60005460ff166108895760405162461bcd60e51b815260040161053190612e9f565b33611007146108aa5760405162461bcd60e51b815260040161053190613206565b61091584848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250506040805180820190915260148152731b5a5cd9195b59585b9bdc951a1c995cda1bdb1960621b60208201529150611e779050565b156109b0576020811461093a5760405162461bcd60e51b8152600401610531906130ba565b604080516020601f840181900481028201810190925282815260009161097891858580838501838280828437600092019190915250611ed192505050565b90506001811015801561098c575060055481105b6109a85760405162461bcd60e51b815260040161053190613304565b600455610dd4565b610a1684848080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505060408051808201909152600f81526e19995b1bdb9e551a1c995cda1bdb19608a1b60208201529150611e779050565b15610ab25760208114610a3b5760405162461bcd60e51b815260040161053190613254565b604080516020601f8401819004810282018101909252828152600091610a7991858580838501838280828437600092019190915250611ed192505050565b90506103e88111158015610a8e575060045481115b610aaa5760405162461bcd60e51b815260040161053190612f58565b600555610dd4565b610b2684848080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505060408051808201909152601881527f66696e616c697479536c617368526577617264526174696f000000000000000060208201529150611e779050565b15610bc05760208114610b4b5760405162461bcd60e51b815260040161053190613471565b604080516020601f8401819004810282018101909252828152600091610b8991858580838501838280828437600092019190915250611ed192505050565b9050600a8110158015610b9c5750606481105b610bb85760405162461bcd60e51b81526004016105319061306e565b600655610dd4565b610c3484848080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505060408051808201909152601881527f656e61626c654d616c6963696f7573566f7465536c617368000000000000000060208201529150611e779050565b15610cab5760208114610c595760405162461bcd60e51b815260040161053190612f8d565b604080516020601f8401819004810282018101909252828152610c959190848480838501838280828437600092019190915250611ed692505050565b6007805460ff1916911515919091179055610dd4565b610d1f84848080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505060408051808201909152601781527f6d616c6963696f7573566f7465536c61736853636f706500000000000000000060208201529150611e779050565b15610dbc5760208114610d445760405162461bcd60e51b815260040161053190612de9565b604080516020601f8401819004810282018101909252828152600091610d8291858580838501838280828437600092019190915250611ed192505050565b90506170808110158015610d985750620d2f0081105b610db45760405162461bcd60e51b815260040161053190612ed6565b600855610dd4565b60405162461bcd60e51b8152600401610531906133e5565b7f6cdb0ac70ab7f2e2d035cca5be60d89906f2dede7648ddbd7402189c1eeed17a84848484604051610e099493929190612db7565b60405180910390a150505050565b6201518081565b609681565b61100281565b3361200014610e4a5760405162461bcd60e51b815260040161053190613349565b60005460ff16610e6c5760405162461bcd60e51b815260040161053190612e9f565b6040517f07db600eebe2ac176be8dcebad61858c245a4961bb32ca2aa3d159b09aa0810e90600090a1505050565b334114610eb95760405162461bcd60e51b815260040161053190613398565b60005460ff16610edb5760405162461bcd60e51b815260040161053190612e9f565b6003544311610efc5760405162461bcd60e51b8152600401610531906134bc565b3a15610f1a5760405162461bcd60e51b8152600401610531906131a9565b60405163155853f360e21b8152611000906355614fcc90610f3f908490600401612d6c565b60206040518083038186803b158015610f5757600080fd5b505afa158015610f6b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f8f9190612b36565b610f9857611284565b610fa0612837565b506001600160a01b0381166000908152600260208181526040928390208351606081018552815481526001820154928101929092529091015460ff161580159282019290925290610ffb576020810180516001019052611054565b60016040820181905260208201819052805480820182556000919091527fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf60180546001600160a01b0319166001600160a01b0384161790555b43815260055460208201518161106657fe5b066111b257600060208201526040516335409f7f60e01b8152611000906335409f7f90611097908590600401612d6c565b600060405180830381600087803b1580156110b157600080fd5b505af11580156110c5573d6000803e3d6000fd5b505050506120006001600160a01b031663f7a251d7600b6110e585611d25565b60006040518463ffffffff1660e01b81526004016111059392919061356f565b600060405180830381600087803b15801561111f57600080fd5b505af1925050508015611130575060015b6111ad573d80801561115e576040519150601f19603f3d011682016040523d82523d6000602084013e611163565b606091505b50826001600160a01b03167fd7bc86ff5d08c8ab043edec743302aba2520e6635172a428bc956721db9e2d1c8360200151836040516111a3929190613509565b60405180910390a2505b61121e565b6004548160200151816111c157fe5b0661121e576040516375abf10160e11b81526110009063eb57e202906111eb908590600401612d6c565b600060405180830381600087803b15801561120557600080fd5b505af1158015611219573d6000803e3d6000fd5b505050505b6001600160a01b0382166000818152600260208181526040808420865181559186015160018301558581015191909201805460ff1916911515919091179055517fddb6012116e51abf5436d956a4f0ebd927e92c576ff96d7918290c8782291e3e9190a2505b5043600355565b60005460ff166112ad5760405162461bcd60e51b815260040161053190612e9f565b604051630a83aaa960e31b81526110069063541d5548906112d2903390600401612d6c565b60206040518083038186803b1580156112ea57600080fd5b505afa1580156112fe573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113229190612b36565b61133e5760405162461bcd60e51b815260040161053190612e33565b60075460ff166113605760405162461bcd60e51b815260040161053190612e6a565b60065461136d5760146006555b60085461137c57620151806008555b6008548151604001514391011180156113a057504360085482602001516040015101115b6113bc5760405162461bcd60e51b81526004016105319061340c565b8060200151602001518160000151602001511480156113ea5750806020015160600151816000015160600151145b156114075760405162461bcd60e51b815260040161053190613101565b8051604081015190511080156114265750602081015160408101519051105b6114425760405162461bcd60e51b815260040161053190613037565b6020810151518151511080156114675750806000015160400151816020015160400151105b8061149257508051516020820151511080156114925750806020015160400151816000015160400151105b806114ac5750806020015160400151816000015160400151145b6114c85760405162461bcd60e51b815260040161053190612f21565b604080820151905163ea321e4960e01b81526110009163ea321e49916114f19190600401612da4565b60206040518083038186803b15801561150957600080fd5b505afa15801561151d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115419190612b36565b61155d5760405162461bcd60e51b8152600401610531906131d7565b61156f81600001518260400151611efe565b8015611588575061158881602001518260400151611efe565b6115a45760405162461bcd60e51b815260040161053190612fd8565b6060806110006001600160a01b0316633b071dcc6040518163ffffffff1660e01b815260040160006040518083038186803b1580156115e257600080fd5b505afa1580156115f6573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261161e9190810190612a73565b9150915060005b815181101561175b5761164f82828151811061163d57fe5b602002602001015185604001516120d6565b15611753576006546040516309a99b4f60e41b815260646110028031909302049190639a99b4f0906116879033908590600401612d80565b602060405180830381600087803b1580156116a157600080fd5b505af11580156116b5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116d99190612c8a565b506110006001600160a01b03166335409f7f8584815181106116f757fe5b60200260200101516040518263ffffffff1660e01b815260040161171b9190612d6c565b600060405180830381600087803b15801561173557600080fd5b505af1158015611749573d6000803e3d6000fd5b505050505061175b565b600101611625565b50600061176d8460400151600061213a565b90506120006001600160a01b031663f7a251d7600b61178f8760400151612156565b60006040518463ffffffff1660e01b81526004016117af9392919061356f565b600060405180830381600087803b1580156117c957600080fd5b505af19250505080156117da575060015b61184c573d808015611808576040519150601f19603f3d011682016040523d82523d6000602084013e61180d565b606091505b50817fd58d1183100bd0932c0588f31c4205d6bc6168909765a96c41adbed3115f36288260405161183e9190612da4565b60405180910390a250611878565b60405181907f7b78aadacff901d8b63d0dba4f86283d4db8aef27f9ed70413dd860f1c9532b690600090a25b50505050565b601481565b61100381565b60005460ff16156118ac5760405162461bcd60e51b815260040161053190613296565b603260045560966005556000805460ff19166001179055565b60085481565b61100081565b600381565b33611000146118f75760405162461bcd60e51b81526004016105319061312e565b60005460ff166119195760405162461bcd60e51b815260040161053190612e9f565b60015461192557611d1d565b600154600090600019015b808211611cf1576000805b82841015611a545761194b612837565b600260006001878154811061195c57fe5b60009182526020808320909101546001600160a01b0316835282810193909352604091820190208151606081018352815481526001820154938101939093526002015460ff161515908201526005549091506004900481602001511115611a3e576004600554816119c957fe5b048160200151038160200181815250508060026000600188815481106119eb57fe5b6000918252602080832091909101546001600160a01b0316835282810193909352604091820190208351815591830151600183015591909101516002909101805460ff1916911515919091179055611a48565b6001925050611a54565b5083600101935061193b565b828411611beb57611a63612837565b6002600060018681548110611a7457fe5b60009182526020808320909101546001600160a01b0316835282810193909352604091820190208151606081018352815481526001820154938101939093526002015460ff161515908201526005549091506004900481602001511115611b5c57600460055481611ae157fe5b04816020015103816020018181525050806002600060018781548110611b0357fe5b6000918252602080832091909101546001600160a01b03168352828101939093526040918201902083518155918301516001808401919091559201516002909101805460ff19169115159190911790559150611beb9050565b6002600060018681548110611b6d57fe5b60009182526020808320909101546001600160a01b031683528201929092526040018120818155600181810192909255600201805460ff19169055805480611bb157fe5b600082815260209020810160001990810180546001600160a01b031916905501905583611bde5750611beb565b5060001990920191611a54565b818015611bf55750805b15611cd4576002600060018681548110611c0b57fe5b60009182526020808320909101546001600160a01b031683528201929092526040018120818155600181810192909255600201805460ff19169055805484908110611c5257fe5b600091825260209091200154600180546001600160a01b039092169186908110611c7857fe5b9060005260206000200160006101000a8154816001600160a01b0302191690836001600160a01b031602179055506001805480611cb157fe5b600082815260209020810160001990810180546001600160a01b03191690550190555b82611ce0575050611cf1565b505060019091019060001901611930565b6040517fcfdb3b6ccaeccbdc68be3c59c840e3b3c90f0a7c491f5fff1cf56cfda200dd9c90600090a150505b565b61100481565b60408051600480825260a08201909252606091829190816020015b6060815260200190600190039081611d40579050509050611d69836001600160a01b0316612191565b81600081518110611d7657fe5b6020026020010181905250611d8a436121b4565b81600181518110611d9757fe5b6020908102919091010152611dac60616121b4565b81600281518110611db957fe5b6020026020010181905250611dcd426121b4565b81600381518110611dda57fe5b6020026020010181905250611dee816121c7565b9150505b919050565b611dff61285a565b6000611e0961285a565b611e1161286c565b611e22611e1d86612251565b612276565b90506000805b611e31836122c0565b15611e6a5780611e5d57611e4c611e47846122e1565b61232f565b63ffffffff16845260019150611e62565b611e6a565b600101611e28565b5091935090915050915091565b600081604051602001611e8a9190612d50565b6040516020818303038152906040528051906020012083604051602001611eb19190612d50565b604051602081830303815290604052805190602001201490505b92915050565b015190565b8082015160009060ff811615611ef0576001915081611ef6565b60009150815b505092915050565b60408051600480825260a0820190925260009160609190816020015b6060815260200190600190039081611f1a575050604080516020808252818301909252919250606091908082018180368337019050509050611f5f85600001516121b4565b82600081518110611f6c57fe5b6020026020010181905250611f8760208660200151836123b1565b611f90816123c1565b82600181518110611f9d57fe5b6020026020010181905250611fb585604001516121b4565b82600281518110611fc257fe5b6020026020010181905250611fdd60208660600151836123b1565b611fe6816123c1565b82600381518110611ff357fe5b6020026020010181905250612019602061200c846121c7565b80519060200120836123b1565b6040805160b080825260e08201909252606091602082018180368337019050509050612049818360006020612417565b61205b81876080015160206060612417565b612069818660806030612417565b604080516001808252818301909252606091602082018180368337019050509050815160016020830182602086016066600019fa6120a657600080fd5b5060016120b482600061246a565b60ff16146120c9576000945050505050611ecb565b5060019695505050505050565b8151815160009160019181148083146120f25760009250612130565b600160208701838101602088015b60028483851001141561212b57805183511461211f5760009650600093505b60209283019201612100565b505050505b5090949350505050565b6000816020018351101561214d57600080fd5b50016020015190565b60408051600480825260a08201909252606091829190816020015b6060815260200190600190039081612171579050509050611d69836123c1565b60408051600560a21b8318601482015260348101909152606090611dee816123c1565b6060611ecb6121c283612486565b6123c1565b60608151600014156121e85750604080516000815260208101909152611df2565b6060826000815181106121f757fe5b602002602001015190506000600190505b83518110156122385761222e8285838151811061222157fe5b602002602001015161256c565b9150600101612208565b50611dee61224b825160c060ff166125e9565b8261256c565b61225961288c565b506040805180820190915281518152602082810190820152919050565b61227e61286c565b612287826126bb565b61229057600080fd5b600061229f83602001516126f5565b60208085015160408051808201909152868152920190820152915050919050565b60006122ca61288c565b505080518051602091820151919092015191011190565b6122e961288c565b6122f2826122c0565b6122fb57600080fd5b6020820151600061230b82612758565b80830160209586015260408051808201909152908152938401919091525090919050565b80516000901580159061234457508151602110155b61234d57600080fd5b600061235c83602001516126f5565b905080836000015110156123825760405162461bcd60e51b8152600401610531906132cd565b8251602080850151830180519284900392918310156123a857826020036101000a820491505b50949350505050565b9091018181526020918201910152565b6060815160011480156123f35750607f60f81b826000815181106123e157fe5b01602001516001600160f81b03191611155b156123ff575080611df2565b611ecb6124118351608060ff166125e9565b8361256c565b60005b818110156106ef5783818151811061242e57fe5b602001015160f81c60f81b85848060010195508151811061244b57fe5b60200101906001600160f81b031916908160001a90535060010161241a565b6000816001018351101561247d57600080fd5b50016001015190565b604080516020808252818301909252606091829190602082018180368337505050602081018490529050600067ffffffffffffffff1984166124ca575060186124ee565b6fffffffffffffffffffffffffffffffff1984166124ea575060106124ee565b5060005b60208110156125245781818151811061250357fe5b01602001516001600160f81b0319161561251c57612524565b6001016124ee565b60008160200390506060816040519080825280601f01601f191660200182016040528015612559576020820181803683370190505b5080830196909652508452509192915050565b6060806040519050835180825260208201818101602087015b8183101561259d578051835260209283019201612585565b50855184518101855292509050808201602086015b818310156125ca5780518352602092830192016125b2565b508651929092011591909101601f01601f191660405250905092915050565b60606801000000000000000083106126135760405162461bcd60e51b81526004016105319061300f565b6040805160018082528183019092526060916020820181803683370190505090506037841161266d5782840160f81b8160008151811061264f57fe5b60200101906001600160f81b031916908160001a9053509050611ecb565b606061267885612486565b90508381510160370160f81b8260008151811061269157fe5b60200101906001600160f81b031916908160001a9053506126b2828261256c565b95945050505050565b80516000906126cc57506000611df2565b6020820151805160001a9060c08210156126eb57600092505050611df2565b5060019392505050565b8051600090811a608081101561270f576000915050611df2565b60b881108061272a575060c0811080159061272a575060f881105b15612739576001915050611df2565b60c081101561274d5760b519019050611df2565b60f519019050611df2565b80516000908190811a60808110156127735760019150612830565b60b881101561278857607e1981019150612830565b60c08110156127d957600060b78203600186019550806020036101000a8651049150600181018201935050808310156127d35760405162461bcd60e51b81526004016105319061317e565b50612830565b60f88110156127ee5760be1981019150612830565b600060f78203600186019550806020036101000a865104915060018101820193505080831015611ef65760405162461bcd60e51b81526004016105319061317e565b5092915050565b604051806060016040528060008152602001600081526020016000151581525090565b60408051602081019091526000815290565b604051806040016040528061287f61288c565b8152602001600081525090565b604051806040016040528060008152602001600081525090565b600082601f8301126128b6578081fd5b81516128c96128c4826135c2565b61359b565b818152915060208083019084810160005b8481101561293f578151870188603f8201126128f557600080fd5b838101516129056128c4826135e2565b81815260408b8184860101111561291b57600080fd5b61292a83888401838701613606565b508652505092820192908201906001016128da565b505050505092915050565b60008083601f84011261295b578182fd5b50813567ffffffffffffffff811115612972578182fd5b60208301915083602082850101111561298a57600080fd5b9250929050565b600082601f8301126129a1578081fd5b81356129af6128c4826135e2565b91508082528360208285010111156129c657600080fd5b8060208401602084013760009082016020015292915050565b600060a082840312156129f0578081fd5b6129fa60a061359b565b905081358152602082013560208201526040820135604082015260608201356060820152608082013567ffffffffffffffff811115612a3857600080fd5b612a4484828501612991565b60808301525092915050565b600060208284031215612a61578081fd5b8135612a6c81613632565b9392505050565b60008060408385031215612a85578081fd5b825167ffffffffffffffff80821115612a9c578283fd5b81850186601f820112612aad578384fd5b80519250612abd6128c4846135c2565b80848252602080830192508084018a828389028701011115612add578788fd5b8794505b86851015612b08578051612af481613632565b845260019490940193928101928101612ae1565b508801519096509350505080821115612b1f578283fd5b50612b2c858286016128a6565b9150509250929050565b600060208284031215612b47578081fd5b81518015158114612a6c578182fd5b60008060008060408587031215612b6b578182fd5b843567ffffffffffffffff80821115612b82578384fd5b612b8e8883890161294a565b90965094506020870135915080821115612ba6578384fd5b50612bb38782880161294a565b95989497509550505050565b600060208284031215612bd0578081fd5b813567ffffffffffffffff80821115612be7578283fd5b81840160608187031215612bf9578384fd5b612c03606061359b565b9250803582811115612c13578485fd5b612c1f878284016129df565b845250602081013582811115612c33578485fd5b612c3f878284016129df565b602085015250604081013582811115612c56578485fd5b612c6287828401612991565b6040850152509195945050505050565b600060208284031215612c83578081fd5b5035919050565b600060208284031215612c9b578081fd5b5051919050565b600080600060408486031215612cb6578283fd5b833560ff81168114612cc6578384fd5b9250602084013567ffffffffffffffff811115612ce1578283fd5b612ced8682870161294a565b9497909650939450505050565b60008284528282602086013780602084860101526020601f19601f85011685010190509392505050565b60008151808452612d3c816020860160208601613606565b601f01601f19169290920160200192915050565b60008251612d62818460208701613606565b9190910192915050565b6001600160a01b0391909116815260200190565b6001600160a01b03929092168252602082015260400190565b901515815260200190565b600060208252612a6c6020830184612d24565b600060408252612dcb604083018688612cfa565b8281036020840152612dde818587612cfa565b979650505050505050565b6020808252602a908201527f6c656e677468206f66206d616c6963696f7573566f7465536c61736853636f706040820152690ca40dad2e6dac2e8c6d60b31b606082015260800190565b6020808252601f908201527f746865206d73672073656e646572206973206e6f7420612072656c6179657200604082015260600190565b6020808252818101527f6d616c6963696f757320766f746520736c617368206e6f7420656e61626c6564604082015260600190565b60208082526019908201527f74686520636f6e7472616374206e6f7420696e69742079657400000000000000604082015260600190565b6020808252602b908201527f746865206d616c6963696f757320766f746520736c6173682073636f7065206f60408201526a7574206f662072616e676560a81b606082015260800190565b6020808252601a908201527f6e6f2076696f6c6174696f6e206f6620766f74652072756c6573000000000000604082015260600190565b6020808252818101527f7468652066656c6f6e795468726573686f6c64206f7574206f662072616e6765604082015260600190565b6020808252602b908201527f6c656e677468206f6620656e61626c654d616c6963696f7573566f7465536c6160408201526a0e6d040dad2e6dac2e8c6d60ab1b606082015260800190565b60208082526017908201527f766572696679207369676e6174757265206661696c6564000000000000000000604082015260600190565b6020808252600e908201526d696e70757420746f6f206c6f6e6760901b604082015260600190565b60208082526019908201527f7372634e756d20626967676572207468616e207461724e756d00000000000000604082015260600190565b6020808252602c908201527f7468652066696e616c69747920736c6173682072657761726420726174696f2060408201526b6f7574206f662072616e676560a01b606082015260800190565b60208082526027908201527f6c656e677468206f66206d697364656d65616e6f725468726573686f6c64206d6040820152660d2e6dac2e8c6d60cb1b606082015260800190565b60208082526013908201527274776f206964656e746963616c20766f74657360681b604082015260600190565b60208082526030908201527f746865206d6573736167652073656e646572206d7573742062652076616c696460408201526f185d1bdc94d95d0818dbdb9d1c9858dd60821b606082015260800190565b6020808252601190820152706164646974696f6e206f766572666c6f7760781b604082015260600190565b6020808252601490820152736761737072696365206973206e6f74207a65726f60601b604082015260600190565b6020808252601590820152741d9bdd195059191c881a5cc81b9bdd08199bdd5b99605a1b604082015260600190565b6020808252602e908201527f746865206d6573736167652073656e646572206d75737420626520676f76657260408201526d1b985b98d94818dbdb9d1c9858dd60921b606082015260800190565b60208082526022908201527f6c656e677468206f662066656c6f6e795468726573686f6c64206d69736d61746040820152610c6d60f31b606082015260800190565b60208082526019908201527f74686520636f6e747261637420616c726561647920696e697400000000000000604082015260600190565b6020808252601a908201527f6c656e677468206973206c657373207468616e206f6666736574000000000000604082015260600190565b60208082526025908201527f746865206d697364656d65616e6f725468726573686f6c64206f7574206f662060408201526472616e676560d81b606082015260800190565b6020808252602f908201527f746865206d6573736167652073656e646572206d7573742062652063726f737360408201526e0818da185a5b8818dbdb9d1c9858dd608a1b606082015260800190565b6020808252602d908201527f746865206d6573736167652073656e646572206d75737420626520746865206260408201526c3637b1b590383937b23ab1b2b960991b606082015260800190565b6020808252600d908201526c756e6b6e6f776e20706172616d60981b604082015260600190565b6020808252601490820152731d185c99d95d08189b1bd8dac81d1bdbc81bdb1960621b604082015260600190565b6020808252601e908201527f7265636569766520756e65787065637465642073796e207061636b6167650000604082015260600190565b6020808252602b908201527f6c656e677468206f662066696e616c697479536c61736852657761726452617460408201526a0d2de40dad2e6dac2e8c6d60ab1b606082015260800190565b6020808252818101527f63616e206e6f7420736c61736820747769636520696e206f6e6520626c6f636b604082015260600190565b61ffff91909116815260200190565b90815260200190565b6000838252604060208301526135226040830184612d24565b949350505050565b918252602082015260400190565b92835260208301919091521515604082015260600190565b63ffffffff91909116815260200190565b60ff91909116815260200190565b600060ff851682526060602083015261358b6060830185612d24565b9050826040830152949350505050565b60405181810167ffffffffffffffff811182821017156135ba57600080fd5b604052919050565b600067ffffffffffffffff8211156135d8578081fd5b5060209081020190565b600067ffffffffffffffff8211156135f8578081fd5b50601f01601f191660200190565b60005b83811015613621578181015183820152602001613609565b838111156118785750506000910152565b6001600160a01b038116811461364757600080fd5b5056fea164736f6c6343000604000a", + }, + }, + } + + keplerUpgrade[rialtoNet] = &Upgrade{ + UpgradeName: "kepler", + Configs: []*UpgradeConfig{ + { + ContractAddr: common.HexToAddress(SlashContract), + CommitUrl: "https://github.com/NathanBSC/bsc-genesis-contract/commit/a9a7ff5b74df13017b56b040bd484bc7726adb2d", + Code: "608060405234801561001057600080fd5b50600436106102955760003560e01c80638256ace611610167578063c81b1662116100ce578063e1c7392a11610087578063e1c7392a146104d3578063eb57bff7146104db578063f9a2bbc7146104e3578063fc3e5908146104eb578063fc4333cd146104f3578063fd6a6879146104fb57610295565b8063c81b166214610482578063c8509d811461048a578063c96be4cb1461049d578063cc844b73146104b0578063d2a42e4b146104c3578063dc927faf146104cb57610295565b8063a78abc1611610120578063a78abc1614610447578063ab51bb961461044f578063ac0af62914610457578063ac4317511461045f578063ae61dc3b14610472578063c80d4b8f1461047a57610295565b80638256ace61461040c578063831d65d11461041457806396713da9146104275780639bc8e4f21461042f5780639dc0926214610437578063a1a11bf51461043f57610295565b8063493279b11161020b5780636e47b482116101c45780636e47b482146103dc57806370fd5bad146103e4578063718a8aa8146103ec57806375d47a0a146103f45780637912a65d146103fc5780637942fd051461040457610295565b8063493279b1146103925780634bf6c882146103a757806351e80672146103af578063567a372d146103b75780635bfb4990146103bf57806362b72cf5146103d457610295565b806335aa2e441161025d57806335aa2e441461032457806337c8dab914610337578063389f4f71146103585780633a63f4b11461036d5780633dffc3871461037557806343756e5c1461038a57610295565b80630bee7a671461029a5780630e2374a5146102b85780631182b875146102cd57806322d1e80b146102ed57806323bac5a214610302575b600080fd5b6102a2610503565b6040516102af9190613552565b60405180910390f35b6102c0610508565b6040516102af9190612d6e565b6102e06102db366004612ca4565b61050e565b6040516102af9190612da6565b6102f5610574565b6040516102af9190612d9b565b610315610310366004612a52565b61057d565b6040516102af9392919061353a565b6102c0610332366004612c74565b6105a0565b61034a610345366004612a52565b6105c7565b6040516102af92919061352c565b61036061061e565b6040516102af9190613502565b610360610624565b61037d61062a565b6040516102af9190613563565b6102c061062f565b61039a610635565b6040516102af91906134f3565b61037d61063b565b6102c0610640565b610360610646565b6103d26103cd366004612a52565b61064c565b005b6103606106f7565b6102c06106fd565b61037d610703565b61037d610708565b6102c061070d565b610360610713565b61037d610718565b61034a61071d565b6103d2610422366004612ca4565b610727565b61037d610839565b61036061083e565b6102c0610849565b6102c061084f565b6102f5610855565b6102a261085e565b610360610863565b6103d261046d366004612b58565b610868565b610360610e18565b610360610e1f565b6102c0610e24565b6103d2610498366004612ca4565b610e2a565b6103d26104ab366004612a52565b610e9b565b6103d26104be366004612bc1565b61128c565b61036061187f565b6102c0611884565b6103d261188a565b6103606118c6565b6102c06118cc565b61037d6118d2565b6103d26118d7565b6102c0611d20565b606481565b61200181565b6060336120001461053a5760405162461bcd60e51b81526004016105319061334b565b60405180910390fd5b60005460ff1661055c5760405162461bcd60e51b815260040161053190612ea1565b60405162461bcd60e51b81526004016105319061343c565b60075460ff1681565b600260208190526000918252604090912080546001820154919092015460ff1683565b600181815481106105ad57fe5b6000918252602090912001546001600160a01b0316905081565b6000806105d2612839565b5050506001600160a01b0316600090815260026020818152604092839020835160608101855281548082526001830154938201849052919093015460ff16151592909301919091529091565b60055481565b60065481565b600181565b61100181565b6102ca81565b600881565b61200081565b60045481565b336110001461066d5760405162461bcd60e51b815260040161053190613130565b60005460ff1661068f5760405162461bcd60e51b815260040161053190612ea1565b61200063f7a251d7600b6106a284611d26565b60006040518463ffffffff1660e01b81526004016106c293929190613571565b600060405180830381600087803b1580156106dc57600080fd5b505af11580156106f0573d6000803e3d6000fd5b5050505050565b60035481565b61100581565b600281565b601081565b61100881565b603281565b600b81565b6004546005549091565b33612000146107485760405162461bcd60e51b81526004016105319061334b565b60005460ff1661076a5760405162461bcd60e51b815260040161053190612ea1565b61077261285c565b60006107b384848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611df992505050565b9150915080156107fa5781516040517f7f0956d47419b9525356e7111652b653b530ec6f5096dccc04589bc38e629967916107ed91613552565b60405180910390a16106f0565b81516040517f7d45f62d17443dd4547bca8a8112c60e2385669318dc300ec61a5d2492f262e79161082a91613552565b60405180910390a15050505050565b600981565b662386f26fc1000081565b61100781565b61100681565b60005460ff1681565b600081565b600481565b60005460ff1661088a5760405162461bcd60e51b815260040161053190612ea1565b33611007146108ab5760405162461bcd60e51b815260040161053190613208565b61091684848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250506040805180820190915260148152731b5a5cd9195b59585b9bdc951a1c995cda1bdb1960621b60208201529150611e799050565b156109b1576020811461093b5760405162461bcd60e51b8152600401610531906130bc565b604080516020601f840181900481028201810190925282815260009161097991858580838501838280828437600092019190915250611ed392505050565b90506001811015801561098d575060055481105b6109a95760405162461bcd60e51b815260040161053190613306565b600455610dd5565b610a1784848080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505060408051808201909152600f81526e19995b1bdb9e551a1c995cda1bdb19608a1b60208201529150611e799050565b15610ab35760208114610a3c5760405162461bcd60e51b815260040161053190613256565b604080516020601f8401819004810282018101909252828152600091610a7a91858580838501838280828437600092019190915250611ed392505050565b90506103e88111158015610a8f575060045481115b610aab5760405162461bcd60e51b815260040161053190612f5a565b600555610dd5565b610b2784848080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505060408051808201909152601881527f66696e616c697479536c617368526577617264526174696f000000000000000060208201529150611e799050565b15610bc15760208114610b4c5760405162461bcd60e51b815260040161053190613473565b604080516020601f8401819004810282018101909252828152600091610b8a91858580838501838280828437600092019190915250611ed392505050565b9050600a8110158015610b9d5750606481105b610bb95760405162461bcd60e51b815260040161053190613070565b600655610dd5565b610c3584848080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505060408051808201909152601881527f656e61626c654d616c6963696f7573566f7465536c617368000000000000000060208201529150611e799050565b15610cac5760208114610c5a5760405162461bcd60e51b815260040161053190612f8f565b604080516020601f8401819004810282018101909252828152610c969190848480838501838280828437600092019190915250611ed892505050565b6007805460ff1916911515919091179055610dd5565b610d2084848080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505060408051808201909152601781527f6d616c6963696f7573566f7465536c61736853636f706500000000000000000060208201529150611e799050565b15610dbd5760208114610d455760405162461bcd60e51b815260040161053190612deb565b604080516020601f8401819004810282018101909252828152600091610d8391858580838501838280828437600092019190915250611ed392505050565b90506170808110158015610d995750620d2f0081105b610db55760405162461bcd60e51b815260040161053190612ed8565b600855610dd5565b60405162461bcd60e51b8152600401610531906133e7565b7f6cdb0ac70ab7f2e2d035cca5be60d89906f2dede7648ddbd7402189c1eeed17a84848484604051610e0a9493929190612db9565b60405180910390a150505050565b6201518081565b609681565b61100281565b3361200014610e4b5760405162461bcd60e51b81526004016105319061334b565b60005460ff16610e6d5760405162461bcd60e51b815260040161053190612ea1565b6040517f07db600eebe2ac176be8dcebad61858c245a4961bb32ca2aa3d159b09aa0810e90600090a1505050565b334114610eba5760405162461bcd60e51b81526004016105319061339a565b60005460ff16610edc5760405162461bcd60e51b815260040161053190612ea1565b6003544311610efd5760405162461bcd60e51b8152600401610531906134be565b3a15610f1b5760405162461bcd60e51b8152600401610531906131ab565b60405163155853f360e21b8152611000906355614fcc90610f40908490600401612d6e565b60206040518083038186803b158015610f5857600080fd5b505afa158015610f6c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f909190612b38565b610f9957611285565b610fa1612839565b506001600160a01b0381166000908152600260208181526040928390208351606081018552815481526001820154928101929092529091015460ff161580159282019290925290610ffc576020810180516001019052611055565b60016040820181905260208201819052805480820182556000919091527fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf60180546001600160a01b0319166001600160a01b0384161790555b43815260055460208201518161106757fe5b066111b357600060208201526040516335409f7f60e01b8152611000906335409f7f90611098908590600401612d6e565b600060405180830381600087803b1580156110b257600080fd5b505af11580156110c6573d6000803e3d6000fd5b505050506120006001600160a01b031663f7a251d7600b6110e685611d26565b60006040518463ffffffff1660e01b815260040161110693929190613571565b600060405180830381600087803b15801561112057600080fd5b505af1925050508015611131575060015b6111ae573d80801561115f576040519150601f19603f3d011682016040523d82523d6000602084013e611164565b606091505b50826001600160a01b03167fd7bc86ff5d08c8ab043edec743302aba2520e6635172a428bc956721db9e2d1c8360200151836040516111a492919061350b565b60405180910390a2505b61121f565b6004548160200151816111c257fe5b0661121f576040516375abf10160e11b81526110009063eb57e202906111ec908590600401612d6e565b600060405180830381600087803b15801561120657600080fd5b505af115801561121a573d6000803e3d6000fd5b505050505b6001600160a01b0382166000818152600260208181526040808420865181559186015160018301558581015191909201805460ff1916911515919091179055517fddb6012116e51abf5436d956a4f0ebd927e92c576ff96d7918290c8782291e3e9190a2505b5043600355565b60005460ff166112ae5760405162461bcd60e51b815260040161053190612ea1565b604051630a83aaa960e31b81526110069063541d5548906112d3903390600401612d6e565b60206040518083038186803b1580156112eb57600080fd5b505afa1580156112ff573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113239190612b38565b61133f5760405162461bcd60e51b815260040161053190612e35565b60075460ff166113615760405162461bcd60e51b815260040161053190612e6c565b60065461136e5760146006555b60085461137d57620151806008555b6008548151604001514391011180156113a157504360085482602001516040015101115b6113bd5760405162461bcd60e51b81526004016105319061340e565b8060200151602001518160000151602001511480156113eb5750806020015160600151816000015160600151145b156114085760405162461bcd60e51b815260040161053190613103565b8051604081015190511080156114275750602081015160408101519051105b6114435760405162461bcd60e51b815260040161053190613039565b6020810151518151511080156114685750806000015160400151816020015160400151105b8061149357508051516020820151511080156114935750806020015160400151816000015160400151105b806114ad5750806020015160400151816000015160400151145b6114c95760405162461bcd60e51b815260040161053190612f23565b604080820151905163ea321e4960e01b81526110009163ea321e49916114f29190600401612da6565b60206040518083038186803b15801561150a57600080fd5b505afa15801561151e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115429190612b38565b61155e5760405162461bcd60e51b8152600401610531906131d9565b61157081600001518260400151611f00565b8015611589575061158981602001518260400151611f00565b6115a55760405162461bcd60e51b815260040161053190612fda565b6060806110006001600160a01b0316633b071dcc6040518163ffffffff1660e01b815260040160006040518083038186803b1580156115e357600080fd5b505afa1580156115f7573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261161f9190810190612a75565b9150915060005b815181101561175c5761165082828151811061163e57fe5b602002602001015185604001516120d8565b15611754576006546040516309a99b4f60e41b815260646110028031909302049190639a99b4f0906116889033908590600401612d82565b602060405180830381600087803b1580156116a257600080fd5b505af11580156116b6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116da9190612c8c565b506110006001600160a01b03166335409f7f8584815181106116f857fe5b60200260200101516040518263ffffffff1660e01b815260040161171c9190612d6e565b600060405180830381600087803b15801561173657600080fd5b505af115801561174a573d6000803e3d6000fd5b505050505061175c565b600101611626565b50600061176e8460400151600061213c565b90506120006001600160a01b031663f7a251d7600b6117908760400151612158565b60006040518463ffffffff1660e01b81526004016117b093929190613571565b600060405180830381600087803b1580156117ca57600080fd5b505af19250505080156117db575060015b61184d573d808015611809576040519150601f19603f3d011682016040523d82523d6000602084013e61180e565b606091505b50817fd58d1183100bd0932c0588f31c4205d6bc6168909765a96c41adbed3115f36288260405161183f9190612da6565b60405180910390a250611879565b60405181907f7b78aadacff901d8b63d0dba4f86283d4db8aef27f9ed70413dd860f1c9532b690600090a25b50505050565b601481565b61100381565b60005460ff16156118ad5760405162461bcd60e51b815260040161053190613298565b603260045560966005556000805460ff19166001179055565b60085481565b61100081565b600381565b33611000146118f85760405162461bcd60e51b815260040161053190613130565b60005460ff1661191a5760405162461bcd60e51b815260040161053190612ea1565b60015461192657611d1e565b600154600090600019015b808211611cf2576000805b82841015611a555761194c612839565b600260006001878154811061195d57fe5b60009182526020808320909101546001600160a01b0316835282810193909352604091820190208151606081018352815481526001820154938101939093526002015460ff161515908201526005549091506004900481602001511115611a3f576004600554816119ca57fe5b048160200151038160200181815250508060026000600188815481106119ec57fe5b6000918252602080832091909101546001600160a01b0316835282810193909352604091820190208351815591830151600183015591909101516002909101805460ff1916911515919091179055611a49565b6001925050611a55565b5083600101935061193c565b828411611bec57611a64612839565b6002600060018681548110611a7557fe5b60009182526020808320909101546001600160a01b0316835282810193909352604091820190208151606081018352815481526001820154938101939093526002015460ff161515908201526005549091506004900481602001511115611b5d57600460055481611ae257fe5b04816020015103816020018181525050806002600060018781548110611b0457fe5b6000918252602080832091909101546001600160a01b03168352828101939093526040918201902083518155918301516001808401919091559201516002909101805460ff19169115159190911790559150611bec9050565b6002600060018681548110611b6e57fe5b60009182526020808320909101546001600160a01b031683528201929092526040018120818155600181810192909255600201805460ff19169055805480611bb257fe5b600082815260209020810160001990810180546001600160a01b031916905501905583611bdf5750611bec565b5060001990920191611a55565b818015611bf65750805b15611cd5576002600060018681548110611c0c57fe5b60009182526020808320909101546001600160a01b031683528201929092526040018120818155600181810192909255600201805460ff19169055805484908110611c5357fe5b600091825260209091200154600180546001600160a01b039092169186908110611c7957fe5b9060005260206000200160006101000a8154816001600160a01b0302191690836001600160a01b031602179055506001805480611cb257fe5b600082815260209020810160001990810180546001600160a01b03191690550190555b82611ce1575050611cf2565b505060019091019060001901611931565b6040517fcfdb3b6ccaeccbdc68be3c59c840e3b3c90f0a7c491f5fff1cf56cfda200dd9c90600090a150505b565b61100481565b60408051600480825260a08201909252606091829190816020015b6060815260200190600190039081611d41579050509050611d6a836001600160a01b0316612193565b81600081518110611d7757fe5b6020026020010181905250611d8b436121b6565b81600181518110611d9857fe5b6020908102919091010152611dae6102ca6121b6565b81600281518110611dbb57fe5b6020026020010181905250611dcf426121b6565b81600381518110611ddc57fe5b6020026020010181905250611df0816121c9565b9150505b919050565b611e0161285c565b6000611e0b61285c565b611e1361286e565b611e24611e1f86612253565b612278565b90506000805b611e33836122c2565b15611e6c5780611e5f57611e4e611e49846122e3565b612331565b63ffffffff16845260019150611e64565b611e6c565b600101611e2a565b5091935090915050915091565b600081604051602001611e8c9190612d52565b6040516020818303038152906040528051906020012083604051602001611eb39190612d52565b604051602081830303815290604052805190602001201490505b92915050565b015190565b8082015160009060ff811615611ef2576001915081611ef8565b60009150815b505092915050565b60408051600480825260a0820190925260009160609190816020015b6060815260200190600190039081611f1c575050604080516020808252818301909252919250606091908082018180368337019050509050611f6185600001516121b6565b82600081518110611f6e57fe5b6020026020010181905250611f8960208660200151836123b3565b611f92816123c3565b82600181518110611f9f57fe5b6020026020010181905250611fb785604001516121b6565b82600281518110611fc457fe5b6020026020010181905250611fdf60208660600151836123b3565b611fe8816123c3565b82600381518110611ff557fe5b602002602001018190525061201b602061200e846121c9565b80519060200120836123b3565b6040805160b080825260e0820190925260609160208201818036833701905050905061204b818360006020612419565b61205d81876080015160206060612419565b61206b818660806030612419565b604080516001808252818301909252606091602082018180368337019050509050815160016020830182602086016066600019fa6120a857600080fd5b5060016120b682600061246c565b60ff16146120cb576000945050505050611ecd565b5060019695505050505050565b8151815160009160019181148083146120f45760009250612132565b600160208701838101602088015b60028483851001141561212d5780518351146121215760009650600093505b60209283019201612102565b505050505b5090949350505050565b6000816020018351101561214f57600080fd5b50016020015190565b60408051600480825260a08201909252606091829190816020015b6060815260200190600190039081612173579050509050611d6a836123c3565b60408051600560a21b8318601482015260348101909152606090611df0816123c3565b6060611ecd6121c483612488565b6123c3565b60608151600014156121ea5750604080516000815260208101909152611df4565b6060826000815181106121f957fe5b602002602001015190506000600190505b835181101561223a576122308285838151811061222357fe5b602002602001015161256e565b915060010161220a565b50611df061224d825160c060ff166125eb565b8261256e565b61225b61288e565b506040805180820190915281518152602082810190820152919050565b61228061286e565b612289826126bd565b61229257600080fd5b60006122a183602001516126f7565b60208085015160408051808201909152868152920190820152915050919050565b60006122cc61288e565b505080518051602091820151919092015191011190565b6122eb61288e565b6122f4826122c2565b6122fd57600080fd5b6020820151600061230d8261275a565b80830160209586015260408051808201909152908152938401919091525090919050565b80516000901580159061234657508151602110155b61234f57600080fd5b600061235e83602001516126f7565b905080836000015110156123845760405162461bcd60e51b8152600401610531906132cf565b8251602080850151830180519284900392918310156123aa57826020036101000a820491505b50949350505050565b9091018181526020918201910152565b6060815160011480156123f55750607f60f81b826000815181106123e357fe5b01602001516001600160f81b03191611155b15612401575080611df4565b611ecd6124138351608060ff166125eb565b8361256e565b60005b818110156106f05783818151811061243057fe5b602001015160f81c60f81b85848060010195508151811061244d57fe5b60200101906001600160f81b031916908160001a90535060010161241c565b6000816001018351101561247f57600080fd5b50016001015190565b604080516020808252818301909252606091829190602082018180368337505050602081018490529050600067ffffffffffffffff1984166124cc575060186124f0565b6fffffffffffffffffffffffffffffffff1984166124ec575060106124f0565b5060005b60208110156125265781818151811061250557fe5b01602001516001600160f81b0319161561251e57612526565b6001016124f0565b60008160200390506060816040519080825280601f01601f19166020018201604052801561255b576020820181803683370190505b5080830196909652508452509192915050565b6060806040519050835180825260208201818101602087015b8183101561259f578051835260209283019201612587565b50855184518101855292509050808201602086015b818310156125cc5780518352602092830192016125b4565b508651929092011591909101601f01601f191660405250905092915050565b60606801000000000000000083106126155760405162461bcd60e51b815260040161053190613011565b6040805160018082528183019092526060916020820181803683370190505090506037841161266f5782840160f81b8160008151811061265157fe5b60200101906001600160f81b031916908160001a9053509050611ecd565b606061267a85612488565b90508381510160370160f81b8260008151811061269357fe5b60200101906001600160f81b031916908160001a9053506126b4828261256e565b95945050505050565b80516000906126ce57506000611df4565b6020820151805160001a9060c08210156126ed57600092505050611df4565b5060019392505050565b8051600090811a6080811015612711576000915050611df4565b60b881108061272c575060c0811080159061272c575060f881105b1561273b576001915050611df4565b60c081101561274f5760b519019050611df4565b60f519019050611df4565b80516000908190811a60808110156127755760019150612832565b60b881101561278a57607e1981019150612832565b60c08110156127db57600060b78203600186019550806020036101000a8651049150600181018201935050808310156127d55760405162461bcd60e51b815260040161053190613180565b50612832565b60f88110156127f05760be1981019150612832565b600060f78203600186019550806020036101000a865104915060018101820193505080831015611ef85760405162461bcd60e51b815260040161053190613180565b5092915050565b604051806060016040528060008152602001600081526020016000151581525090565b60408051602081019091526000815290565b604051806040016040528061288161288e565b8152602001600081525090565b604051806040016040528060008152602001600081525090565b600082601f8301126128b8578081fd5b81516128cb6128c6826135c4565b61359d565b818152915060208083019084810160005b84811015612941578151870188603f8201126128f757600080fd5b838101516129076128c6826135e4565b81815260408b8184860101111561291d57600080fd5b61292c83888401838701613608565b508652505092820192908201906001016128dc565b505050505092915050565b60008083601f84011261295d578182fd5b50813567ffffffffffffffff811115612974578182fd5b60208301915083602082850101111561298c57600080fd5b9250929050565b600082601f8301126129a3578081fd5b81356129b16128c6826135e4565b91508082528360208285010111156129c857600080fd5b8060208401602084013760009082016020015292915050565b600060a082840312156129f2578081fd5b6129fc60a061359d565b905081358152602082013560208201526040820135604082015260608201356060820152608082013567ffffffffffffffff811115612a3a57600080fd5b612a4684828501612993565b60808301525092915050565b600060208284031215612a63578081fd5b8135612a6e81613634565b9392505050565b60008060408385031215612a87578081fd5b825167ffffffffffffffff80821115612a9e578283fd5b81850186601f820112612aaf578384fd5b80519250612abf6128c6846135c4565b80848252602080830192508084018a828389028701011115612adf578788fd5b8794505b86851015612b0a578051612af681613634565b845260019490940193928101928101612ae3565b508801519096509350505080821115612b21578283fd5b50612b2e858286016128a8565b9150509250929050565b600060208284031215612b49578081fd5b81518015158114612a6e578182fd5b60008060008060408587031215612b6d578182fd5b843567ffffffffffffffff80821115612b84578384fd5b612b908883890161294c565b90965094506020870135915080821115612ba8578384fd5b50612bb58782880161294c565b95989497509550505050565b600060208284031215612bd2578081fd5b813567ffffffffffffffff80821115612be9578283fd5b81840160608187031215612bfb578384fd5b612c05606061359d565b9250803582811115612c15578485fd5b612c21878284016129e1565b845250602081013582811115612c35578485fd5b612c41878284016129e1565b602085015250604081013582811115612c58578485fd5b612c6487828401612993565b6040850152509195945050505050565b600060208284031215612c85578081fd5b5035919050565b600060208284031215612c9d578081fd5b5051919050565b600080600060408486031215612cb8578283fd5b833560ff81168114612cc8578384fd5b9250602084013567ffffffffffffffff811115612ce3578283fd5b612cef8682870161294c565b9497909650939450505050565b60008284528282602086013780602084860101526020601f19601f85011685010190509392505050565b60008151808452612d3e816020860160208601613608565b601f01601f19169290920160200192915050565b60008251612d64818460208701613608565b9190910192915050565b6001600160a01b0391909116815260200190565b6001600160a01b03929092168252602082015260400190565b901515815260200190565b600060208252612a6e6020830184612d26565b600060408252612dcd604083018688612cfc565b8281036020840152612de0818587612cfc565b979650505050505050565b6020808252602a908201527f6c656e677468206f66206d616c6963696f7573566f7465536c61736853636f706040820152690ca40dad2e6dac2e8c6d60b31b606082015260800190565b6020808252601f908201527f746865206d73672073656e646572206973206e6f7420612072656c6179657200604082015260600190565b6020808252818101527f6d616c6963696f757320766f746520736c617368206e6f7420656e61626c6564604082015260600190565b60208082526019908201527f74686520636f6e7472616374206e6f7420696e69742079657400000000000000604082015260600190565b6020808252602b908201527f746865206d616c6963696f757320766f746520736c6173682073636f7065206f60408201526a7574206f662072616e676560a81b606082015260800190565b6020808252601a908201527f6e6f2076696f6c6174696f6e206f6620766f74652072756c6573000000000000604082015260600190565b6020808252818101527f7468652066656c6f6e795468726573686f6c64206f7574206f662072616e6765604082015260600190565b6020808252602b908201527f6c656e677468206f6620656e61626c654d616c6963696f7573566f7465536c6160408201526a0e6d040dad2e6dac2e8c6d60ab1b606082015260800190565b60208082526017908201527f766572696679207369676e6174757265206661696c6564000000000000000000604082015260600190565b6020808252600e908201526d696e70757420746f6f206c6f6e6760901b604082015260600190565b60208082526019908201527f7372634e756d20626967676572207468616e207461724e756d00000000000000604082015260600190565b6020808252602c908201527f7468652066696e616c69747920736c6173682072657761726420726174696f2060408201526b6f7574206f662072616e676560a01b606082015260800190565b60208082526027908201527f6c656e677468206f66206d697364656d65616e6f725468726573686f6c64206d6040820152660d2e6dac2e8c6d60cb1b606082015260800190565b60208082526013908201527274776f206964656e746963616c20766f74657360681b604082015260600190565b60208082526030908201527f746865206d6573736167652073656e646572206d7573742062652076616c696460408201526f185d1bdc94d95d0818dbdb9d1c9858dd60821b606082015260800190565b6020808252601190820152706164646974696f6e206f766572666c6f7760781b604082015260600190565b6020808252601490820152736761737072696365206973206e6f74207a65726f60601b604082015260600190565b6020808252601590820152741d9bdd195059191c881a5cc81b9bdd08199bdd5b99605a1b604082015260600190565b6020808252602e908201527f746865206d6573736167652073656e646572206d75737420626520676f76657260408201526d1b985b98d94818dbdb9d1c9858dd60921b606082015260800190565b60208082526022908201527f6c656e677468206f662066656c6f6e795468726573686f6c64206d69736d61746040820152610c6d60f31b606082015260800190565b60208082526019908201527f74686520636f6e747261637420616c726561647920696e697400000000000000604082015260600190565b6020808252601a908201527f6c656e677468206973206c657373207468616e206f6666736574000000000000604082015260600190565b60208082526025908201527f746865206d697364656d65616e6f725468726573686f6c64206f7574206f662060408201526472616e676560d81b606082015260800190565b6020808252602f908201527f746865206d6573736167652073656e646572206d7573742062652063726f737360408201526e0818da185a5b8818dbdb9d1c9858dd608a1b606082015260800190565b6020808252602d908201527f746865206d6573736167652073656e646572206d75737420626520746865206260408201526c3637b1b590383937b23ab1b2b960991b606082015260800190565b6020808252600d908201526c756e6b6e6f776e20706172616d60981b604082015260600190565b6020808252601490820152731d185c99d95d08189b1bd8dac81d1bdbc81bdb1960621b604082015260600190565b6020808252601e908201527f7265636569766520756e65787065637465642073796e207061636b6167650000604082015260600190565b6020808252602b908201527f6c656e677468206f662066696e616c697479536c61736852657761726452617460408201526a0d2de40dad2e6dac2e8c6d60ab1b606082015260800190565b6020808252818101527f63616e206e6f7420736c61736820747769636520696e206f6e6520626c6f636b604082015260600190565b61ffff91909116815260200190565b90815260200190565b6000838252604060208301526135246040830184612d26565b949350505050565b918252602082015260400190565b92835260208301919091521515604082015260600190565b63ffffffff91909116815260200190565b60ff91909116815260200190565b600060ff851682526060602083015261358d6060830185612d26565b9050826040830152949350505050565b60405181810167ffffffffffffffff811182821017156135bc57600080fd5b604052919050565b600067ffffffffffffffff8211156135da578081fd5b5060209081020190565b600067ffffffffffffffff8211156135fa578081fd5b50601f01601f191660200190565b60005b8381101561362357818101518382015260200161360b565b838111156118795750506000910152565b6001600160a01b038116811461364957600080fd5b5056fea164736f6c6343000604000a", + }, + }, + } + latestUpgrade[defaultNet] = latestUpgrade[rialtoNet] } -func UpgradeBuildInSystemContract(config *params.ChainConfig, blockNumber *big.Int, statedb *state.StateDB) { +func UpgradeBuildInSystemContract(config *params.ChainConfig, blockNumber *big.Int, lastBlockTime uint64, blockTime uint64, statedb *state.StateDB) { if config == nil || blockNumber == nil || statedb == nil { return } @@ -758,6 +793,9 @@ func UpgradeBuildInSystemContract(config *params.ChainConfig, blockNumber *big.I applySystemContractUpgrade(platoUpgrade[network], blockNumber, statedb, logger) } + if config.IsOnKepler(blockNumber, lastBlockTime, blockTime) { + applySystemContractUpgrade(keplerUpgrade[network], blockNumber, statedb, logger) + } /* apply other upgrades */ diff --git a/miner/worker.go b/miner/worker.go index ffade84a39..d1ea4f8034 100644 --- a/miner/worker.go +++ b/miner/worker.go @@ -914,7 +914,7 @@ func (w *worker) prepareWork(genParams *generateParams) (*environment, error) { } // Handle upgrade build-in system contract code - systemcontracts.UpgradeBuildInSystemContract(w.chainConfig, header.Number, env.state) + systemcontracts.UpgradeBuildInSystemContract(w.chainConfig, header.Number, parent.Time, header.Time, env.state) return env, nil } diff --git a/params/config.go b/params/config.go index fc1f40e6de..15462e9804 100644 --- a/params/config.go +++ b/params/config.go @@ -458,6 +458,7 @@ type ChainConfig struct { // Fork scheduling was switched from blocks to timestamps here ShanghaiTime *uint64 `json:"shanghaiTime,omitempty" toml:",omitempty"` // Shanghai switch time (nil = no fork, 0 = already on shanghai) + KeplerTime *uint64 `json:"keplerTime,omitempty" toml:",omitempty"` // Kepler switch time (nil = no fork, 0 = already activated) CancunTime *uint64 `json:"cancunTime,omitempty" toml:",omitempty"` // Cancun switch time (nil = no fork, 0 = already on cancun) PragueTime *uint64 `json:"pragueTime,omitempty" toml:",omitempty"` // Prague switch time (nil = no fork, 0 = already on prague) VerkleTime *uint64 `json:"verkleTime,omitempty" toml:",omitempty"` // Verkle switch time (nil = no fork, 0 = already on verkle) @@ -540,7 +541,12 @@ func (c *ChainConfig) String() string { engine = "unknown" } - return fmt.Sprintf("{ChainID: %v Homestead: %v DAO: %v DAOSupport: %v EIP150: %v EIP155: %v EIP158: %v Byzantium: %v Constantinople: %v Petersburg: %v Istanbul: %v, Muir Glacier: %v, Ramanujan: %v, Niels: %v, MirrorSync: %v, Bruno: %v, Berlin: %v, YOLO v3: %v, CatalystBlock: %v, London: %v, ArrowGlacier: %v, MergeFork:%v, Euler: %v, Gibbs: %v, Nano: %v, Moran: %v, Planck: %v,Luban: %v, Plato: %v, Hertz: %v, Engine: %v}", + var KeplerTime *big.Int + if c.KeplerTime != nil { + KeplerTime = big.NewInt(c.KeplerTime) + } + + return fmt.Sprintf("{ChainID: %v Homestead: %v DAO: %v DAOSupport: %v EIP150: %v EIP155: %v EIP158: %v Byzantium: %v Constantinople: %v Petersburg: %v Istanbul: %v, Muir Glacier: %v, Ramanujan: %v, Niels: %v, MirrorSync: %v, Bruno: %v, Berlin: %v, YOLO v3: %v, CatalystBlock: %v, London: %v, ArrowGlacier: %v, MergeFork:%v, Euler: %v, Gibbs: %v, Nano: %v, Moran: %v, Planck: %v,Luban: %v, Plato: %v, Hertz: %v, KeplerTime: %v, Engine: %v}", c.ChainID, c.HomesteadBlock, c.DAOForkBlock, @@ -571,6 +577,7 @@ func (c *ChainConfig) String() string { c.LubanBlock, c.PlatoBlock, c.HertzBlock, + KeplerTime, engine, ) } @@ -774,6 +781,20 @@ func (c *ChainConfig) IsShanghai(num *big.Int, time uint64) bool { return c.IsLondon(num) && isTimestampForked(c.ShanghaiTime, time) } +// IsKepler returns whether time is either equal to the kepler fork time or greater. +func (c *ChainConfig) IsKepler(num *big.Int, time uint64) bool { + return c.IsLondon(num) && isTimestampForked(c.KeplerTime, time) +} + +// IsOnKepler returns whether currentBlockTime is either equal to the kepler fork time or greater firstly. +func (c *ChainConfig) IsOnKepler(currentBlockNumber *big.Int, lastBlockTime uint64, currentBlockTime uint64) bool { + lastBlockNumber := new(big.Int) + if currentBlockNumber.Cmp(big.NewInt(1)) >= 0 { + lastBlockNumber.Sub(currentBlockNumber, big.NewInt(1)) + } + return !c.IsKepler(lastBlockNumber, lastBlockTime) && c.IsKepler(currentBlockNumber, currentBlockTime) +} + // IsCancun returns whether num is either equal to the Cancun fork time or greater. func (c *ChainConfig) IsCancun(num *big.Int, time uint64) bool { return c.IsLondon(num) && isTimestampForked(c.CancunTime, time) @@ -971,6 +992,9 @@ func (c *ChainConfig) checkCompatible(newcfg *ChainConfig, headNumber *big.Int, if isForkTimestampIncompatible(c.ShanghaiTime, newcfg.ShanghaiTime, headTimestamp) { return newTimestampCompatError("Shanghai fork timestamp", c.ShanghaiTime, newcfg.ShanghaiTime) } + if isForkTimestampIncompatible(c.KeplerTime, newcfg.KeplerTime, headTimestamp) { + return newTimestampCompatError("Kepler fork timestamp", c.KeplerTime, newcfg.KeplerTime) + } if isForkTimestampIncompatible(c.CancunTime, newcfg.CancunTime, headTimestamp) { return newTimestampCompatError("Cancun fork timestamp", c.CancunTime, newcfg.CancunTime) } @@ -1131,7 +1155,7 @@ type Rules struct { IsLuban bool IsPlato bool IsHertz bool - IsShanghai, IsCancun, IsPrague bool + IsShanghai, IsKepler, IsCancun, IsPrague bool IsVerkle bool } @@ -1161,6 +1185,7 @@ func (c *ChainConfig) Rules(num *big.Int, isMerge bool, timestamp uint64) Rules IsPlato: c.IsPlato(num), IsHertz: c.IsHertz(num), IsShanghai: c.IsShanghai(num, timestamp), + IsKepler: c.IsKepler(num, timestamp), IsCancun: c.IsCancun(num, timestamp), IsPrague: c.IsPrague(num, timestamp), IsVerkle: c.IsVerkle(num, timestamp),