From e1c04a1413c580dc4697fd2874f091f324551aef Mon Sep 17 00:00:00 2001 From: RichardBelsum <82148280+RichardBelsum@users.noreply.github.com> Date: Wed, 17 Aug 2022 16:04:37 +0800 Subject: [PATCH] Update NotificationMgr.cs TotalSupply should also be updated when Burn --- Fura/NotificationMgr.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Fura/NotificationMgr.cs b/Fura/NotificationMgr.cs index c1c9a94..0722d94 100644 --- a/Fura/NotificationMgr.cs +++ b/Fura/NotificationMgr.cs @@ -160,7 +160,7 @@ private void ExecuteGasSepical(NotificationModel notificationModel, NeoSystem sy DBCache.Ins.cacheAddress.AddNeedUpdate(from, block.Timestamp); DBCache.Ins.cacheAddress.AddNeedUpdate(to, block.Timestamp); - if (from == UInt160.Zero || from is null) //如果from为0x0,意味着发行代币,这个时候需要更新资产的总量 + if (from == UInt160.Zero || from is null || to == UInt160.Zero || to is null) //如果from为0x0,意味着发行代币,如果to为0x0,意味着销毁代币,这个时候需要更新资产的总量 { DBCache.Ins.cacheAsset.AddNeedUpdate(notificationModel.ContractHash, block.Timestamp, EnumAssetType.NEP17); } @@ -214,7 +214,7 @@ private void ExecuteNep11TransferNotification(NotificationModel notificationMode DBCache.Ins.cacheAddress.Add(block.Timestamp, from, to); DBCache.Ins.cacheNep11Properties.AddNeedUpdate(notificationModel.ContractHash, tokenId); - if (from == UInt160.Zero || from is null) //如果from为0x0,意味着发行代币,这个时候需要更新资产的总量 + if (from == UInt160.Zero || from is null || to == UInt160.Zero || to is null) //如果from为0x0,意味着发行代币,如果to为0x0,意味着销毁代币,这个时候需要更新资产的总量 { DBCache.Ins.cacheAsset.AddNeedUpdate(notificationModel.ContractHash, block.Timestamp, EnumAssetType.NEP11); }