From bcf35f00055fda4fb49861eadf3740592a3cd304 Mon Sep 17 00:00:00 2001 From: Jim8y Date: Fri, 24 May 2024 08:52:51 +0800 Subject: [PATCH] use NEP 26 and NEP 27 --- src/Neo.SmartContract.Framework/NEPStandard.cs | 8 ++++---- .../SupportedStandardsTest.cs | 4 ++-- .../Contract_SupportedStandard11Payable.cs | 2 +- .../Contract_SupportedStandard17Payable.cs | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/Neo.SmartContract.Framework/NEPStandard.cs b/src/Neo.SmartContract.Framework/NEPStandard.cs index a72b0230a..ca6817815 100644 --- a/src/Neo.SmartContract.Framework/NEPStandard.cs +++ b/src/Neo.SmartContract.Framework/NEPStandard.cs @@ -22,13 +22,13 @@ public enum NepStandard // Smart contract transfer callback for non-fungible tokens (NFTs). // This is an extension standard of NEP-11. // Defined at https://github.com/neo-project/proposals/pull/169/files#diff-2b5f7c12a23f7dbe4cb46bbf4be6936882f8e0f0b3a4db9d8c58eb294b02e6ed - Nep25, + Nep26, // This is the nick name of NEP-25. Nep11Payable, // Smart contract transfer callback for fungible tokens. // This is an extension standard of NEP-17. // Defined at https://github.com/neo-project/proposals/pull/169/files#diff-70768f307c9aa84f8c94e790495a76d47fffeca2331444592ebba6f13b1e6460 - Nep26, + Nep27, // This is the nick name of NEP-26. Nep17Payable, // This NEP defines a global standard to get royalty payment information for Non-Fungible Tokens (NFTs) @@ -46,9 +46,9 @@ public static string ToStandard(this NepStandard standard) { NepStandard.Nep11 => "NEP-11", NepStandard.Nep17 => "NEP-17", - NepStandard.Nep11Payable or NepStandard.Nep25 => "NEP-25", - NepStandard.Nep17Payable or NepStandard.Nep26 => "NEP-26", NepStandard.Nep24 => "NEP-24", + NepStandard.Nep11Payable or NepStandard.Nep26 => "NEP-26", + NepStandard.Nep17Payable or NepStandard.Nep27 => "NEP-27", _ => standard.ToString() }; } diff --git a/tests/Neo.SmartContract.Framework.UnitTests/SupportedStandardsTest.cs b/tests/Neo.SmartContract.Framework.UnitTests/SupportedStandardsTest.cs index bd1dc8427..e2d356741 100644 --- a/tests/Neo.SmartContract.Framework.UnitTests/SupportedStandardsTest.cs +++ b/tests/Neo.SmartContract.Framework.UnitTests/SupportedStandardsTest.cs @@ -27,13 +27,13 @@ public void TestStandardNEP17AttributeEnum() [TestMethod] public void TestStandardNEP11PayableAttribute() { - CollectionAssert.AreEqual(Contract_SupportedStandard11Payable.Manifest.SupportedStandards, new string[] { "NEP-25" }); + CollectionAssert.AreEqual(Contract_SupportedStandard11Payable.Manifest.SupportedStandards, new string[] { "NEP-26" }); } [TestMethod] public void TestStandardNEP17PayableAttribute() { - CollectionAssert.AreEqual(Contract_SupportedStandard17Payable.Manifest.SupportedStandards, new string[] { "NEP-26" }); + CollectionAssert.AreEqual(Contract_SupportedStandard17Payable.Manifest.SupportedStandards, new string[] { "NEP-27" }); } } } diff --git a/tests/Neo.SmartContract.Framework.UnitTests/TestingArtifacts/Contract_SupportedStandard11Payable.cs b/tests/Neo.SmartContract.Framework.UnitTests/TestingArtifacts/Contract_SupportedStandard11Payable.cs index 1d60a9a13..bef090158 100644 --- a/tests/Neo.SmartContract.Framework.UnitTests/TestingArtifacts/Contract_SupportedStandard11Payable.cs +++ b/tests/Neo.SmartContract.Framework.UnitTests/TestingArtifacts/Contract_SupportedStandard11Payable.cs @@ -10,7 +10,7 @@ public abstract class Contract_SupportedStandard11Payable : Neo.SmartContract.Te { #region Compiled data - public static readonly Neo.SmartContract.Manifest.ContractManifest Manifest = Neo.SmartContract.Manifest.ContractManifest.Parse(@"{""name"":""Contract_SupportedStandard11Payable"",""groups"":[],""features"":{},""supportedstandards"":[""NEP-25""],""abi"":{""methods"":[{""name"":""onNEP11Payment"",""parameters"":[{""name"":""from"",""type"":""Hash160""},{""name"":""amount"",""type"":""Integer""},{""name"":""tokenId"",""type"":""String""},{""name"":""data"",""type"":""Any""}],""returntype"":""Void"",""offset"":15,""safe"":false}],""events"":[]},""permissions"":[{""contract"":""*"",""methods"":""*""}],""trusts"":[],""extra"":{""Description"":""\u003CDescription Here\u003E"",""Author"":""\u003CYour Name Or Company Here\u003E"",""Version"":""\u003CVersion String Here\u003E""}}"); + public static readonly Neo.SmartContract.Manifest.ContractManifest Manifest = Neo.SmartContract.Manifest.ContractManifest.Parse(@"{""name"":""Contract_SupportedStandard11Payable"",""groups"":[],""features"":{},""supportedstandards"":[""NEP-26""],""abi"":{""methods"":[{""name"":""onNEP11Payment"",""parameters"":[{""name"":""from"",""type"":""Hash160""},{""name"":""amount"",""type"":""Integer""},{""name"":""tokenId"",""type"":""String""},{""name"":""data"",""type"":""Any""}],""returntype"":""Void"",""offset"":15,""safe"":false}],""events"":[]},""permissions"":[{""contract"":""*"",""methods"":""*""}],""trusts"":[],""extra"":{""Description"":""\u003CDescription Here\u003E"",""Author"":""\u003CYour Name Or Company Here\u003E"",""Version"":""\u003CVersion String Here\u003E""}}"); public static readonly Neo.SmartContract.NefFile Nef = Neo.IO.Helper.AsSerializable(Convert.FromBase64String(@"TkVGM1Rlc3RpbmdFbmdpbmUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABVXAAVAVwABeDQDQFcAAUDCSjTzIu1tevRy")); diff --git a/tests/Neo.SmartContract.Framework.UnitTests/TestingArtifacts/Contract_SupportedStandard17Payable.cs b/tests/Neo.SmartContract.Framework.UnitTests/TestingArtifacts/Contract_SupportedStandard17Payable.cs index 170d12f99..35b371918 100644 --- a/tests/Neo.SmartContract.Framework.UnitTests/TestingArtifacts/Contract_SupportedStandard17Payable.cs +++ b/tests/Neo.SmartContract.Framework.UnitTests/TestingArtifacts/Contract_SupportedStandard17Payable.cs @@ -10,7 +10,7 @@ public abstract class Contract_SupportedStandard17Payable : Neo.SmartContract.Te { #region Compiled data - public static readonly Neo.SmartContract.Manifest.ContractManifest Manifest = Neo.SmartContract.Manifest.ContractManifest.Parse(@"{""name"":""Contract_SupportedStandard17Payable"",""groups"":[],""features"":{},""supportedstandards"":[""NEP-26""],""abi"":{""methods"":[{""name"":""onNEP17Payment"",""parameters"":[{""name"":""from"",""type"":""Hash160""},{""name"":""amount"",""type"":""Integer""},{""name"":""data"",""type"":""Any""}],""returntype"":""Void"",""offset"":15,""safe"":false}],""events"":[]},""permissions"":[{""contract"":""*"",""methods"":""*""}],""trusts"":[],""extra"":{""Description"":""\u003CDescription Here\u003E"",""Author"":""\u003CYour Name Or Company Here\u003E"",""Version"":""\u003CVersion String Here\u003E""}}"); + public static readonly Neo.SmartContract.Manifest.ContractManifest Manifest = Neo.SmartContract.Manifest.ContractManifest.Parse(@"{""name"":""Contract_SupportedStandard17Payable"",""groups"":[],""features"":{},""supportedstandards"":[""NEP-27""],""abi"":{""methods"":[{""name"":""onNEP17Payment"",""parameters"":[{""name"":""from"",""type"":""Hash160""},{""name"":""amount"",""type"":""Integer""},{""name"":""data"",""type"":""Any""}],""returntype"":""Void"",""offset"":15,""safe"":false}],""events"":[]},""permissions"":[{""contract"":""*"",""methods"":""*""}],""trusts"":[],""extra"":{""Description"":""\u003CDescription Here\u003E"",""Author"":""\u003CYour Name Or Company Here\u003E"",""Version"":""\u003CVersion String Here\u003E""}}"); public static readonly Neo.SmartContract.NefFile Nef = Neo.IO.Helper.AsSerializable(Convert.FromBase64String(@"TkVGM1Rlc3RpbmdFbmdpbmUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABVXAARAVwABeDQDQFcAAUDCSjTzIu3rbva0"));