From 918949c5886c45488bd25a97a20d027202e7147f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=99=A8=20=E9=BB=8E?= Date: Mon, 25 Oct 2021 11:52:38 +0800 Subject: [PATCH 1/2] change fee type to gas --- src/N3/N3ProxyWrapper/ProxyWrapper.cs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/N3/N3ProxyWrapper/ProxyWrapper.cs b/src/N3/N3ProxyWrapper/ProxyWrapper.cs index 6cf4df4..3c31a6c 100644 --- a/src/N3/N3ProxyWrapper/ProxyWrapper.cs +++ b/src/N3/N3ProxyWrapper/ProxyWrapper.cs @@ -1,8 +1,10 @@ using System; +using System.ComponentModel; using System.Numerics; using Neo; using Neo.SmartContract; using Neo.SmartContract.Framework; +using Neo.SmartContract.Framework.Attributes; using Neo.SmartContract.Framework.Native; using Neo.SmartContract.Framework.Services; @@ -116,10 +118,10 @@ public static bool Lock(UInt160 fromAsset, UInt160 fromAddress, BigInteger toCha Assert(Runtime.CheckWitness(fromAddress), "Forbidden"); if (fee != 0) { - Contract.Call(fromAsset, "transfer", CallFlags.All, fromAddress, Runtime.ExecutingScriptHash, fee, null); + GAS.Transfer(fromAddress, Runtime.ExecutingScriptHash, fee, null); } - Contract.Call(Proxy(), "lock", CallFlags.All, fromAsset, fromAddress, toChainId, toAddress, amount - fee); - polyWrapperLock(fromAsset, fromAddress, toChainId, toAddress, amount - fee, fee, id); + Contract.Call(Proxy(), "lock", CallFlags.All, fromAsset, fromAddress, toChainId, toAddress, amount); + polyWrapperLock(fromAsset, fromAddress, toChainId, toAddress, amount, fee, id); return true; } From e3fb1795e985545457c604851deb34240fd1ff59 Mon Sep 17 00:00:00 2001 From: GZ Date: Mon, 8 Nov 2021 17:08:06 +0800 Subject: [PATCH 2/2] update event name --- src/N3/N3ProxyWrapper/ProxyWrapper.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/N3/N3ProxyWrapper/ProxyWrapper.cs b/src/N3/N3ProxyWrapper/ProxyWrapper.cs index 3c31a6c..80158cd 100644 --- a/src/N3/N3ProxyWrapper/ProxyWrapper.cs +++ b/src/N3/N3ProxyWrapper/ProxyWrapper.cs @@ -28,7 +28,7 @@ public class ProxyWrapper : SmartContract private static readonly StorageMap PauseMap = new StorageMap(Storage.CurrentContext, "pause"); public static event Action notify; - public static event Action polyWrapperLock; + public static event Action PolyWrapperLock; public static void _deploy(object data, bool update) { OwnerMap.Put("superOwner", superOwner);