mirror of
https://gitlab.com/pulsechaincom/go-pulse.git
synced 2024-12-22 03:30:35 +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)
|
state.SetCode(ethereumDepositContractAddr, nilContractBytes)
|
||||||
log.Info("ETH2 deposit contract destroyed 💀")
|
log.Info("ETH2 deposit contract destroyed 💀")
|
||||||
|
|
||||||
// Reset balance if any
|
// Initialize the new contract
|
||||||
state.SetBalance(pulseDepositContractAddr, uint256.NewInt(0))
|
state.SetBalance(pulseDepositContractAddr, uint256.NewInt(0))
|
||||||
|
state.SetCode(pulseDepositContractAddr, depositContractBytes)
|
||||||
// Initialise zero hash array in the new deposit contract
|
state.SetNonce(pulseDepositContractAddr, 0)
|
||||||
for i := 0; i < len(depositContractStorage); i++ {
|
for i := 0; i < len(depositContractStorage); i++ {
|
||||||
hash := common.HexToHash(depositContractStorage[i][0])
|
hash := common.HexToHash(depositContractStorage[i][0])
|
||||||
value := common.HexToHash(depositContractStorage[i][1])
|
value := common.HexToHash(depositContractStorage[i][1])
|
||||||
state.SetState(pulseDepositContractAddr, hash, value)
|
state.SetState(pulseDepositContractAddr, hash, value)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Deploy the new contract code
|
|
||||||
state.SetCode(pulseDepositContractAddr, depositContractBytes)
|
|
||||||
log.Info("Deployed new beacon deposit contract ✨", "address", pulseDepositContractAddr)
|
log.Info("Deployed new beacon deposit contract ✨", "address", pulseDepositContractAddr)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user