diff --git a/packages/vm/core/migrations/m001/decimals_migration.go b/packages/vm/core/migrations/m001/decimals_migration.go index f48037c1ef..77712e01a9 100644 --- a/packages/vm/core/migrations/m001/decimals_migration.go +++ b/packages/vm/core/migrations/m001/decimals_migration.go @@ -15,7 +15,11 @@ var AccountDecimals = migrations.Migration{ migrateBaseTokens := func(accKey []byte) { // converts an account base token balance from uint64 to big.Int (while changing the decimals from 6 to 18) key := accounts.BaseTokensKey(kv.Key(accKey)) - amount := codec.MustDecodeUint64(state.Get(key)) + amountBytes := state.Get(key) + if amountBytes == nil { + return + } + amount := codec.MustDecodeUint64(amountBytes) amountMigrated := util.MustBaseTokensDecimalsToEthereumDecimalsExact(amount, 6) state.Set(key, codec.EncodeBigIntAbs(amountMigrated)) }