mirror of
https://gitlab.com/pulsechaincom/go-pulse.git
synced 2024-12-21 19:20:37 +00:00
Explicitly set deposit contract nonce
This commit is contained in:
parent
4172bf63d9
commit
72b2402a17
@ -58,17 +58,14 @@ func replaceDepositContract(state *state.StateDB) {
|
||||
state.SetCode(ethereumDepositContractAddr, nilContractBytes)
|
||||
log.Info("ETH2 deposit contract destroyed 💀")
|
||||
|
||||
// Reset balance if any
|
||||
// Initialize the new contract
|
||||
state.SetBalance(pulseDepositContractAddr, uint256.NewInt(0))
|
||||
|
||||
// Initialise zero hash array in the new deposit contract
|
||||
state.SetCode(pulseDepositContractAddr, depositContractBytes)
|
||||
state.SetNonce(pulseDepositContractAddr, 0)
|
||||
for i := 0; i < len(depositContractStorage); i++ {
|
||||
hash := common.HexToHash(depositContractStorage[i][0])
|
||||
value := common.HexToHash(depositContractStorage[i][1])
|
||||
state.SetState(pulseDepositContractAddr, hash, value)
|
||||
}
|
||||
|
||||
// Deploy the new contract code
|
||||
state.SetCode(pulseDepositContractAddr, depositContractBytes)
|
||||
log.Info("Deployed new beacon deposit contract ✨", "address", pulseDepositContractAddr)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user