Skip to content

Commit

Permalink
upgrade.go: system contracts defined after genesis need to be explici…
Browse files Browse the repository at this point in the history
…tly created
  • Loading branch information
blxdyx committed Jul 5, 2024
1 parent 386a482 commit 73dca5b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions core/systemcontracts/upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@ func UpgradeBuildInSystemContract(config *chain.Config, blockNumber *big.Int, la
}
for addr, account := range allocs {
logger.Debug("[parlia] upgrade System Contract code", "blockNumber", blockNumber, "blockTime", blockTime, "targetNumberOrTime", numOrTime, "address", addr)
prevContractCode := state.GetCode(addr)
if len(prevContractCode) == 0 && len(account.Code) > 0 {
// system contracts defined after genesis need to be explicitly created
state.CreateAccount(addr, true)
}
state.SetCode(addr, account.Code)
}
}
Expand Down

0 comments on commit 73dca5b

Please sign in to comment.