From 8039e9d62770fee0e6d660a668f05d0549f72f3c Mon Sep 17 00:00:00 2001 From: Shine Date: Sat, 10 Dec 2022 09:10:38 +0800 Subject: [PATCH] init --- src/TokensTracker/Trackers/NEP-11/Nep11Tracker.cs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/TokensTracker/Trackers/NEP-11/Nep11Tracker.cs b/src/TokensTracker/Trackers/NEP-11/Nep11Tracker.cs index 0ae70ce11..71dbbb14c 100644 --- a/src/TokensTracker/Trackers/NEP-11/Nep11Tracker.cs +++ b/src/TokensTracker/Trackers/NEP-11/Nep11Tracker.cs @@ -92,7 +92,18 @@ public override void OnPersist(NeoSystem system, Block block, DataCache snapshot Log($"{state.Hash} is not nft!", LogLevel.Warning); continue; } - + if (balanceMethod != null && + !(balanceMethod.Parameters[0].Type == ContractParameterType.Hash160 && balanceMethod.ReturnType == ContractParameterType.Integer)) + { + Log($"{state.Hash} is not nft:balance1!", LogLevel.Warning); + continue; + } + if (balanceMethod2 != null && + !(balanceMethod2.Parameters[0].Type == ContractParameterType.Hash160 && balanceMethod2.Parameters[1].Type == ContractParameterType.ByteArray && balanceMethod2.ReturnType == ContractParameterType.Integer)) + { + Log($"{state.Hash} is not nft:balance2!", LogLevel.Warning); + continue; + } var isDivisible = balanceMethod2 != null; contracts[transferRecord.asset] = (isDivisible, state); }