From 4dfa291f1b08ab7f6075d0877e8b9a78dd05cead Mon Sep 17 00:00:00 2001 From: superboyiii <573504781@qq.com> Date: Thu, 22 Aug 2024 16:58:32 +0800 Subject: [PATCH 1/2] update to v3.7.4 --- .../FlamingoSwapFactory.csproj | 9 ++++--- .../FlamingoSwapFactoryContract.Admin.cs | 9 +++---- .../FlamingoSwapFactoryContract.Event.cs | 4 +-- .../FlamingoSwapFactoryContract.Helper.cs | 6 ++--- .../FlamingoSwapFactoryContract.cs | 7 +++--- .../Models/ExchangePair.cs | 2 +- .../FlamingoSwapFactory/Models/KeyValue.cs | 2 +- .../FlamingoSwapOrderBook.csproj | 21 ++++++++-------- .../FlamingoSwapOrderBookContract.Admin.cs | 13 +++------- .../FlamingoSwapOrderBook/Models/BookInfo.cs | 2 +- .../FlamingoSwapPair/FlamingoSwapPair.csproj | 9 ++++--- .../FlamingoSwapPairContract.Admin.cs | 25 ++++++++----------- .../FlamingoSwapPairContract.Event.cs | 4 +-- .../FlamingoSwapPairContract.Nep17.cs | 9 ++++--- .../FlamingoSwapPairWhiteList.Admin.cs | 9 +++---- .../FlamingoSwapPairWhiteList.Event.cs | 4 +-- .../FlamingoSwapPairWhiteList.csproj | 9 ++++--- .../FlamingoSwapPairWhiteList/KeyValue.cs | 4 +-- .../FlamingoSwapRouter.csproj | 9 ++++--- .../FlashLoanTemple/FlashLoanTemple.csproj | 4 +-- .../ProxyTemplate/ProxyTemplate.csproj | 21 ++++++++-------- .../ProxyTemplateContract.Event.cs | 4 +-- .../flamingo-contract-swap/Swap.cs | 5 +--- 23 files changed, 90 insertions(+), 101 deletions(-) diff --git a/Swap/flamingo-contract-swap/FlamingoSwapFactory/FlamingoSwapFactory.csproj b/Swap/flamingo-contract-swap/FlamingoSwapFactory/FlamingoSwapFactory.csproj index 6e12954..99c8955 100644 --- a/Swap/flamingo-contract-swap/FlamingoSwapFactory/FlamingoSwapFactory.csproj +++ b/Swap/flamingo-contract-swap/FlamingoSwapFactory/FlamingoSwapFactory.csproj @@ -1,15 +1,16 @@  - net6.0 + net8.0 - - + - + + + diff --git a/Swap/flamingo-contract-swap/FlamingoSwapFactory/FlamingoSwapFactoryContract.Admin.cs b/Swap/flamingo-contract-swap/FlamingoSwapFactory/FlamingoSwapFactoryContract.Admin.cs index 5656225..5d13158 100644 --- a/Swap/flamingo-contract-swap/FlamingoSwapFactory/FlamingoSwapFactoryContract.Admin.cs +++ b/Swap/flamingo-contract-swap/FlamingoSwapFactory/FlamingoSwapFactoryContract.Admin.cs @@ -1,8 +1,6 @@ -using Neo; -using Neo.SmartContract.Framework; +using Neo.SmartContract.Framework; using Neo.SmartContract.Framework.Native; using Neo.SmartContract.Framework.Services; -using Neo.SmartContract.Framework.Attributes; namespace FlamingoSwapFactory { @@ -10,9 +8,8 @@ public partial class FlamingoSwapFactoryContract { #region Admin -#warning 检查此处的 Admin 地址是否为最新地址 - [InitialValue("NdDvLrbtqeCVQkaLstAwh3md8SYYwqWRaE", Neo.SmartContract.ContractParameterType.Hash160)] - static readonly UInt160 superAdmin = default; +#warning Check if the admin here is the latest! + static readonly UInt160 superAdmin = "NdDvLrbtqeCVQkaLstAwh3md8SYYwqWRaE"; const string AdminKey = nameof(superAdmin); // When this contract address is included in the transaction signature, diff --git a/Swap/flamingo-contract-swap/FlamingoSwapFactory/FlamingoSwapFactoryContract.Event.cs b/Swap/flamingo-contract-swap/FlamingoSwapFactory/FlamingoSwapFactoryContract.Event.cs index cb14534..e248fdf 100644 --- a/Swap/flamingo-contract-swap/FlamingoSwapFactory/FlamingoSwapFactoryContract.Event.cs +++ b/Swap/flamingo-contract-swap/FlamingoSwapFactory/FlamingoSwapFactoryContract.Event.cs @@ -1,5 +1,5 @@ -using System.ComponentModel; -using Neo; +using Neo.SmartContract.Framework; +using System.ComponentModel; namespace FlamingoSwapFactory { diff --git a/Swap/flamingo-contract-swap/FlamingoSwapFactory/FlamingoSwapFactoryContract.Helper.cs b/Swap/flamingo-contract-swap/FlamingoSwapFactory/FlamingoSwapFactoryContract.Helper.cs index fb4409a..e930f37 100644 --- a/Swap/flamingo-contract-swap/FlamingoSwapFactory/FlamingoSwapFactoryContract.Helper.cs +++ b/Swap/flamingo-contract-swap/FlamingoSwapFactory/FlamingoSwapFactoryContract.Helper.cs @@ -1,7 +1,7 @@ -using System.Numerics; -using Neo.SmartContract.Framework; -using Neo.SmartContract.Framework.Services; +using Neo.SmartContract.Framework; using Neo.SmartContract.Framework.Attributes; +using Neo.SmartContract.Framework.Services; +using System.Numerics; namespace FlamingoSwapFactory { diff --git a/Swap/flamingo-contract-swap/FlamingoSwapFactory/FlamingoSwapFactoryContract.cs b/Swap/flamingo-contract-swap/FlamingoSwapFactory/FlamingoSwapFactoryContract.cs index 77370db..5164b1e 100644 --- a/Swap/flamingo-contract-swap/FlamingoSwapFactory/FlamingoSwapFactoryContract.cs +++ b/Swap/flamingo-contract-swap/FlamingoSwapFactory/FlamingoSwapFactoryContract.cs @@ -1,10 +1,9 @@ -using System.ComponentModel; -using FlamingoSwapFactory.Models; -using Neo; +using FlamingoSwapFactory.Models; using Neo.SmartContract.Framework; +using Neo.SmartContract.Framework.Attributes; using Neo.SmartContract.Framework.Native; using Neo.SmartContract.Framework.Services; -using Neo.SmartContract.Framework.Attributes; +using System.ComponentModel; namespace FlamingoSwapFactory { diff --git a/Swap/flamingo-contract-swap/FlamingoSwapFactory/Models/ExchangePair.cs b/Swap/flamingo-contract-swap/FlamingoSwapFactory/Models/ExchangePair.cs index 7edb43a..2c12bc9 100644 --- a/Swap/flamingo-contract-swap/FlamingoSwapFactory/Models/ExchangePair.cs +++ b/Swap/flamingo-contract-swap/FlamingoSwapFactory/Models/ExchangePair.cs @@ -1,4 +1,4 @@ -using Neo; +using Neo.SmartContract.Framework; namespace FlamingoSwapFactory.Models { diff --git a/Swap/flamingo-contract-swap/FlamingoSwapFactory/Models/KeyValue.cs b/Swap/flamingo-contract-swap/FlamingoSwapFactory/Models/KeyValue.cs index 9638d48..5117bca 100644 --- a/Swap/flamingo-contract-swap/FlamingoSwapFactory/Models/KeyValue.cs +++ b/Swap/flamingo-contract-swap/FlamingoSwapFactory/Models/KeyValue.cs @@ -1,4 +1,4 @@ -using Neo; +using Neo.SmartContract.Framework; namespace FlamingoSwapFactory.Models { diff --git a/Swap/flamingo-contract-swap/FlamingoSwapOrderBook/FlamingoSwapOrderBook.csproj b/Swap/flamingo-contract-swap/FlamingoSwapOrderBook/FlamingoSwapOrderBook.csproj index ec0abe1..c64fef1 100644 --- a/Swap/flamingo-contract-swap/FlamingoSwapOrderBook/FlamingoSwapOrderBook.csproj +++ b/Swap/flamingo-contract-swap/FlamingoSwapOrderBook/FlamingoSwapOrderBook.csproj @@ -1,12 +1,13 @@  - - net6.0 - - - - - - - - + + net8.0 + + + + + + + + + \ No newline at end of file diff --git a/Swap/flamingo-contract-swap/FlamingoSwapOrderBook/FlamingoSwapOrderBookContract.Admin.cs b/Swap/flamingo-contract-swap/FlamingoSwapOrderBook/FlamingoSwapOrderBookContract.Admin.cs index a2ad05c..ba1e1c6 100644 --- a/Swap/flamingo-contract-swap/FlamingoSwapOrderBook/FlamingoSwapOrderBookContract.Admin.cs +++ b/Swap/flamingo-contract-swap/FlamingoSwapOrderBook/FlamingoSwapOrderBookContract.Admin.cs @@ -1,6 +1,4 @@ -using Neo; -using Neo.SmartContract; -using Neo.SmartContract.Framework; +using Neo.SmartContract.Framework; using Neo.SmartContract.Framework.Attributes; using Neo.SmartContract.Framework.Native; using Neo.SmartContract.Framework.Services; @@ -12,14 +10,11 @@ public partial class FlamingoSwapOrderBookContract #region Admin #warning Update the admin address if necessary - [InitialValue("NdDvLrbtqeCVQkaLstAwh3md8SYYwqWRaE", ContractParameterType.Hash160)] - static readonly UInt160 superAdmin = default; + static readonly UInt160 superAdmin = "NdDvLrbtqeCVQkaLstAwh3md8SYYwqWRaE"; - [InitialValue("0xc0695bdb8a87a40aff33c73ff6349ccc05fa9f01", ContractParameterType.Hash160)] - static readonly UInt160 Factory = default; + static readonly UInt160 Factory = "0xc0695bdb8a87a40aff33c73ff6349ccc05fa9f01"; - [InitialValue("0xd6abe115ecb75e1fa0b42f5e85934ce8c1ae2893", ContractParameterType.Hash160)] - static readonly UInt160 bNEO = default; + static readonly UInt160 bNEO = "0xd6abe115ecb75e1fa0b42f5e85934ce8c1ae2893"; static readonly uint ORDER_PER_PAGE = 1 << 8; diff --git a/Swap/flamingo-contract-swap/FlamingoSwapOrderBook/Models/BookInfo.cs b/Swap/flamingo-contract-swap/FlamingoSwapOrderBook/Models/BookInfo.cs index e456a04..f728312 100644 --- a/Swap/flamingo-contract-swap/FlamingoSwapOrderBook/Models/BookInfo.cs +++ b/Swap/flamingo-contract-swap/FlamingoSwapOrderBook/Models/BookInfo.cs @@ -1,4 +1,4 @@ -using Neo; +using Neo.SmartContract.Framework; using System.Numerics; namespace FlamingoSwapOrderBook diff --git a/Swap/flamingo-contract-swap/FlamingoSwapPair/FlamingoSwapPair.csproj b/Swap/flamingo-contract-swap/FlamingoSwapPair/FlamingoSwapPair.csproj index 421d2b5..97cc3ce 100644 --- a/Swap/flamingo-contract-swap/FlamingoSwapPair/FlamingoSwapPair.csproj +++ b/Swap/flamingo-contract-swap/FlamingoSwapPair/FlamingoSwapPair.csproj @@ -1,13 +1,14 @@  - net6.0 + net8.0 - - + - + + + diff --git a/Swap/flamingo-contract-swap/FlamingoSwapPair/FlamingoSwapPairContract.Admin.cs b/Swap/flamingo-contract-swap/FlamingoSwapPair/FlamingoSwapPairContract.Admin.cs index 4a363e3..101cafc 100644 --- a/Swap/flamingo-contract-swap/FlamingoSwapPair/FlamingoSwapPairContract.Admin.cs +++ b/Swap/flamingo-contract-swap/FlamingoSwapPair/FlamingoSwapPairContract.Admin.cs @@ -1,10 +1,8 @@ -using System.Numerics; -using System.ComponentModel; -using Neo; using Neo.SmartContract.Framework; -using Neo.SmartContract.Framework.Services; -using Neo.SmartContract.Framework.Native; using Neo.SmartContract.Framework.Attributes; +using Neo.SmartContract.Framework.Native; +using Neo.SmartContract.Framework.Services; +using System.Numerics; namespace FlamingoSwapPair { @@ -13,11 +11,9 @@ partial class FlamingoSwapPairContract #region Settings //Test - [InitialValue("NVGUQ1qyL4SdSm7sVmGVkXetjEsvw2L3NT", Neo.SmartContract.ContractParameterType.Hash160)] - static readonly UInt160 superAdmin = default; + static readonly UInt160 superAdmin = "NVGUQ1qyL4SdSm7sVmGVkXetjEsvw2L3NT"; - [InitialValue("0xf9c55e595b39ded1e866efcc163445a168d378d5", Neo.SmartContract.ContractParameterType.Hash160)] - static readonly UInt160 WhiteListContract = default; + static readonly UInt160 WhiteListContract = "0xf9c55e595b39ded1e866efcc163445a168d378d5"; ////Main //[InitialValue("NdDvLrbtqeCVQkaLstAwh3md8SYYwqWRaE", Neo.SmartContract.ContractParameterType.Hash160)] @@ -29,16 +25,15 @@ partial class FlamingoSwapPairContract #region TokenAB - [DisplayName("symbol")] + [Safe] public static string Symbol() => "FLP-fWBTC-fUSDT"; //symbol of the token - #region tokenA - [InitialValue("0x9b9f7db02c0a2d6aa5ad9be7bba843027bf5b5f2", Neo.SmartContract.ContractParameterType.Hash160)] //bENO - static readonly UInt160 TokenA = default; + #region tokenA + //bENO + static readonly UInt160 TokenA = "0x9b9f7db02c0a2d6aa5ad9be7bba843027bf5b5f2"; #endregion - [InitialValue("0xa2d5f4378c42d118ebc7e1690f9478d3e00aefa1", Neo.SmartContract.ContractParameterType.Hash160)] - static readonly UInt160 TokenB = default; + static readonly UInt160 TokenB = "0xa2d5f4378c42d118ebc7e1690f9478d3e00aefa1"; #endregion diff --git a/Swap/flamingo-contract-swap/FlamingoSwapPair/FlamingoSwapPairContract.Event.cs b/Swap/flamingo-contract-swap/FlamingoSwapPair/FlamingoSwapPairContract.Event.cs index 2c41127..183f604 100644 --- a/Swap/flamingo-contract-swap/FlamingoSwapPair/FlamingoSwapPairContract.Event.cs +++ b/Swap/flamingo-contract-swap/FlamingoSwapPair/FlamingoSwapPairContract.Event.cs @@ -1,6 +1,6 @@ -using System.ComponentModel; +using Neo.SmartContract.Framework; +using System.ComponentModel; using System.Numerics; -using Neo; namespace FlamingoSwapPair { diff --git a/Swap/flamingo-contract-swap/FlamingoSwapPair/FlamingoSwapPairContract.Nep17.cs b/Swap/flamingo-contract-swap/FlamingoSwapPair/FlamingoSwapPairContract.Nep17.cs index 1e65020..d60ae8f 100644 --- a/Swap/flamingo-contract-swap/FlamingoSwapPair/FlamingoSwapPairContract.Nep17.cs +++ b/Swap/flamingo-contract-swap/FlamingoSwapPair/FlamingoSwapPairContract.Nep17.cs @@ -1,15 +1,18 @@ -using System.Numerics; -using Neo; +using Neo.SmartContract.Framework; +using Neo.SmartContract.Framework.Attributes; using Neo.SmartContract.Framework.Native; using Neo.SmartContract.Framework.Services; +using System.Numerics; namespace FlamingoSwapPair { partial class FlamingoSwapPairContract { + [Safe] public static ulong Decimals() => 8; + [Safe] public static BigInteger TotalSupply() => TotalSupplyStorage.Get(); - + [Safe] public static BigInteger BalanceOf(UInt160 account) { Assert(account.IsValid, "Invalid Account"); diff --git a/Swap/flamingo-contract-swap/FlamingoSwapPairWhiteList/FlamingoSwapPairWhiteList.Admin.cs b/Swap/flamingo-contract-swap/FlamingoSwapPairWhiteList/FlamingoSwapPairWhiteList.Admin.cs index 698ad35..02375f1 100644 --- a/Swap/flamingo-contract-swap/FlamingoSwapPairWhiteList/FlamingoSwapPairWhiteList.Admin.cs +++ b/Swap/flamingo-contract-swap/FlamingoSwapPairWhiteList/FlamingoSwapPairWhiteList.Admin.cs @@ -1,8 +1,6 @@ -using Neo; -using Neo.SmartContract.Framework; +using Neo.SmartContract.Framework; using Neo.SmartContract.Framework.Native; using Neo.SmartContract.Framework.Services; -using Neo.SmartContract.Framework.Attributes; namespace FlamingoSwapPairWhiteList { @@ -10,9 +8,8 @@ public partial class FlamingoSwapPairWhiteList { #region Admin -#warning 检查此处的 Admin 地址是否为最新地址 - [InitialValue("NdDvLrbtqeCVQkaLstAwh3md8SYYwqWRaE", Neo.SmartContract.ContractParameterType.Hash160)] - static readonly UInt160 superAdmin = default; +#warning Please check if the admin here is the latest! + static readonly UInt160 superAdmin = "NdDvLrbtqeCVQkaLstAwh3md8SYYwqWRaE"; const string AdminKey = nameof(superAdmin); diff --git a/Swap/flamingo-contract-swap/FlamingoSwapPairWhiteList/FlamingoSwapPairWhiteList.Event.cs b/Swap/flamingo-contract-swap/FlamingoSwapPairWhiteList/FlamingoSwapPairWhiteList.Event.cs index a6b8b3c..78f2aeb 100644 --- a/Swap/flamingo-contract-swap/FlamingoSwapPairWhiteList/FlamingoSwapPairWhiteList.Event.cs +++ b/Swap/flamingo-contract-swap/FlamingoSwapPairWhiteList/FlamingoSwapPairWhiteList.Event.cs @@ -1,5 +1,5 @@ -using System.ComponentModel; -using Neo; +using Neo.SmartContract.Framework; +using System.ComponentModel; namespace FlamingoSwapPairWhiteList { diff --git a/Swap/flamingo-contract-swap/FlamingoSwapPairWhiteList/FlamingoSwapPairWhiteList.csproj b/Swap/flamingo-contract-swap/FlamingoSwapPairWhiteList/FlamingoSwapPairWhiteList.csproj index 6e12954..99c8955 100644 --- a/Swap/flamingo-contract-swap/FlamingoSwapPairWhiteList/FlamingoSwapPairWhiteList.csproj +++ b/Swap/flamingo-contract-swap/FlamingoSwapPairWhiteList/FlamingoSwapPairWhiteList.csproj @@ -1,15 +1,16 @@  - net6.0 + net8.0 - - + - + + + diff --git a/Swap/flamingo-contract-swap/FlamingoSwapPairWhiteList/KeyValue.cs b/Swap/flamingo-contract-swap/FlamingoSwapPairWhiteList/KeyValue.cs index d7ef789..d92f5ba 100644 --- a/Swap/flamingo-contract-swap/FlamingoSwapPairWhiteList/KeyValue.cs +++ b/Swap/flamingo-contract-swap/FlamingoSwapPairWhiteList/KeyValue.cs @@ -1,5 +1,5 @@ -using System.Numerics; -using Neo; +using Neo.SmartContract.Framework; +using System.Numerics; namespace FlamingoSwapPairWhiteList { diff --git a/Swap/flamingo-contract-swap/FlamingoSwapRouter/FlamingoSwapRouter.csproj b/Swap/flamingo-contract-swap/FlamingoSwapRouter/FlamingoSwapRouter.csproj index e7971ea..1a4671a 100644 --- a/Swap/flamingo-contract-swap/FlamingoSwapRouter/FlamingoSwapRouter.csproj +++ b/Swap/flamingo-contract-swap/FlamingoSwapRouter/FlamingoSwapRouter.csproj @@ -1,14 +1,15 @@  - net6.0 + net8.0 - - + - + + + diff --git a/Swap/flamingo-contract-swap/FlashLoanTemple/FlashLoanTemple.csproj b/Swap/flamingo-contract-swap/FlashLoanTemple/FlashLoanTemple.csproj index 1af96b8..489ea78 100644 --- a/Swap/flamingo-contract-swap/FlashLoanTemple/FlashLoanTemple.csproj +++ b/Swap/flamingo-contract-swap/FlashLoanTemple/FlashLoanTemple.csproj @@ -1,13 +1,13 @@ - net6.0 + net8.0 - + diff --git a/Swap/flamingo-contract-swap/ProxyTemplate/ProxyTemplate.csproj b/Swap/flamingo-contract-swap/ProxyTemplate/ProxyTemplate.csproj index ec0abe1..c64fef1 100644 --- a/Swap/flamingo-contract-swap/ProxyTemplate/ProxyTemplate.csproj +++ b/Swap/flamingo-contract-swap/ProxyTemplate/ProxyTemplate.csproj @@ -1,12 +1,13 @@  - - net6.0 - - - - - - - - + + net8.0 + + + + + + + + + \ No newline at end of file diff --git a/Swap/flamingo-contract-swap/ProxyTemplate/ProxyTemplateContract.Event.cs b/Swap/flamingo-contract-swap/ProxyTemplate/ProxyTemplateContract.Event.cs index b46ebf8..8cfe1db 100644 --- a/Swap/flamingo-contract-swap/ProxyTemplate/ProxyTemplateContract.Event.cs +++ b/Swap/flamingo-contract-swap/ProxyTemplate/ProxyTemplateContract.Event.cs @@ -1,6 +1,6 @@ -using System.ComponentModel; +using Neo.SmartContract.Framework; +using System.ComponentModel; using System.Numerics; -using Neo; namespace ProxyTemplate { diff --git a/Swap/flamingo-contract-swap/flamingo-contract-swap/Swap.cs b/Swap/flamingo-contract-swap/flamingo-contract-swap/Swap.cs index 0f90e07..7d2ad14 100644 --- a/Swap/flamingo-contract-swap/flamingo-contract-swap/Swap.cs +++ b/Swap/flamingo-contract-swap/flamingo-contract-swap/Swap.cs @@ -1,7 +1,4 @@ -using Neo.SmartContract.Framework; - - -namespace flamingo_contract_swap +namespace flamingo_contract_swap { public partial class Swap : SmartContract { From 9057aef96d1c5f6a2b386b19ca755663769089f7 Mon Sep 17 00:00:00 2001 From: superboyiii <573504781@qq.com> Date: Tue, 27 Aug 2024 11:19:31 +0800 Subject: [PATCH 2/2] fix FlamingoSwapRouter --- .../FlamingoSwapRouterContract.Admin.cs | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/Swap/flamingo-contract-swap/FlamingoSwapRouter/FlamingoSwapRouterContract.Admin.cs b/Swap/flamingo-contract-swap/FlamingoSwapRouter/FlamingoSwapRouterContract.Admin.cs index b94f28f..5f655de 100644 --- a/Swap/flamingo-contract-swap/FlamingoSwapRouter/FlamingoSwapRouterContract.Admin.cs +++ b/Swap/flamingo-contract-swap/FlamingoSwapRouter/FlamingoSwapRouterContract.Admin.cs @@ -1,20 +1,14 @@ -using Neo; -using Neo.SmartContract.Framework; -using Neo.SmartContract.Framework.Services; +using Neo.SmartContract.Framework; using Neo.SmartContract.Framework.Native; -using Neo.SmartContract; -using Neo.SmartContract.Framework.Attributes; +using Neo.SmartContract.Framework.Services; namespace FlamingoSwapRouter { public partial class FlamingoSwapRouterContract { #region Admin - [InitialValue("NVGUQ1qyL4SdSm7sVmGVkXetjEsvw2L3NT", ContractParameterType.Hash160)] - static readonly UInt160 superAdmin = default; - - [InitialValue("0x52bf47559436d3572a9b1cb83c056dc39cb42d0d", ContractParameterType.Hash160)] - static readonly UInt160 Factory = default; + static readonly UInt160 superAdmin = "NVGUQ1qyL4SdSm7sVmGVkXetjEsvw2L3NT"; + static readonly UInt160 Factory = "0x52bf47559436d3572a9b1cb83c056dc39cb42d0d"; //[InitialValue("NdDvLrbtqeCVQkaLstAwh3md8SYYwqWRaE", ContractParameterType.Hash160)] //static readonly UInt160 superAdmin = default;