From 8df1f98454fb06f046cbb9f1f45e85fa8f70f80b Mon Sep 17 00:00:00 2001 From: Hecate2 <2474101468@qq.com> Date: Thu, 24 Oct 2024 14:01:09 +0800 Subject: [PATCH] nullable Storage.Get --- src/Neo.SmartContract.Framework/ByteString.cs | 5 -- .../Neo.SmartContract.Framework.csproj | 1 + src/Neo.SmartContract.Framework/Nep17Token.cs | 4 +- .../Services/Contract.cs | 2 +- .../Services/Storage.cs | 8 +-- .../Services/StorageMap.cs | 20 ++++--- .../TokenContract.cs | 38 ++++++++---- .../TestingArtifacts/Contract_NEP11.cs | 60 ++++++++----------- .../TestingArtifacts/Contract_NEP17.cs | 54 +++++++---------- .../TestingArtifacts/Contract_Helper.cs | 15 ++--- .../Contract_StaticStorageMap.cs | 37 ++++-------- .../Contract_SupportedStandard11Enum.cs | 60 ++++++++----------- .../Contract_SupportedStandard17Enum.cs | 54 +++++++---------- .../Nep17ContractTemplate.artifacts.cs | 54 +++++++---------- 14 files changed, 173 insertions(+), 239 deletions(-) diff --git a/src/Neo.SmartContract.Framework/ByteString.cs b/src/Neo.SmartContract.Framework/ByteString.cs index dbda32356..f946c7147 100644 --- a/src/Neo.SmartContract.Framework/ByteString.cs +++ b/src/Neo.SmartContract.Framework/ByteString.cs @@ -54,11 +54,6 @@ IEnumerator IEnumerable.GetEnumerator() [OpCode(OpCode.CONVERT, StackItemType.ByteString)] public static extern explicit operator ByteString(byte[] buffer); - [OpCode(OpCode.DUP)] - [OpCode(OpCode.ISNULL)] - [OpCode(OpCode.JMPIFNOT, "0x04")] - [OpCode(OpCode.DROP)] - [OpCode(OpCode.PUSH0)] [OpCode(OpCode.CONVERT, StackItemType.Integer)] public static extern explicit operator BigInteger(ByteString text); diff --git a/src/Neo.SmartContract.Framework/Neo.SmartContract.Framework.csproj b/src/Neo.SmartContract.Framework/Neo.SmartContract.Framework.csproj index f661df4ad..f8073096b 100644 --- a/src/Neo.SmartContract.Framework/Neo.SmartContract.Framework.csproj +++ b/src/Neo.SmartContract.Framework/Neo.SmartContract.Framework.csproj @@ -1,6 +1,7 @@ + enable net8.0 Neo.SmartContract.Framework Neo.SmartContract.Framework diff --git a/src/Neo.SmartContract.Framework/Nep17Token.cs b/src/Neo.SmartContract.Framework/Nep17Token.cs index 807aa7e2b..40d5694e0 100644 --- a/src/Neo.SmartContract.Framework/Nep17Token.cs +++ b/src/Neo.SmartContract.Framework/Nep17Token.cs @@ -21,7 +21,7 @@ namespace Neo.SmartContract.Framework [ContractPermission(Permission.Any, Method.OnNEP17Payment)] public abstract class Nep17Token : TokenContract { - public delegate void OnTransferDelegate(UInt160 from, UInt160 to, BigInteger amount); + public delegate void OnTransferDelegate(UInt160? from, UInt160? to, BigInteger amount); [DisplayName("Transfer")] public static event OnTransferDelegate OnTransfer; @@ -64,7 +64,7 @@ protected static void Burn(UInt160 account, BigInteger amount) PostTransfer(account, null, amount, null); } - protected static void PostTransfer(UInt160 from, UInt160 to, BigInteger amount, object data) + protected static void PostTransfer(UInt160? from, UInt160? to, BigInteger amount, object? data) { OnTransfer(from, to, amount); if (to is not null && ContractManagement.GetContract(to) is not null) diff --git a/src/Neo.SmartContract.Framework/Services/Contract.cs b/src/Neo.SmartContract.Framework/Services/Contract.cs index 724692dc6..ed84d3ddc 100644 --- a/src/Neo.SmartContract.Framework/Services/Contract.cs +++ b/src/Neo.SmartContract.Framework/Services/Contract.cs @@ -40,7 +40,7 @@ public class Contract public readonly ContractManifest Manifest; [Syscall("System.Contract.Call")] - public static extern object Call(UInt160 scriptHash, string method, CallFlags flags, params object[] args); + public static extern object Call(UInt160 scriptHash, string method, CallFlags flags, params object[]? args); [Syscall("System.Contract.GetCallFlags")] public static extern CallFlags GetCallFlags(); diff --git a/src/Neo.SmartContract.Framework/Services/Storage.cs b/src/Neo.SmartContract.Framework/Services/Storage.cs index db06d7e7f..f792ee2a1 100644 --- a/src/Neo.SmartContract.Framework/Services/Storage.cs +++ b/src/Neo.SmartContract.Framework/Services/Storage.cs @@ -37,13 +37,13 @@ public static extern StorageContext CurrentReadOnlyContext /// Returns the value corresponding to the given key for Storage context (faster: generates opcode directly) /// [Syscall("System.Storage.Get")] - public static extern ByteString Get(StorageContext context, ByteString key); + public static extern ByteString? Get(StorageContext context, ByteString key); /// /// Returns the value corresponding to the given key for Storage context (faster: generates opcode directly) /// [Syscall("System.Storage.Get")] - public static extern ByteString Get(StorageContext context, byte[] key); + public static extern ByteString? Get(StorageContext context, byte[] key); /// /// Writes the key/value pair for the given Storage context (faster: generates opcode directly) @@ -100,8 +100,8 @@ public static extern StorageContext CurrentReadOnlyContext public static extern Iterator Find(StorageContext context, byte[] prefix, FindOptions options = FindOptions.None); #region Interface with default Context - public static ByteString Get(ByteString key) => Get(CurrentReadOnlyContext, key); - public static ByteString Get(byte[] key) => Get(CurrentReadOnlyContext, key); + public static ByteString? Get(ByteString key) => Get(CurrentReadOnlyContext, key); + public static ByteString? Get(byte[] key) => Get(CurrentReadOnlyContext, key); public static void Put(ByteString key, ByteString value) => Put(CurrentContext, key, value); public static void Put(byte[] key, ByteString value) => Put(CurrentContext, key, value); public static void Put(byte[] key, byte[] value) => Put(CurrentContext, key, value); diff --git a/src/Neo.SmartContract.Framework/Services/StorageMap.cs b/src/Neo.SmartContract.Framework/Services/StorageMap.cs index c74d88f46..0b45f12e7 100644 --- a/src/Neo.SmartContract.Framework/Services/StorageMap.cs +++ b/src/Neo.SmartContract.Framework/Services/StorageMap.cs @@ -23,7 +23,7 @@ public class StorageMap private readonly StorageContext context; private readonly byte[] prefix; - public extern ByteString this[ByteString key] + public extern ByteString? this[ByteString key] { [CallingConvention(CallingConvention.Cdecl)] [OpCode(OpCode.UNPACK)] @@ -43,7 +43,7 @@ public extern ByteString this[ByteString key] set; } - public extern ByteString this[byte[] key] + public extern ByteString? this[byte[] key] { [CallingConvention(CallingConvention.Cdecl)] [OpCode(OpCode.UNPACK)] @@ -112,7 +112,9 @@ public extern ByteString this[byte[] key] [OpCode(OpCode.CAT)] [OpCode(OpCode.SWAP)] [Syscall("System.Storage.Get")] - public extern ByteString Get(ByteString key); +#pragma warning disable CS8632 // The annotation for nullable reference types should only be used in code within a '#nullable' annotations context. + public extern ByteString? Get(ByteString key); +#pragma warning restore CS8632 // The annotation for nullable reference types should only be used in code within a '#nullable' annotations context. [CallingConvention(CallingConvention.Cdecl)] [OpCode(OpCode.UNPACK)] @@ -204,7 +206,9 @@ public extern ByteString this[byte[] key] [OpCode(OpCode.CAT)] [OpCode(OpCode.SWAP)] [Syscall("System.Storage.Get")] - public extern ByteString Get(byte[] key); +#pragma warning disable CS8632 // The annotation for nullable reference types should only be used in code within a '#nullable' annotations context. + public extern ByteString? Get(byte[] key); +#pragma warning restore CS8632 // The annotation for nullable reference types should only be used in code within a '#nullable' annotations context. [CallingConvention(CallingConvention.Cdecl)] [OpCode(OpCode.UNPACK)] @@ -289,16 +293,16 @@ public extern ByteString this[byte[] key] [OpCode(OpCode.CONVERT, StackItemType.Integer)] public extern BigInteger GetIntegerOrZero(byte[] key); - public object GetObject(ByteString key) + public object? GetObject(ByteString key) { - ByteString value = Get(key); + ByteString? value = Get(key); if (value is null) return null; return StdLib.Deserialize(value); } - public object GetObject(byte[] key) + public object? GetObject(byte[] key) { - ByteString value = Get(key); + ByteString? value = Get(key); if (value is null) return null; return StdLib.Deserialize(value); } diff --git a/src/Neo.SmartContract.Framework/TokenContract.cs b/src/Neo.SmartContract.Framework/TokenContract.cs index 2f7354ed8..a65f03c38 100644 --- a/src/Neo.SmartContract.Framework/TokenContract.cs +++ b/src/Neo.SmartContract.Framework/TokenContract.cs @@ -17,35 +17,49 @@ namespace Neo.SmartContract.Framework { public abstract class TokenContract : SmartContract { - protected const byte Prefix_TotalSupply = 0x00; - protected const byte Prefix_Balance = 0x01; + protected static readonly ByteString Prefix_TotalSupply = "\x00"; + protected static readonly ByteString Prefix_Balance = "\x01"; public abstract string Symbol { [Safe] get; } public abstract byte Decimals { [Safe] get; } - [Stored(Prefix_TotalSupply)] - public static BigInteger TotalSupply { [Safe] get; protected set; } + public static BigInteger TotalSupply + { + [Safe] + get + { + ByteString? stored = Storage.Get(Prefix_TotalSupply); + return stored != null ? (BigInteger)stored : 0; + } + protected set + { + Storage.Put(Prefix_TotalSupply, value); + } + } [Safe] public static BigInteger BalanceOf(UInt160 owner) { if (owner is null || !owner.IsValid) throw new Exception("The argument \"owner\" is invalid."); - StorageMap balanceMap = new(Storage.CurrentContext, Prefix_Balance); - return (BigInteger)balanceMap[owner]; + ByteString? balanceStored = Storage.Get(Prefix_Balance + owner); + return balanceStored != null ? (BigInteger)balanceStored : 0; } protected static bool UpdateBalance(UInt160 owner, BigInteger increment) { - StorageMap balanceMap = new(Storage.CurrentContext, Prefix_Balance); - BigInteger balance = (BigInteger)balanceMap[owner]; + StorageContext currentContext = Storage.CurrentContext; + ByteString ownerKey = Prefix_Balance + owner; + ByteString? balanceStored = Storage.Get(currentContext, ownerKey); + BigInteger balance = balanceStored != null ? (BigInteger)balanceStored : 0; balance += increment; - if (balance < 0) return false; - if (balance.IsZero) - balanceMap.Delete(owner); + if (balance < 0) + return false; + if (balance == 0) + Storage.Delete(currentContext, ownerKey); else - balanceMap.Put(owner, balance); + Storage.Put(currentContext, ownerKey, balance); return true; } } diff --git a/tests/Neo.Compiler.CSharp.UnitTests/TestingArtifacts/Contract_NEP11.cs b/tests/Neo.Compiler.CSharp.UnitTests/TestingArtifacts/Contract_NEP11.cs index 782de98d6..b0af9f106 100644 --- a/tests/Neo.Compiler.CSharp.UnitTests/TestingArtifacts/Contract_NEP11.cs +++ b/tests/Neo.Compiler.CSharp.UnitTests/TestingArtifacts/Contract_NEP11.cs @@ -10,12 +10,12 @@ public abstract class Contract_NEP11(Neo.SmartContract.Testing.SmartContractInit { #region Compiled data - public static Neo.SmartContract.Manifest.ContractManifest Manifest => Neo.SmartContract.Manifest.ContractManifest.Parse(@"{""name"":""Contract_NEP11"",""groups"":[],""features"":{},""supportedstandards"":[""NEP-11""],""abi"":{""methods"":[{""name"":""symbol"",""parameters"":[],""returntype"":""String"",""offset"":0,""safe"":true},{""name"":""decimals"",""parameters"":[],""returntype"":""Integer"",""offset"":7,""safe"":true},{""name"":""totalSupply"",""parameters"":[],""returntype"":""Integer"",""offset"":9,""safe"":true},{""name"":""balanceOf"",""parameters"":[{""name"":""owner"",""type"":""Hash160""}],""returntype"":""Integer"",""offset"":35,""safe"":true},{""name"":""ownerOf"",""parameters"":[{""name"":""tokenId"",""type"":""ByteArray""}],""returntype"":""Hash160"",""offset"":218,""safe"":true},{""name"":""properties"",""parameters"":[{""name"":""tokenId"",""type"":""ByteArray""}],""returntype"":""Map"",""offset"":377,""safe"":true},{""name"":""tokens"",""parameters"":[],""returntype"":""InteropInterface"",""offset"":424,""safe"":true},{""name"":""tokensOf"",""parameters"":[{""name"":""owner"",""type"":""Hash160""}],""returntype"":""InteropInterface"",""offset"":452,""safe"":true},{""name"":""transfer"",""parameters"":[{""name"":""to"",""type"":""Hash160""},{""name"":""tokenId"",""type"":""ByteArray""},{""name"":""data"",""type"":""Any""}],""returntype"":""Boolean"",""offset"":541,""safe"":false},{""name"":""_initialize"",""parameters"":[],""returntype"":""Void"",""offset"":835,""safe"":false}],""events"":[{""name"":""Transfer"",""parameters"":[{""name"":""from"",""type"":""Hash160""},{""name"":""to"",""type"":""Hash160""},{""name"":""amount"",""type"":""Integer""},{""name"":""tokenId"",""type"":""ByteArray""}]}]},""permissions"":[{""contract"":""0x726cb6e0cd8628a1350a611384688911ab75f51b"",""methods"":[""sha256""]},{""contract"":""0xacce6fd80d44e1796aa0c2c625e9e4e0ce39efc0"",""methods"":[""deserialize"",""serialize""]},{""contract"":""0xfffdc93764dbaddd97c48f252a53ea4643faa3fd"",""methods"":[""getContract""]},{""contract"":""*"",""methods"":[""onNEP11Payment""]}],""trusts"":[],""extra"":{""nef"":{""optimization"":""All""}}}"); + public static Neo.SmartContract.Manifest.ContractManifest Manifest => Neo.SmartContract.Manifest.ContractManifest.Parse(@"{""name"":""Contract_NEP11"",""groups"":[],""features"":{},""supportedstandards"":[""NEP-11""],""abi"":{""methods"":[{""name"":""symbol"",""parameters"":[],""returntype"":""String"",""offset"":0,""safe"":true},{""name"":""decimals"",""parameters"":[],""returntype"":""Integer"",""offset"":7,""safe"":true},{""name"":""totalSupply"",""parameters"":[],""returntype"":""Integer"",""offset"":9,""safe"":true},{""name"":""balanceOf"",""parameters"":[{""name"":""owner"",""type"":""Hash160""}],""returntype"":""Integer"",""offset"":42,""safe"":true},{""name"":""ownerOf"",""parameters"":[{""name"":""tokenId"",""type"":""ByteArray""}],""returntype"":""Hash160"",""offset"":195,""safe"":true},{""name"":""properties"",""parameters"":[{""name"":""tokenId"",""type"":""ByteArray""}],""returntype"":""Map"",""offset"":354,""safe"":true},{""name"":""tokens"",""parameters"":[],""returntype"":""InteropInterface"",""offset"":401,""safe"":true},{""name"":""tokensOf"",""parameters"":[{""name"":""owner"",""type"":""Hash160""}],""returntype"":""InteropInterface"",""offset"":429,""safe"":true},{""name"":""transfer"",""parameters"":[{""name"":""to"",""type"":""Hash160""},{""name"":""tokenId"",""type"":""ByteArray""},{""name"":""data"",""type"":""Any""}],""returntype"":""Boolean"",""offset"":518,""safe"":false},{""name"":""_initialize"",""parameters"":[],""returntype"":""Void"",""offset"":815,""safe"":false}],""events"":[{""name"":""Transfer"",""parameters"":[{""name"":""from"",""type"":""Hash160""},{""name"":""to"",""type"":""Hash160""},{""name"":""amount"",""type"":""Integer""},{""name"":""tokenId"",""type"":""ByteArray""}]}]},""permissions"":[{""contract"":""0x726cb6e0cd8628a1350a611384688911ab75f51b"",""methods"":[""sha256""]},{""contract"":""0xacce6fd80d44e1796aa0c2c625e9e4e0ce39efc0"",""methods"":[""deserialize"",""serialize""]},{""contract"":""0xfffdc93764dbaddd97c48f252a53ea4643faa3fd"",""methods"":[""getContract""]},{""contract"":""*"",""methods"":[""onNEP11Payment""]}],""trusts"":[],""extra"":{""nef"":{""optimization"":""All""}}}"); /// /// Optimization: "All" /// - public static Neo.SmartContract.NefFile Nef => Neo.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QQZv2Z84SwHB4aMFFU4tQQZJd6DFK2CY0RQwuVGhlIHRva2VuIHdpdGggZ2l2ZW4gInRva2VuSWQiIGRvZXMgbm90IGV4aXN0LjpxaTcAAHJqEM5AVwIBExGIThBR0EGb9mfOEsBweGjBRVOLUEGSXegxNwAAcchKDARuYW1laRHO0EBXAQATEYhOEFHQQZv2Z84SwHATaMFFQd8wuJpAVwEBeHBoC5cmBQgiDXhK2ShQygAUs6uqJiQMH1RoZSBhcmd1bWVudCAib3duZXIiIGlzIGludmFsaWQ6FBGIThBR0EGb9mfOEsBwE3howUVTi1BB3zC4mkBXAwN4cGgLlyYFCCINeErZKFDKABSzq6omIgwdVGhlIGFyZ3VtZW50ICJ0byIgaXMgaW52YWxpZC46ExGIThBR0EGb9mfOEsBweWjBRVOLUEGSXegxNwAAcWkQznJqQfgn7IyqJgQJQGp4mCYleEppEFHQRWk3AQBKeWjBRVOLUEHmPxiERQ95ajQSEXl4NA16eXhqNUgAAAAIQFcCA3p4Ndf9//9FQZv2Z84UEYhOEFHQUBLAcHh5i9socXoQtyYQEGlowUVTi1BB5j8YhEBpaMFFU4tQQS9Yxe1AVwEEehF5eBTADAhUcmFuc2ZlckGVAW9heXBoC5eqJAUJIgt5NwIAcGgLl6omIHt6EXgUwB8MDm9uTkVQMTFQYXltZW50eUFifVtSRUBWAgwBAGAMAQFhQK3wmm4=")); #endregion @@ -58,7 +58,7 @@ public abstract class Contract_NEP11(Neo.SmartContract.Testing.SmartContractInit /// Safe method /// /// - /// Script: VwEBeHBoC5cmBQgiDXhK2ShQygAUs6uqJiUMVGhlIGFyZ3VtZW50ICJvd25lciIgaXMgaW52YWxpZC46QZv2Z84REYhOEFHQUBLAcHhowUVTi1BBkl3oMUrYJgRFENshQA== + /// Script: VwEBeHBoC5cmBQgiDXhK2ShQygAUs6uqJiUMVGhlIGFyZ3VtZW50ICJvd25lciIgaXMgaW52YWxpZC46WXiL2yg1r////3BoC5gmBmjbIUAQQA== /// 00 : OpCode.INITSLOT 0101 /// 03 : OpCode.LDARG0 /// 04 : OpCode.STLOC0 @@ -80,33 +80,21 @@ public abstract class Contract_NEP11(Neo.SmartContract.Testing.SmartContractInit /// 18 : OpCode.JMPIFNOT 25 /// 1A : OpCode.PUSHDATA1 54686520617267756D656E7420226F776E65722220697320696E76616C69642E /// 3C : OpCode.THROW - /// 3D : OpCode.SYSCALL 9BF667CE - /// 42 : OpCode.PUSH1 - /// 43 : OpCode.PUSH1 - /// 44 : OpCode.NEWBUFFER - /// 45 : OpCode.TUCK - /// 46 : OpCode.PUSH0 - /// 47 : OpCode.ROT - /// 48 : OpCode.SETITEM - /// 49 : OpCode.SWAP - /// 4A : OpCode.PUSH2 - /// 4B : OpCode.PACK - /// 4C : OpCode.STLOC0 - /// 4D : OpCode.LDARG0 - /// 4E : OpCode.LDLOC0 - /// 4F : OpCode.UNPACK - /// 50 : OpCode.DROP - /// 51 : OpCode.REVERSE3 - /// 52 : OpCode.CAT - /// 53 : OpCode.SWAP - /// 54 : OpCode.SYSCALL 925DE831 - /// 59 : OpCode.DUP - /// 5A : OpCode.ISNULL - /// 5B : OpCode.JMPIFNOT 04 - /// 5D : OpCode.DROP - /// 5E : OpCode.PUSH0 - /// 5F : OpCode.CONVERT 21 - /// 61 : OpCode.RET + /// 3D : OpCode.LDSFLD1 + /// 3E : OpCode.LDARG0 + /// 3F : OpCode.CAT + /// 40 : OpCode.CONVERT 28 + /// 42 : OpCode.CALL_L AFFFFFFF + /// 47 : OpCode.STLOC0 + /// 48 : OpCode.LDLOC0 + /// 49 : OpCode.PUSHNULL + /// 4A : OpCode.NOTEQUAL + /// 4B : OpCode.JMPIFNOT 06 + /// 4D : OpCode.LDLOC0 + /// 4E : OpCode.CONVERT 21 + /// 50 : OpCode.RET + /// 51 : OpCode.PUSH0 + /// 52 : OpCode.RET /// [DisplayName("balanceOf")] public abstract BigInteger? BalanceOf(UInt160? owner); @@ -259,7 +247,7 @@ public abstract class Contract_NEP11(Neo.SmartContract.Testing.SmartContractInit /// Unsafe method /// /// - /// Script: VwMDeHBoC5cmBQgiDXhK2ShQygAUs6uqJiIMVGhlIGFyZ3VtZW50ICJ0byIgaXMgaW52YWxpZC46ExGIThBR0EGb9mfOEsBweWjBRVOLUEGSXegxNwAAcWkQznJqQfgn7IyqJgQJQGp4mCYleEppEFHQRWk3AQBKeWjBRVOLUEHmPxiERQ95ajQPEXl4NAp6eXhqNEUIQA== + /// Script: VwMDeHBoC5cmBQgiDXhK2ShQygAUs6uqJiIMVGhlIGFyZ3VtZW50ICJ0byIgaXMgaW52YWxpZC46ExGIThBR0EGb9mfOEsBweWjBRVOLUEGSXegxNwAAcWkQznJqQfgn7IyqJgQJQGp4mCYleEppEFHQRWk3AQBKeWjBRVOLUEHmPxiERQ95ajQSEXl4NA16eXhqNUgAAAAIQA== /// 00 : OpCode.INITSLOT 0303 /// 03 : OpCode.LDARG0 /// 04 : OpCode.STLOC0 @@ -338,18 +326,18 @@ public abstract class Contract_NEP11(Neo.SmartContract.Testing.SmartContractInit /// 86 : OpCode.PUSHM1 /// 87 : OpCode.LDARG1 /// 88 : OpCode.LDLOC2 - /// 89 : OpCode.CALL 0F + /// 89 : OpCode.CALL 12 /// 8B : OpCode.PUSH1 /// 8C : OpCode.LDARG1 /// 8D : OpCode.LDARG0 - /// 8E : OpCode.CALL 0A + /// 8E : OpCode.CALL 0D /// 90 : OpCode.LDARG2 /// 91 : OpCode.LDARG1 /// 92 : OpCode.LDARG0 /// 93 : OpCode.LDLOC2 - /// 94 : OpCode.CALL 45 - /// 96 : OpCode.PUSHT - /// 97 : OpCode.RET + /// 94 : OpCode.CALL_L 48000000 + /// 99 : OpCode.PUSHT + /// 9A : OpCode.RET /// [DisplayName("transfer")] public abstract bool? Transfer(UInt160? to, byte[]? tokenId, object? data = null); diff --git a/tests/Neo.Compiler.CSharp.UnitTests/TestingArtifacts/Contract_NEP17.cs b/tests/Neo.Compiler.CSharp.UnitTests/TestingArtifacts/Contract_NEP17.cs index e7a5fbf1c..9c4af9a48 100644 --- a/tests/Neo.Compiler.CSharp.UnitTests/TestingArtifacts/Contract_NEP17.cs +++ b/tests/Neo.Compiler.CSharp.UnitTests/TestingArtifacts/Contract_NEP17.cs @@ -10,12 +10,12 @@ public abstract class Contract_NEP17(Neo.SmartContract.Testing.SmartContractInit { #region Compiled data - public static Neo.SmartContract.Manifest.ContractManifest Manifest => Neo.SmartContract.Manifest.ContractManifest.Parse(@"{""name"":""Contract_NEP17"",""groups"":[],""features"":{},""supportedstandards"":[""NEP-17""],""abi"":{""methods"":[{""name"":""symbol"",""parameters"":[],""returntype"":""String"",""offset"":0,""safe"":true},{""name"":""decimals"",""parameters"":[],""returntype"":""Integer"",""offset"":7,""safe"":true},{""name"":""totalSupply"",""parameters"":[],""returntype"":""Integer"",""offset"":9,""safe"":true},{""name"":""balanceOf"",""parameters"":[{""name"":""owner"",""type"":""Hash160""}],""returntype"":""Integer"",""offset"":35,""safe"":true},{""name"":""transfer"",""parameters"":[{""name"":""from"",""type"":""Hash160""},{""name"":""to"",""type"":""Hash160""},{""name"":""amount"",""type"":""Integer""},{""name"":""data"",""type"":""Any""}],""returntype"":""Boolean"",""offset"":218,""safe"":false},{""name"":""_initialize"",""parameters"":[],""returntype"":""Void"",""offset"":498,""safe"":false}],""events"":[{""name"":""Transfer"",""parameters"":[{""name"":""from"",""type"":""Hash160""},{""name"":""to"",""type"":""Hash160""},{""name"":""amount"",""type"":""Integer""}]}]},""permissions"":[{""contract"":""0xfffdc93764dbaddd97c48f252a53ea4643faa3fd"",""methods"":[""getContract""]},{""contract"":""*"",""methods"":[""onNEP17Payment""]}],""trusts"":[],""extra"":{""nef"":{""optimization"":""All""}}}"); + public static Neo.SmartContract.Manifest.ContractManifest Manifest => Neo.SmartContract.Manifest.ContractManifest.Parse(@"{""name"":""Contract_NEP17"",""groups"":[],""features"":{},""supportedstandards"":[""NEP-17""],""abi"":{""methods"":[{""name"":""symbol"",""parameters"":[],""returntype"":""String"",""offset"":0,""safe"":true},{""name"":""decimals"",""parameters"":[],""returntype"":""Integer"",""offset"":7,""safe"":true},{""name"":""totalSupply"",""parameters"":[],""returntype"":""Integer"",""offset"":9,""safe"":true},{""name"":""balanceOf"",""parameters"":[{""name"":""owner"",""type"":""Hash160""}],""returntype"":""Integer"",""offset"":42,""safe"":true},{""name"":""transfer"",""parameters"":[{""name"":""from"",""type"":""Hash160""},{""name"":""to"",""type"":""Hash160""},{""name"":""amount"",""type"":""Integer""},{""name"":""data"",""type"":""Any""}],""returntype"":""Boolean"",""offset"":195,""safe"":false},{""name"":""_initialize"",""parameters"":[],""returntype"":""Void"",""offset"":475,""safe"":false}],""events"":[{""name"":""Transfer"",""parameters"":[{""name"":""from"",""type"":""Hash160""},{""name"":""to"",""type"":""Hash160""},{""name"":""amount"",""type"":""Integer""}]}]},""permissions"":[{""contract"":""0xfffdc93764dbaddd97c48f252a53ea4643faa3fd"",""methods"":[""getContract""]},{""contract"":""*"",""methods"":[""onNEP17Payment""]}],""trusts"":[],""extra"":{""nef"":{""optimization"":""All""}}}"); /// /// Optimization: "All" /// - public static Neo.SmartContract.NefFile Nef => Neo.IO.Helper.AsSerializable(Convert.FromBase64String(@"TkVGM1Rlc3RpbmdFbmdpbmUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH9o/pDRupTKiWPxJfdrdtkN8n9/wtnZXRDb250cmFjdAEAAQ8AAP31AQwEVEVTVEAYQFjYJhcMAQBB9rRr4kGSXegxStgmBEUQSmBAVwEBeHBoC5cmBQgiDXhK2ShQygAUs6uqJiUMIFRoZSBhcmd1bWVudCAib3duZXIiIGlzIGludmFsaWQuOkGb9mfOERGIThBR0FASwHB4aMFFU4tQQZJd6DFK2CYERRDbIUBXAgJBm/ZnzhERiE4QUdBQEsBweGjBRVOLUEGSXegxStgmBEUQ2yFxaXmecWkQtSYECUBpELMmEHhowUVTi1BBL1jF7SIPaXhowUVTi1BB5j8YhAhAV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gQJQHoQmCYXept4NQf///+qJgQJQHp5Nfv+//9Fe3p5eDQECEBXAQR6eXgTwAwIVHJhbnNmZXJBlQFvYXlwaAuXqiQFCSILeTcAAHBoC5eqJh97engTwB8MDm9uTkVQMTdQYXltZW50eUFifVtSRUBWAgwBAGAMAQFhQGlK/VY=")); #endregion @@ -51,7 +51,7 @@ public abstract class Contract_NEP17(Neo.SmartContract.Testing.SmartContractInit /// Safe method /// /// - /// Script: VwEBeHBoC5cmBQgiDXhK2ShQygAUs6uqJiUMVGhlIGFyZ3VtZW50ICJvd25lciIgaXMgaW52YWxpZC46QZv2Z84REYhOEFHQUBLAcHhowUVTi1BBkl3oMUrYJgRFENshQA== + /// Script: VwEBeHBoC5cmBQgiDXhK2ShQygAUs6uqJiUMVGhlIGFyZ3VtZW50ICJvd25lciIgaXMgaW52YWxpZC46WXiL2yg1r////3BoC5gmBmjbIUAQQA== /// 00 : OpCode.INITSLOT 0101 /// 03 : OpCode.LDARG0 /// 04 : OpCode.STLOC0 @@ -73,33 +73,21 @@ public abstract class Contract_NEP17(Neo.SmartContract.Testing.SmartContractInit /// 18 : OpCode.JMPIFNOT 25 /// 1A : OpCode.PUSHDATA1 54686520617267756D656E7420226F776E65722220697320696E76616C69642E /// 3C : OpCode.THROW - /// 3D : OpCode.SYSCALL 9BF667CE - /// 42 : OpCode.PUSH1 - /// 43 : OpCode.PUSH1 - /// 44 : OpCode.NEWBUFFER - /// 45 : OpCode.TUCK - /// 46 : OpCode.PUSH0 - /// 47 : OpCode.ROT - /// 48 : OpCode.SETITEM - /// 49 : OpCode.SWAP - /// 4A : OpCode.PUSH2 - /// 4B : OpCode.PACK - /// 4C : OpCode.STLOC0 - /// 4D : OpCode.LDARG0 - /// 4E : OpCode.LDLOC0 - /// 4F : OpCode.UNPACK - /// 50 : OpCode.DROP - /// 51 : OpCode.REVERSE3 - /// 52 : OpCode.CAT - /// 53 : OpCode.SWAP - /// 54 : OpCode.SYSCALL 925DE831 - /// 59 : OpCode.DUP - /// 5A : OpCode.ISNULL - /// 5B : OpCode.JMPIFNOT 04 - /// 5D : OpCode.DROP - /// 5E : OpCode.PUSH0 - /// 5F : OpCode.CONVERT 21 - /// 61 : OpCode.RET + /// 3D : OpCode.LDSFLD1 + /// 3E : OpCode.LDARG0 + /// 3F : OpCode.CAT + /// 40 : OpCode.CONVERT 28 + /// 42 : OpCode.CALL_L AFFFFFFF + /// 47 : OpCode.STLOC0 + /// 48 : OpCode.LDLOC0 + /// 49 : OpCode.PUSHNULL + /// 4A : OpCode.NOTEQUAL + /// 4B : OpCode.JMPIFNOT 06 + /// 4D : OpCode.LDLOC0 + /// 4E : OpCode.CONVERT 21 + /// 50 : OpCode.RET + /// 51 : OpCode.PUSH0 + /// 52 : OpCode.RET /// [DisplayName("balanceOf")] public abstract BigInteger? BalanceOf(UInt160? owner); @@ -112,7 +100,7 @@ public abstract class Contract_NEP17(Neo.SmartContract.Testing.SmartContractInit /// Unsafe method /// /// - /// Script: VwEEeHBoC5cmBQgiDXhK2ShQygAUs6uqJiQMVGhlIGFyZ3VtZW50ICJmcm9tIiBpcyBpbnZhbGlkLjp5cGgLlyYFCCINeUrZKFDKABSzq6omIgxUaGUgYXJndW1lbnQgInRvIiBpcyBpbnZhbGlkLjp6ELUmKgxUaGUgYW1vdW50IG11c3QgYmUgYSBwb3NpdGl2ZSBudW1iZXIuOnhB+CfsjKomBAlAehCYJhd6m3g1+P7//6omBAlAenk17P7//0V7enl4NAQIQA== + /// Script: VwEEeHBoC5cmBQgiDXhK2ShQygAUs6uqJiQMVGhlIGFyZ3VtZW50ICJmcm9tIiBpcyBpbnZhbGlkLjp5cGgLlyYFCCINeUrZKFDKABSzq6omIgxUaGUgYXJndW1lbnQgInRvIiBpcyBpbnZhbGlkLjp6ELUmKgxUaGUgYW1vdW50IG11c3QgYmUgYSBwb3NpdGl2ZSBudW1iZXIuOnhB+CfsjKomBAlAehCYJhd6m3g1B////6omBAlAenk1+/7//0V7enl4NAQIQA== /// 00 : OpCode.INITSLOT 0104 /// 03 : OpCode.LDARG0 /// 04 : OpCode.STLOC0 @@ -173,14 +161,14 @@ public abstract class Contract_NEP17(Neo.SmartContract.Testing.SmartContractInit /// B0 : OpCode.LDARG2 /// B1 : OpCode.NEGATE /// B2 : OpCode.LDARG0 - /// B3 : OpCode.CALL_L F8FEFFFF + /// B3 : OpCode.CALL_L 07FFFFFF /// B8 : OpCode.NOT /// B9 : OpCode.JMPIFNOT 04 /// BB : OpCode.PUSHF /// BC : OpCode.RET /// BD : OpCode.LDARG2 /// BE : OpCode.LDARG1 - /// BF : OpCode.CALL_L ECFEFFFF + /// BF : OpCode.CALL_L FBFEFFFF /// C4 : OpCode.DROP /// C5 : OpCode.LDARG3 /// C6 : OpCode.LDARG2 diff --git a/tests/Neo.SmartContract.Framework.UnitTests/TestingArtifacts/Contract_Helper.cs b/tests/Neo.SmartContract.Framework.UnitTests/TestingArtifacts/Contract_Helper.cs index 1bb66fa2f..ca1a029c9 100644 --- a/tests/Neo.SmartContract.Framework.UnitTests/TestingArtifacts/Contract_Helper.cs +++ b/tests/Neo.SmartContract.Framework.UnitTests/TestingArtifacts/Contract_Helper.cs @@ -10,12 +10,12 @@ public abstract class Contract_Helper(Neo.SmartContract.Testing.SmartContractIni { #region Compiled data - public static Neo.SmartContract.Manifest.ContractManifest Manifest => Neo.SmartContract.Manifest.ContractManifest.Parse(@"{""name"":""Contract_Helper"",""groups"":[],""features"":{},""supportedstandards"":[],""abi"":{""methods"":[{""name"":""testHexToBytes"",""parameters"":[],""returntype"":""ByteArray"",""offset"":0,""safe"":false},{""name"":""assertCall"",""parameters"":[{""name"":""value"",""type"":""Boolean""}],""returntype"":""Integer"",""offset"":2,""safe"":false},{""name"":""testToBigInteger"",""parameters"":[{""name"":""data"",""type"":""ByteArray""}],""returntype"":""Integer"",""offset"":25,""safe"":false},{""name"":""modMultiply"",""parameters"":[{""name"":""value"",""type"":""Integer""},{""name"":""y"",""type"":""Integer""},{""name"":""modulus"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":32,""safe"":false},{""name"":""modInverse"",""parameters"":[{""name"":""value"",""type"":""Integer""},{""name"":""modulus"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":40,""safe"":false},{""name"":""modPow"",""parameters"":[{""name"":""value"",""type"":""Integer""},{""name"":""exponent"",""type"":""Integer""},{""name"":""modulus"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":56,""safe"":false},{""name"":""testBigIntegerCast"",""parameters"":[{""name"":""data"",""type"":""ByteArray""}],""returntype"":""Integer"",""offset"":64,""safe"":false},{""name"":""testBigIntegerParseHexString"",""parameters"":[{""name"":""data"",""type"":""String""}],""returntype"":""Integer"",""offset"":79,""safe"":false},{""name"":""voidAssertCall"",""parameters"":[{""name"":""value"",""type"":""Boolean""}],""returntype"":""Void"",""offset"":87,""safe"":false},{""name"":""testByteToByteArray"",""parameters"":[],""returntype"":""ByteArray"",""offset"":95,""safe"":false},{""name"":""testReverse"",""parameters"":[],""returntype"":""ByteArray"",""offset"":106,""safe"":false},{""name"":""testSbyteToByteArray"",""parameters"":[],""returntype"":""ByteArray"",""offset"":121,""safe"":false},{""name"":""testStringToByteArray"",""parameters"":[],""returntype"":""ByteArray"",""offset"":132,""safe"":false},{""name"":""testConcat"",""parameters"":[],""returntype"":""ByteArray"",""offset"":155,""safe"":false},{""name"":""testRange"",""parameters"":[],""returntype"":""ByteArray"",""offset"":180,""safe"":false},{""name"":""testTake"",""parameters"":[],""returntype"":""ByteArray"",""offset"":198,""safe"":false},{""name"":""testLast"",""parameters"":[],""returntype"":""ByteArray"",""offset"":215,""safe"":false},{""name"":""testToScriptHash"",""parameters"":[],""returntype"":""ByteArray"",""offset"":232,""safe"":false},{""name"":""_initialize"",""parameters"":[],""returntype"":""Void"",""offset"":234,""safe"":false}],""events"":[]},""permissions"":[{""contract"":""0xacce6fd80d44e1796aa0c2c625e9e4e0ce39efc0"",""methods"":[""atoi""]}],""trusts"":[],""extra"":{""nef"":{""optimization"":""All""}}}"); + public static Neo.SmartContract.Manifest.ContractManifest Manifest => Neo.SmartContract.Manifest.ContractManifest.Parse(@"{""name"":""Contract_Helper"",""groups"":[],""features"":{},""supportedstandards"":[],""abi"":{""methods"":[{""name"":""testHexToBytes"",""parameters"":[],""returntype"":""ByteArray"",""offset"":0,""safe"":false},{""name"":""assertCall"",""parameters"":[{""name"":""value"",""type"":""Boolean""}],""returntype"":""Integer"",""offset"":2,""safe"":false},{""name"":""testToBigInteger"",""parameters"":[{""name"":""data"",""type"":""ByteArray""}],""returntype"":""Integer"",""offset"":25,""safe"":false},{""name"":""modMultiply"",""parameters"":[{""name"":""value"",""type"":""Integer""},{""name"":""y"",""type"":""Integer""},{""name"":""modulus"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":32,""safe"":false},{""name"":""modInverse"",""parameters"":[{""name"":""value"",""type"":""Integer""},{""name"":""modulus"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":40,""safe"":false},{""name"":""modPow"",""parameters"":[{""name"":""value"",""type"":""Integer""},{""name"":""exponent"",""type"":""Integer""},{""name"":""modulus"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":56,""safe"":false},{""name"":""testBigIntegerCast"",""parameters"":[{""name"":""data"",""type"":""ByteArray""}],""returntype"":""Integer"",""offset"":64,""safe"":false},{""name"":""testBigIntegerParseHexString"",""parameters"":[{""name"":""data"",""type"":""String""}],""returntype"":""Integer"",""offset"":73,""safe"":false},{""name"":""voidAssertCall"",""parameters"":[{""name"":""value"",""type"":""Boolean""}],""returntype"":""Void"",""offset"":81,""safe"":false},{""name"":""testByteToByteArray"",""parameters"":[],""returntype"":""ByteArray"",""offset"":89,""safe"":false},{""name"":""testReverse"",""parameters"":[],""returntype"":""ByteArray"",""offset"":100,""safe"":false},{""name"":""testSbyteToByteArray"",""parameters"":[],""returntype"":""ByteArray"",""offset"":115,""safe"":false},{""name"":""testStringToByteArray"",""parameters"":[],""returntype"":""ByteArray"",""offset"":126,""safe"":false},{""name"":""testConcat"",""parameters"":[],""returntype"":""ByteArray"",""offset"":149,""safe"":false},{""name"":""testRange"",""parameters"":[],""returntype"":""ByteArray"",""offset"":174,""safe"":false},{""name"":""testTake"",""parameters"":[],""returntype"":""ByteArray"",""offset"":192,""safe"":false},{""name"":""testLast"",""parameters"":[],""returntype"":""ByteArray"",""offset"":209,""safe"":false},{""name"":""testToScriptHash"",""parameters"":[],""returntype"":""ByteArray"",""offset"":226,""safe"":false},{""name"":""_initialize"",""parameters"":[],""returntype"":""Void"",""offset"":228,""safe"":false}],""events"":[]},""permissions"":[{""contract"":""0xacce6fd80d44e1796aa0c2c625e9e4e0ce39efc0"",""methods"":[""atoi""]}],""trusts"":[],""extra"":{""nef"":{""optimization"":""All""}}}"); /// /// Optimization: "All" /// - public static Neo.SmartContract.NefFile Nef => Neo.IO.Helper.AsSerializable(Convert.FromBase64String(@"TkVGM1Rlc3RpbmdFbmdpbmUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHA7znO4OTpJcbCoGp54UQN2G/OrARhdG9pAQABDwAA/Q0BWEBXAAF4CJcMDFVULUVSUk9SLTEyM+EVQFcAAXjbIUBXAAN4eXqlQFcAAnl4NANAVwACeA95pkBXAAN4eXqmQFcAAXjbKErYJgRFENshQFcAAXg3AABAVwABeAiXOUBXAgARcGgRjXFpQFcBAAwDAQID2zBK0XBoQFcCAA9waNswcWlAVwIADAtoZWxsbyB3b3JsZHBo2zBxaUBXAwAMAwECA9swcAwDBAUG2zBxaGmLcmpAVwIADAMBAgPbMHBoERGMcWlAVwIADAMBAgPbMHBoEo1xaUBXAgAMAwECA9swcGgSjnFpQFlAVgIMBgoLDA0OD2AMFAECAwQFBgcICQoLDA0OD6q7zN3uYUCPhy73")); + public static Neo.SmartContract.NefFile Nef => Neo.IO.Helper.AsSerializable(Convert.FromBase64String(@"TkVGM1Rlc3RpbmdFbmdpbmUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHA7znO4OTpJcbCoGp54UQN2G/OrARhdG9pAQABDwAA/QcBWEBXAAF4CJcMDFVULUVSUk9SLTEyM+EVQFcAAXjbIUBXAAN4eXqlQFcAAnl4NANAVwACeA95pkBXAAN4eXqmQFcAAXjbKNshQFcAAXg3AABAVwABeAiXOUBXAgARcGgRjXFpQFcBAAwDAQID2zBK0XBoQFcCAA9waNswcWlAVwIADAtoZWxsbyB3b3JsZHBo2zBxaUBXAwAMAwECA9swcAwDBAUG2zBxaGmLcmpAVwIADAMBAgPbMHBoERGMcWlAVwIADAMBAgPbMHBoEo1xaUBXAgAMAwECA9swcGgSjnFpQFlAVgIMBgoLDA0OD2AMFAECAwQFBgcICQoLDA0OD6q7zN3uYUBC8YXn")); #endregion @@ -87,17 +87,12 @@ public abstract class Contract_Helper(Neo.SmartContract.Testing.SmartContractIni /// Unsafe method /// /// - /// Script: VwABeNsoStgmBEUQ2yFA + /// Script: VwABeNso2yFA /// 00 : OpCode.INITSLOT 0001 /// 03 : OpCode.LDARG0 /// 04 : OpCode.CONVERT 28 - /// 06 : OpCode.DUP - /// 07 : OpCode.ISNULL - /// 08 : OpCode.JMPIFNOT 04 - /// 0A : OpCode.DROP - /// 0B : OpCode.PUSH0 - /// 0C : OpCode.CONVERT 21 - /// 0E : OpCode.RET + /// 06 : OpCode.CONVERT 21 + /// 08 : OpCode.RET /// [DisplayName("testBigIntegerCast")] public abstract BigInteger? TestBigIntegerCast(byte[]? data); diff --git a/tests/Neo.SmartContract.Framework.UnitTests/TestingArtifacts/Contract_StaticStorageMap.cs b/tests/Neo.SmartContract.Framework.UnitTests/TestingArtifacts/Contract_StaticStorageMap.cs index dd8ccb1ac..180d46857 100644 --- a/tests/Neo.SmartContract.Framework.UnitTests/TestingArtifacts/Contract_StaticStorageMap.cs +++ b/tests/Neo.SmartContract.Framework.UnitTests/TestingArtifacts/Contract_StaticStorageMap.cs @@ -10,12 +10,12 @@ public abstract class Contract_StaticStorageMap(Neo.SmartContract.Testing.SmartC { #region Compiled data - public static Neo.SmartContract.Manifest.ContractManifest Manifest => Neo.SmartContract.Manifest.ContractManifest.Parse(@"{""name"":""Contract_StaticStorageMap"",""groups"":[],""features"":{},""supportedstandards"":[],""abi"":{""methods"":[{""name"":""put"",""parameters"":[{""name"":""message"",""type"":""String""}],""returntype"":""Void"",""offset"":0,""safe"":false},{""name"":""get"",""parameters"":[{""name"":""msg"",""type"":""String""}],""returntype"":""Integer"",""offset"":17,""safe"":false},{""name"":""putReadonly"",""parameters"":[{""name"":""message"",""type"":""String""}],""returntype"":""Void"",""offset"":41,""safe"":false},{""name"":""getReadonly"",""parameters"":[{""name"":""msg"",""type"":""String""}],""returntype"":""Integer"",""offset"":58,""safe"":false},{""name"":""put2"",""parameters"":[{""name"":""message"",""type"":""String""}],""returntype"":""Void"",""offset"":82,""safe"":false},{""name"":""get2"",""parameters"":[{""name"":""msg"",""type"":""String""}],""returntype"":""Integer"",""offset"":113,""safe"":false},{""name"":""teststoragemap_Putbyteprefix"",""parameters"":[{""name"":""x"",""type"":""Integer""}],""returntype"":""Void"",""offset"":151,""safe"":false},{""name"":""teststoragemap_Getbyteprefix"",""parameters"":[{""name"":""x"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":191,""safe"":false},{""name"":""_initialize"",""parameters"":[],""returntype"":""Void"",""offset"":237,""safe"":false}],""events"":[]},""permissions"":[],""trusts"":[],""extra"":{""nef"":{""optimization"":""All""}}}"); + public static Neo.SmartContract.Manifest.ContractManifest Manifest => Neo.SmartContract.Manifest.ContractManifest.Parse(@"{""name"":""Contract_StaticStorageMap"",""groups"":[],""features"":{},""supportedstandards"":[],""abi"":{""methods"":[{""name"":""put"",""parameters"":[{""name"":""message"",""type"":""String""}],""returntype"":""Void"",""offset"":0,""safe"":false},{""name"":""get"",""parameters"":[{""name"":""msg"",""type"":""String""}],""returntype"":""Integer"",""offset"":17,""safe"":false},{""name"":""putReadonly"",""parameters"":[{""name"":""message"",""type"":""String""}],""returntype"":""Void"",""offset"":35,""safe"":false},{""name"":""getReadonly"",""parameters"":[{""name"":""msg"",""type"":""String""}],""returntype"":""Integer"",""offset"":52,""safe"":false},{""name"":""put2"",""parameters"":[{""name"":""message"",""type"":""String""}],""returntype"":""Void"",""offset"":70,""safe"":false},{""name"":""get2"",""parameters"":[{""name"":""msg"",""type"":""String""}],""returntype"":""Integer"",""offset"":101,""safe"":false},{""name"":""teststoragemap_Putbyteprefix"",""parameters"":[{""name"":""x"",""type"":""Integer""}],""returntype"":""Void"",""offset"":133,""safe"":false},{""name"":""teststoragemap_Getbyteprefix"",""parameters"":[{""name"":""x"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":173,""safe"":false},{""name"":""_initialize"",""parameters"":[],""returntype"":""Void"",""offset"":213,""safe"":false}],""events"":[]},""permissions"":[],""trusts"":[],""extra"":{""nef"":{""optimization"":""All""}}}"); /// /// Optimization: "All" /// - public static Neo.SmartContract.NefFile Nef => Neo.IO.Helper.AsSerializable(Convert.FromBase64String(@"TkVGM1Rlc3RpbmdFbmdpbmUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP0UAVcAARF4WMFFU4tQQeY/GIRAVwABeFjBRVOLUEGSXegxStgmBEUQ2yFAVwABEnhZwUVTi1BB5j8YhEBXAAF4WcFFU4tQQZJd6DFK2CYERRDbIUBXAQEMBGRhdGFBm/ZnzhLAcBN4aMFFU4tQQeY/GIRAVwEBDARkYXRhQZv2Z84SwHB4aMFFU4tQQZJd6DFK2CYERRDbIUBXAQFBm/ZnzngRiE4QUdBQEsBwAHsMBXRlc3QxaMFFU4tQQeY/GIRAVwEBQZv2Z854EYhOEFHQUBLAcAwFdGVzdDFowUVTi1BBkl3oMUrYJgRFENshQFYCDARkYXRhQZv2Z84SwGAMDHJlYWRvbmx5ZGF0YUGb9mfOEsBhQJh7fb8=")); + public static Neo.SmartContract.NefFile Nef => Neo.IO.Helper.AsSerializable(Convert.FromBase64String(@"TkVGM1Rlc3RpbmdFbmdpbmUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAPxXAAEReFjBRVOLUEHmPxiEQFcAAXhYwUVTi1BBkl3oMdshQFcAARJ4WcFFU4tQQeY/GIRAVwABeFnBRVOLUEGSXegx2yFAVwEBDARkYXRhQZv2Z84SwHATeGjBRVOLUEHmPxiEQFcBAQwEZGF0YUGb9mfOEsBweGjBRVOLUEGSXegx2yFAVwEBQZv2Z854EYhOEFHQUBLAcAB7DAV0ZXN0MWjBRVOLUEHmPxiEQFcBAUGb9mfOeBGIThBR0FASwHAMBXRlc3QxaMFFU4tQQZJd6DHbIUBWAgwEZGF0YUGb9mfOEsBgDAxyZWFkb25seWRhdGFBm/ZnzhLAYUDr5Y8I")); #endregion @@ -25,7 +25,7 @@ public abstract class Contract_StaticStorageMap(Neo.SmartContract.Testing.SmartC /// Unsafe method /// /// - /// Script: VwABeFjBRVOLUEGSXegxStgmBEUQ2yFA + /// Script: VwABeFjBRVOLUEGSXegx2yFA /// 00 : OpCode.INITSLOT 0001 /// 03 : OpCode.LDARG0 /// 04 : OpCode.LDSFLD0 @@ -35,13 +35,8 @@ public abstract class Contract_StaticStorageMap(Neo.SmartContract.Testing.SmartC /// 08 : OpCode.CAT /// 09 : OpCode.SWAP /// 0A : OpCode.SYSCALL 925DE831 - /// 0F : OpCode.DUP - /// 10 : OpCode.ISNULL - /// 11 : OpCode.JMPIFNOT 04 - /// 13 : OpCode.DROP - /// 14 : OpCode.PUSH0 - /// 15 : OpCode.CONVERT 21 - /// 17 : OpCode.RET + /// 0F : OpCode.CONVERT 21 + /// 11 : OpCode.RET /// [DisplayName("get")] public abstract BigInteger? Get(string? msg); @@ -50,7 +45,7 @@ public abstract class Contract_StaticStorageMap(Neo.SmartContract.Testing.SmartC /// Unsafe method /// /// - /// Script: VwEBDGRhdGFBm/ZnzhLAcHhowUVTi1BBkl3oMUrYJgRFENshQA== + /// Script: VwEBDGRhdGFBm/ZnzhLAcHhowUVTi1BBkl3oMdshQA== /// 00 : OpCode.INITSLOT 0101 /// 03 : OpCode.PUSHDATA1 64617461 /// 09 : OpCode.SYSCALL 9BF667CE @@ -65,13 +60,8 @@ public abstract class Contract_StaticStorageMap(Neo.SmartContract.Testing.SmartC /// 16 : OpCode.CAT /// 17 : OpCode.SWAP /// 18 : OpCode.SYSCALL 925DE831 - /// 1D : OpCode.DUP - /// 1E : OpCode.ISNULL - /// 1F : OpCode.JMPIFNOT 04 - /// 21 : OpCode.DROP - /// 22 : OpCode.PUSH0 - /// 23 : OpCode.CONVERT 21 - /// 25 : OpCode.RET + /// 1D : OpCode.CONVERT 21 + /// 1F : OpCode.RET /// [DisplayName("get2")] public abstract BigInteger? Get2(string? msg); @@ -80,7 +70,7 @@ public abstract class Contract_StaticStorageMap(Neo.SmartContract.Testing.SmartC /// Unsafe method /// /// - /// Script: VwABeFnBRVOLUEGSXegxStgmBEUQ2yFA + /// Script: VwABeFnBRVOLUEGSXegx2yFA /// 00 : OpCode.INITSLOT 0001 /// 03 : OpCode.LDARG0 /// 04 : OpCode.LDSFLD1 @@ -90,13 +80,8 @@ public abstract class Contract_StaticStorageMap(Neo.SmartContract.Testing.SmartC /// 08 : OpCode.CAT /// 09 : OpCode.SWAP /// 0A : OpCode.SYSCALL 925DE831 - /// 0F : OpCode.DUP - /// 10 : OpCode.ISNULL - /// 11 : OpCode.JMPIFNOT 04 - /// 13 : OpCode.DROP - /// 14 : OpCode.PUSH0 - /// 15 : OpCode.CONVERT 21 - /// 17 : OpCode.RET + /// 0F : OpCode.CONVERT 21 + /// 11 : OpCode.RET /// [DisplayName("getReadonly")] public abstract BigInteger? GetReadonly(string? msg); diff --git a/tests/Neo.SmartContract.Framework.UnitTests/TestingArtifacts/Contract_SupportedStandard11Enum.cs b/tests/Neo.SmartContract.Framework.UnitTests/TestingArtifacts/Contract_SupportedStandard11Enum.cs index 8daddc53f..a742415d3 100644 --- a/tests/Neo.SmartContract.Framework.UnitTests/TestingArtifacts/Contract_SupportedStandard11Enum.cs +++ b/tests/Neo.SmartContract.Framework.UnitTests/TestingArtifacts/Contract_SupportedStandard11Enum.cs @@ -10,12 +10,12 @@ public abstract class Contract_SupportedStandard11Enum(Neo.SmartContract.Testing { #region Compiled data - public static Neo.SmartContract.Manifest.ContractManifest Manifest => Neo.SmartContract.Manifest.ContractManifest.Parse(@"{""name"":""Contract_SupportedStandard11Enum"",""groups"":[],""features"":{},""supportedstandards"":[""NEP-11""],""abi"":{""methods"":[{""name"":""symbol"",""parameters"":[],""returntype"":""String"",""offset"":0,""safe"":true},{""name"":""decimals"",""parameters"":[],""returntype"":""Integer"",""offset"":1,""safe"":true},{""name"":""totalSupply"",""parameters"":[],""returntype"":""Integer"",""offset"":3,""safe"":true},{""name"":""balanceOf"",""parameters"":[{""name"":""owner"",""type"":""Hash160""}],""returntype"":""Integer"",""offset"":29,""safe"":true},{""name"":""ownerOf"",""parameters"":[{""name"":""tokenId"",""type"":""ByteArray""}],""returntype"":""Hash160"",""offset"":212,""safe"":true},{""name"":""properties"",""parameters"":[{""name"":""tokenId"",""type"":""ByteArray""}],""returntype"":""Map"",""offset"":371,""safe"":true},{""name"":""tokens"",""parameters"":[],""returntype"":""InteropInterface"",""offset"":418,""safe"":true},{""name"":""tokensOf"",""parameters"":[{""name"":""owner"",""type"":""Hash160""}],""returntype"":""InteropInterface"",""offset"":446,""safe"":true},{""name"":""transfer"",""parameters"":[{""name"":""to"",""type"":""Hash160""},{""name"":""tokenId"",""type"":""ByteArray""},{""name"":""data"",""type"":""Any""}],""returntype"":""Boolean"",""offset"":535,""safe"":false},{""name"":""testStandard"",""parameters"":[],""returntype"":""Boolean"",""offset"":829,""safe"":false},{""name"":""onNEP11Payment"",""parameters"":[{""name"":""from"",""type"":""Hash160""},{""name"":""amount"",""type"":""Integer""},{""name"":""tokenId"",""type"":""String""},{""name"":""data"",""type"":""Any""}],""returntype"":""Void"",""offset"":831,""safe"":false},{""name"":""_initialize"",""parameters"":[],""returntype"":""Void"",""offset"":835,""safe"":false}],""events"":[{""name"":""Transfer"",""parameters"":[{""name"":""from"",""type"":""Hash160""},{""name"":""to"",""type"":""Hash160""},{""name"":""amount"",""type"":""Integer""},{""name"":""tokenId"",""type"":""ByteArray""}]}]},""permissions"":[{""contract"":""0x726cb6e0cd8628a1350a611384688911ab75f51b"",""methods"":[""sha256""]},{""contract"":""0xacce6fd80d44e1796aa0c2c625e9e4e0ce39efc0"",""methods"":[""deserialize"",""serialize""]},{""contract"":""0xfffdc93764dbaddd97c48f252a53ea4643faa3fd"",""methods"":[""getContract""]},{""contract"":""*"",""methods"":[""onNEP11Payment""]}],""trusts"":[],""extra"":{""nef"":{""optimization"":""All""}}}"); + public static Neo.SmartContract.Manifest.ContractManifest Manifest => Neo.SmartContract.Manifest.ContractManifest.Parse(@"{""name"":""Contract_SupportedStandard11Enum"",""groups"":[],""features"":{},""supportedstandards"":[""NEP-11""],""abi"":{""methods"":[{""name"":""symbol"",""parameters"":[],""returntype"":""String"",""offset"":0,""safe"":true},{""name"":""decimals"",""parameters"":[],""returntype"":""Integer"",""offset"":1,""safe"":true},{""name"":""totalSupply"",""parameters"":[],""returntype"":""Integer"",""offset"":3,""safe"":true},{""name"":""balanceOf"",""parameters"":[{""name"":""owner"",""type"":""Hash160""}],""returntype"":""Integer"",""offset"":36,""safe"":true},{""name"":""ownerOf"",""parameters"":[{""name"":""tokenId"",""type"":""ByteArray""}],""returntype"":""Hash160"",""offset"":189,""safe"":true},{""name"":""properties"",""parameters"":[{""name"":""tokenId"",""type"":""ByteArray""}],""returntype"":""Map"",""offset"":348,""safe"":true},{""name"":""tokens"",""parameters"":[],""returntype"":""InteropInterface"",""offset"":395,""safe"":true},{""name"":""tokensOf"",""parameters"":[{""name"":""owner"",""type"":""Hash160""}],""returntype"":""InteropInterface"",""offset"":423,""safe"":true},{""name"":""transfer"",""parameters"":[{""name"":""to"",""type"":""Hash160""},{""name"":""tokenId"",""type"":""ByteArray""},{""name"":""data"",""type"":""Any""}],""returntype"":""Boolean"",""offset"":512,""safe"":false},{""name"":""testStandard"",""parameters"":[],""returntype"":""Boolean"",""offset"":809,""safe"":false},{""name"":""onNEP11Payment"",""parameters"":[{""name"":""from"",""type"":""Hash160""},{""name"":""amount"",""type"":""Integer""},{""name"":""tokenId"",""type"":""String""},{""name"":""data"",""type"":""Any""}],""returntype"":""Void"",""offset"":811,""safe"":false},{""name"":""_initialize"",""parameters"":[],""returntype"":""Void"",""offset"":815,""safe"":false}],""events"":[{""name"":""Transfer"",""parameters"":[{""name"":""from"",""type"":""Hash160""},{""name"":""to"",""type"":""Hash160""},{""name"":""amount"",""type"":""Integer""},{""name"":""tokenId"",""type"":""ByteArray""}]}]},""permissions"":[{""contract"":""0x726cb6e0cd8628a1350a611384688911ab75f51b"",""methods"":[""sha256""]},{""contract"":""0xacce6fd80d44e1796aa0c2c625e9e4e0ce39efc0"",""methods"":[""deserialize"",""serialize""]},{""contract"":""0xfffdc93764dbaddd97c48f252a53ea4643faa3fd"",""methods"":[""getContract""]},{""contract"":""*"",""methods"":[""onNEP11Payment""]}],""trusts"":[],""extra"":{""nef"":{""optimization"":""All""}}}"); /// /// Optimization: "All" /// - public static Neo.SmartContract.NefFile Nef => Neo.IO.Helper.AsSerializable(Convert.FromBase64String(@"TkVGM1Rlc3RpbmdFbmdpbmUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAATA7znO4OTpJcbCoGp54UQN2G/OrAtkZXNlcmlhbGl6ZQEAAQ/A7znO4OTpJcbCoGp54UQN2G/OrAlzZXJpYWxpemUBAAEP/aP6Q0bqUyolj8SX3a3bZDfJ/f8LZ2V0Q29udHJhY3QBAAEPG/V1qxGJaIQTYQo1oSiGzeC2bHIGc2hhMjU2AQABDwAA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zC4mkBXAwN4cGgLlyYFCCINeErZKFDKABSzq6omIgwdVGhlIGFyZ3VtZW50ICJ0byIgaXMgaW52YWxpZC46ExGIThBR0EGb9mfOEsBweWjBRVOLUEGSXegxNwAAcWkQznJqQfgn7IyqJgQJQGp4mCYleEppEFHQRWk3AQBKeWjBRVOLUEHmPxiERQ95ajQSEXl4NA16eXhqNUgAAAAIQFcCA3p4Ndf9//9FQZv2Z84UEYhOEFHQUBLAcHh5i9socXoQtyYQEGlowUVTi1BB5j8YhEBpaMFFU4tQQS9Yxe1AVwEEehF5eBTADAhUcmFuc2ZlckGVAW9heXBoC5eqJAUJIgt5NwIAcGgLl6omIHt6EXgUwB8MDm9uTkVQMTFQYXltZW50eUFifVtSRUAIQFcABEBWAgwBAGAMAQFhQPaC7mI=")); #endregion @@ -58,7 +58,7 @@ public abstract class Contract_SupportedStandard11Enum(Neo.SmartContract.Testing /// Safe method /// /// - /// Script: VwEBeHBoC5cmBQgiDXhK2ShQygAUs6uqJiUMVGhlIGFyZ3VtZW50ICJvd25lciIgaXMgaW52YWxpZC46QZv2Z84REYhOEFHQUBLAcHhowUVTi1BBkl3oMUrYJgRFENshQA== + /// Script: VwEBeHBoC5cmBQgiDXhK2ShQygAUs6uqJiUMVGhlIGFyZ3VtZW50ICJvd25lciIgaXMgaW52YWxpZC46WXiL2yg1r////3BoC5gmBmjbIUAQQA== /// 00 : OpCode.INITSLOT 0101 /// 03 : OpCode.LDARG0 /// 04 : OpCode.STLOC0 @@ -80,33 +80,21 @@ public abstract class Contract_SupportedStandard11Enum(Neo.SmartContract.Testing /// 18 : OpCode.JMPIFNOT 25 /// 1A : OpCode.PUSHDATA1 54686520617267756D656E7420226F776E65722220697320696E76616C69642E /// 3C : OpCode.THROW - /// 3D : OpCode.SYSCALL 9BF667CE - /// 42 : OpCode.PUSH1 - /// 43 : OpCode.PUSH1 - /// 44 : OpCode.NEWBUFFER - /// 45 : OpCode.TUCK - /// 46 : OpCode.PUSH0 - /// 47 : OpCode.ROT - /// 48 : OpCode.SETITEM - /// 49 : OpCode.SWAP - /// 4A : OpCode.PUSH2 - /// 4B : OpCode.PACK - /// 4C : OpCode.STLOC0 - /// 4D : OpCode.LDARG0 - /// 4E : OpCode.LDLOC0 - /// 4F : OpCode.UNPACK - /// 50 : OpCode.DROP - /// 51 : OpCode.REVERSE3 - /// 52 : OpCode.CAT - /// 53 : OpCode.SWAP - /// 54 : OpCode.SYSCALL 925DE831 - /// 59 : OpCode.DUP - /// 5A : OpCode.ISNULL - /// 5B : OpCode.JMPIFNOT 04 - /// 5D : OpCode.DROP - /// 5E : OpCode.PUSH0 - /// 5F : OpCode.CONVERT 21 - /// 61 : OpCode.RET + /// 3D : OpCode.LDSFLD1 + /// 3E : OpCode.LDARG0 + /// 3F : OpCode.CAT + /// 40 : OpCode.CONVERT 28 + /// 42 : OpCode.CALL_L AFFFFFFF + /// 47 : OpCode.STLOC0 + /// 48 : OpCode.LDLOC0 + /// 49 : OpCode.PUSHNULL + /// 4A : OpCode.NOTEQUAL + /// 4B : OpCode.JMPIFNOT 06 + /// 4D : OpCode.LDLOC0 + /// 4E : OpCode.CONVERT 21 + /// 50 : OpCode.RET + /// 51 : OpCode.PUSH0 + /// 52 : OpCode.RET /// [DisplayName("balanceOf")] public abstract BigInteger? BalanceOf(UInt160? owner); @@ -281,7 +269,7 @@ public abstract class Contract_SupportedStandard11Enum(Neo.SmartContract.Testing /// Unsafe method /// /// - /// Script: VwMDeHBoC5cmBQgiDXhK2ShQygAUs6uqJiIMVGhlIGFyZ3VtZW50ICJ0byIgaXMgaW52YWxpZC46ExGIThBR0EGb9mfOEsBweWjBRVOLUEGSXegxNwAAcWkQznJqQfgn7IyqJgQJQGp4mCYleEppEFHQRWk3AQBKeWjBRVOLUEHmPxiERQ95ajQPEXl4NAp6eXhqNEUIQA== + /// Script: VwMDeHBoC5cmBQgiDXhK2ShQygAUs6uqJiIMVGhlIGFyZ3VtZW50ICJ0byIgaXMgaW52YWxpZC46ExGIThBR0EGb9mfOEsBweWjBRVOLUEGSXegxNwAAcWkQznJqQfgn7IyqJgQJQGp4mCYleEppEFHQRWk3AQBKeWjBRVOLUEHmPxiERQ95ajQSEXl4NA16eXhqNUgAAAAIQA== /// 00 : OpCode.INITSLOT 0303 /// 03 : OpCode.LDARG0 /// 04 : OpCode.STLOC0 @@ -360,18 +348,18 @@ public abstract class Contract_SupportedStandard11Enum(Neo.SmartContract.Testing /// 86 : OpCode.PUSHM1 /// 87 : OpCode.LDARG1 /// 88 : OpCode.LDLOC2 - /// 89 : OpCode.CALL 0F + /// 89 : OpCode.CALL 12 /// 8B : OpCode.PUSH1 /// 8C : OpCode.LDARG1 /// 8D : OpCode.LDARG0 - /// 8E : OpCode.CALL 0A + /// 8E : OpCode.CALL 0D /// 90 : OpCode.LDARG2 /// 91 : OpCode.LDARG1 /// 92 : OpCode.LDARG0 /// 93 : OpCode.LDLOC2 - /// 94 : OpCode.CALL 45 - /// 96 : OpCode.PUSHT - /// 97 : OpCode.RET + /// 94 : OpCode.CALL_L 48000000 + /// 99 : OpCode.PUSHT + /// 9A : OpCode.RET /// [DisplayName("transfer")] public abstract bool? Transfer(UInt160? to, byte[]? tokenId, object? data = null); diff --git a/tests/Neo.SmartContract.Framework.UnitTests/TestingArtifacts/Contract_SupportedStandard17Enum.cs b/tests/Neo.SmartContract.Framework.UnitTests/TestingArtifacts/Contract_SupportedStandard17Enum.cs index 3689b072c..69e34dbcc 100644 --- a/tests/Neo.SmartContract.Framework.UnitTests/TestingArtifacts/Contract_SupportedStandard17Enum.cs +++ b/tests/Neo.SmartContract.Framework.UnitTests/TestingArtifacts/Contract_SupportedStandard17Enum.cs @@ -10,12 +10,12 @@ public abstract class Contract_SupportedStandard17Enum(Neo.SmartContract.Testing { #region Compiled data - public static Neo.SmartContract.Manifest.ContractManifest Manifest => Neo.SmartContract.Manifest.ContractManifest.Parse(@"{""name"":""Contract_SupportedStandard17Enum"",""groups"":[],""features"":{},""supportedstandards"":[""NEP-17""],""abi"":{""methods"":[{""name"":""symbol"",""parameters"":[],""returntype"":""String"",""offset"":0,""safe"":true},{""name"":""decimals"",""parameters"":[],""returntype"":""Integer"",""offset"":1,""safe"":true},{""name"":""totalSupply"",""parameters"":[],""returntype"":""Integer"",""offset"":2,""safe"":true},{""name"":""balanceOf"",""parameters"":[{""name"":""owner"",""type"":""Hash160""}],""returntype"":""Integer"",""offset"":28,""safe"":true},{""name"":""transfer"",""parameters"":[{""name"":""from"",""type"":""Hash160""},{""name"":""to"",""type"":""Hash160""},{""name"":""amount"",""type"":""Integer""},{""name"":""data"",""type"":""Any""}],""returntype"":""Boolean"",""offset"":211,""safe"":false},{""name"":""onNEP17Payment"",""parameters"":[{""name"":""from"",""type"":""Hash160""},{""name"":""amount"",""type"":""Integer""},{""name"":""data"",""type"":""Any""}],""returntype"":""Void"",""offset"":491,""safe"":false},{""name"":""_initialize"",""parameters"":[],""returntype"":""Void"",""offset"":495,""safe"":false}],""events"":[{""name"":""Transfer"",""parameters"":[{""name"":""from"",""type"":""Hash160""},{""name"":""to"",""type"":""Hash160""},{""name"":""amount"",""type"":""Integer""}]}]},""permissions"":[{""contract"":""*"",""methods"":""*""}],""trusts"":[],""extra"":{""Author"":""\u003CYour Name Or Company Here\u003E"",""Description"":""\u003CDescription Here\u003E"",""Email"":""\u003CYour Public Email Here\u003E"",""Version"":""\u003CVersion String Here\u003E"",""Sourcecode"":""https://github.com/neo-project/neo-devpack-dotnet/tree/master/src/Neo.SmartContract.Template"",""nef"":{""optimization"":""All""}}}"); + public static Neo.SmartContract.Manifest.ContractManifest Manifest => Neo.SmartContract.Manifest.ContractManifest.Parse(@"{""name"":""Contract_SupportedStandard17Enum"",""groups"":[],""features"":{},""supportedstandards"":[""NEP-17""],""abi"":{""methods"":[{""name"":""symbol"",""parameters"":[],""returntype"":""String"",""offset"":0,""safe"":true},{""name"":""decimals"",""parameters"":[],""returntype"":""Integer"",""offset"":1,""safe"":true},{""name"":""totalSupply"",""parameters"":[],""returntype"":""Integer"",""offset"":2,""safe"":true},{""name"":""balanceOf"",""parameters"":[{""name"":""owner"",""type"":""Hash160""}],""returntype"":""Integer"",""offset"":35,""safe"":true},{""name"":""transfer"",""parameters"":[{""name"":""from"",""type"":""Hash160""},{""name"":""to"",""type"":""Hash160""},{""name"":""amount"",""type"":""Integer""},{""name"":""data"",""type"":""Any""}],""returntype"":""Boolean"",""offset"":188,""safe"":false},{""name"":""onNEP17Payment"",""parameters"":[{""name"":""from"",""type"":""Hash160""},{""name"":""amount"",""type"":""Integer""},{""name"":""data"",""type"":""Any""}],""returntype"":""Void"",""offset"":468,""safe"":false},{""name"":""_initialize"",""parameters"":[],""returntype"":""Void"",""offset"":472,""safe"":false}],""events"":[{""name"":""Transfer"",""parameters"":[{""name"":""from"",""type"":""Hash160""},{""name"":""to"",""type"":""Hash160""},{""name"":""amount"",""type"":""Integer""}]}]},""permissions"":[{""contract"":""*"",""methods"":""*""}],""trusts"":[],""extra"":{""Author"":""\u003CYour Name Or Company Here\u003E"",""Description"":""\u003CDescription Here\u003E"",""Email"":""\u003CYour Public Email Here\u003E"",""Version"":""\u003CVersion String Here\u003E"",""Sourcecode"":""https://github.com/neo-project/neo-devpack-dotnet/tree/master/src/Neo.SmartContract.Template"",""nef"":{""optimization"":""All""}}}"); /// /// Optimization: "All" /// - public static Neo.SmartContract.NefFile Nef => Neo.IO.Helper.AsSerializable(Convert.FromBase64String(@"TkVGM1Rlc3RpbmdFbmdpbmUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH9o/pDRupTKiWPxJfdrdtkN8n9/wtnZXRDb250cmFjdAEAAQ8AAP3yAUBAWNgmFwwBAEH2tGviQZJd6DFK2CYERRBKYEBXAQF4cGgLlyYFCCINeErZKFDKABSzq6omJQwgVGhlIGFyZ3VtZW50ICJvd25lciIgaXMgaW52YWxpZC46QZv2Z84REYhOEFHQUBLAcHhowUVTi1BBkl3oMUrYJgRFENshQFcCAkGb9mfOERGIThBR0FASwHB4aMFFU4tQQZJd6DFK2CYERRDbIXFpeZ5xaRC1JgQJQGkQsyYQeGjBRVOLUEEvWMXtIg9peGjBRVOLUEHmPxiECEBXAQR4cGgLlyYFCCINeErZKFDKABSzq6omJAwfVGhlIGFyZ3VtZW50ICJmcm9tIiBpcyBpbnZhbGlkLjp5cGgLlyYFCCINeUrZKFDKABSzq6omIgwdVGhlIGFyZ3VtZW50ICJ0byIgaXMgaW52YWxpZC46ehC1JioMJVRoZSBhbW91bnQgbXVzdCBiZSBhIHBvc2l0aXZlIG51bWJlci46eEH4J+yMqiYECUB6EJgmF3qbeDX4/v//qiYECUB6eTXs/v//RXt6eXg0BAhAVwEEenl4E8AMCFRyYW5zZmVyQZUBb2F5cGgLl6okBQkiC3k3AABwaAuXqiYfe3p4E8AfDA5vbk5FUDE3UGF5bWVudHlBYn1bUkVAVwADQFYBQPvotps=")); + public static Neo.SmartContract.NefFile Nef => Neo.IO.Helper.AsSerializable(Convert.FromBase64String(@"TkVGM1Rlc3RpbmdFbmdpbmUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH9o/pDRupTKiWPxJfdrdtkN8n9/wtnZXRDb250cmFjdAEAAQ8AAP3jAUBAVwEAWDQOcGgLmCYGaNshQBBAVwABeEH2tGviQZJd6DFAVwEBeHBoC5cmBQgiDXhK2ShQygAUs6uqJiUMIFRoZSBhcmd1bWVudCAib3duZXIiIGlzIGludmFsaWQuOll4i9soNa////9waAuYJgZo2yFAEEBXBAJBm/ZnznBZeIvbKHFpaEGSXegxcmoLmCYHatshIgMQc2t5nnNrELUmBAlAaxCXJgtpaEEvWMXtIgpraWhB5j8YhAhAVwEEeHBoC5cmBQgiDXhK2ShQygAUs6uqJiQMH1RoZSBhcmd1bWVudCAiZnJvbSIgaXMgaW52YWxpZC46eXBoC5cmBQgiDXlK2ShQygAUs6uqJiIMHVRoZSBhcmd1bWVudCAidG8iIGlzIGludmFsaWQuOnoQtSYqDCVUaGUgYW1vdW50IG11c3QgYmUgYSBwb3NpdGl2ZSBudW1iZXIuOnhB+CfsjKomBAlAehCYJhd6m3g1B////6omBAlAenk1+/7//0V7enl4NAQIQFcBBHp5eBPADAhUcmFuc2ZlckGVAW9heXBoC5eqJAUJIgt5NwAAcGgLl6omH3t6eBPAHwwOb25ORVAxN1BheW1lbnR5QWJ9W1JFQFcAA0BWAgwBAGAMAQFhQPoz6GU=")); #endregion @@ -51,7 +51,7 @@ public abstract class Contract_SupportedStandard17Enum(Neo.SmartContract.Testing /// Safe method /// /// - /// Script: VwEBeHBoC5cmBQgiDXhK2ShQygAUs6uqJiUMVGhlIGFyZ3VtZW50ICJvd25lciIgaXMgaW52YWxpZC46QZv2Z84REYhOEFHQUBLAcHhowUVTi1BBkl3oMUrYJgRFENshQA== + /// Script: VwEBeHBoC5cmBQgiDXhK2ShQygAUs6uqJiUMVGhlIGFyZ3VtZW50ICJvd25lciIgaXMgaW52YWxpZC46WXiL2yg1r////3BoC5gmBmjbIUAQQA== /// 00 : OpCode.INITSLOT 0101 /// 03 : OpCode.LDARG0 /// 04 : OpCode.STLOC0 @@ -73,33 +73,21 @@ public abstract class Contract_SupportedStandard17Enum(Neo.SmartContract.Testing /// 18 : OpCode.JMPIFNOT 25 /// 1A : OpCode.PUSHDATA1 54686520617267756D656E7420226F776E65722220697320696E76616C69642E /// 3C : OpCode.THROW - /// 3D : OpCode.SYSCALL 9BF667CE - /// 42 : OpCode.PUSH1 - /// 43 : OpCode.PUSH1 - /// 44 : OpCode.NEWBUFFER - /// 45 : OpCode.TUCK - /// 46 : OpCode.PUSH0 - /// 47 : OpCode.ROT - /// 48 : OpCode.SETITEM - /// 49 : OpCode.SWAP - /// 4A : OpCode.PUSH2 - /// 4B : OpCode.PACK - /// 4C : OpCode.STLOC0 - /// 4D : OpCode.LDARG0 - /// 4E : OpCode.LDLOC0 - /// 4F : OpCode.UNPACK - /// 50 : OpCode.DROP - /// 51 : OpCode.REVERSE3 - /// 52 : OpCode.CAT - /// 53 : OpCode.SWAP - /// 54 : OpCode.SYSCALL 925DE831 - /// 59 : OpCode.DUP - /// 5A : OpCode.ISNULL - /// 5B : OpCode.JMPIFNOT 04 - /// 5D : OpCode.DROP - /// 5E : OpCode.PUSH0 - /// 5F : OpCode.CONVERT 21 - /// 61 : OpCode.RET + /// 3D : OpCode.LDSFLD1 + /// 3E : OpCode.LDARG0 + /// 3F : OpCode.CAT + /// 40 : OpCode.CONVERT 28 + /// 42 : OpCode.CALL_L AFFFFFFF + /// 47 : OpCode.STLOC0 + /// 48 : OpCode.LDLOC0 + /// 49 : OpCode.PUSHNULL + /// 4A : OpCode.NOTEQUAL + /// 4B : OpCode.JMPIFNOT 06 + /// 4D : OpCode.LDLOC0 + /// 4E : OpCode.CONVERT 21 + /// 50 : OpCode.RET + /// 51 : OpCode.PUSH0 + /// 52 : OpCode.RET /// [DisplayName("balanceOf")] public abstract BigInteger? BalanceOf(UInt160? owner); @@ -123,7 +111,7 @@ public abstract class Contract_SupportedStandard17Enum(Neo.SmartContract.Testing /// Unsafe method /// /// - /// Script: VwEEeHBoC5cmBQgiDXhK2ShQygAUs6uqJiQMVGhlIGFyZ3VtZW50ICJmcm9tIiBpcyBpbnZhbGlkLjp5cGgLlyYFCCINeUrZKFDKABSzq6omIgxUaGUgYXJndW1lbnQgInRvIiBpcyBpbnZhbGlkLjp6ELUmKgxUaGUgYW1vdW50IG11c3QgYmUgYSBwb3NpdGl2ZSBudW1iZXIuOnhB+CfsjKomBAlAehCYJhd6m3g1+P7//6omBAlAenk17P7//0V7enl4NAQIQA== + /// Script: VwEEeHBoC5cmBQgiDXhK2ShQygAUs6uqJiQMVGhlIGFyZ3VtZW50ICJmcm9tIiBpcyBpbnZhbGlkLjp5cGgLlyYFCCINeUrZKFDKABSzq6omIgxUaGUgYXJndW1lbnQgInRvIiBpcyBpbnZhbGlkLjp6ELUmKgxUaGUgYW1vdW50IG11c3QgYmUgYSBwb3NpdGl2ZSBudW1iZXIuOnhB+CfsjKomBAlAehCYJhd6m3g1B////6omBAlAenk1+/7//0V7enl4NAQIQA== /// 00 : OpCode.INITSLOT 0104 /// 03 : OpCode.LDARG0 /// 04 : OpCode.STLOC0 @@ -184,14 +172,14 @@ public abstract class Contract_SupportedStandard17Enum(Neo.SmartContract.Testing /// B0 : OpCode.LDARG2 /// B1 : OpCode.NEGATE /// B2 : OpCode.LDARG0 - /// B3 : OpCode.CALL_L F8FEFFFF + /// B3 : OpCode.CALL_L 07FFFFFF /// B8 : OpCode.NOT /// B9 : OpCode.JMPIFNOT 04 /// BB : OpCode.PUSHF /// BC : OpCode.RET /// BD : OpCode.LDARG2 /// BE : OpCode.LDARG1 - /// BF : OpCode.CALL_L ECFEFFFF + /// BF : OpCode.CALL_L FBFEFFFF /// C4 : OpCode.DROP /// C5 : OpCode.LDARG3 /// C6 : OpCode.LDARG2 diff --git a/tests/Neo.SmartContract.Template.UnitTests/templates/neocontractnep17/TestingArtifacts/Nep17ContractTemplate.artifacts.cs b/tests/Neo.SmartContract.Template.UnitTests/templates/neocontractnep17/TestingArtifacts/Nep17ContractTemplate.artifacts.cs index 7de29ad63..d932218de 100644 --- a/tests/Neo.SmartContract.Template.UnitTests/templates/neocontractnep17/TestingArtifacts/Nep17ContractTemplate.artifacts.cs +++ b/tests/Neo.SmartContract.Template.UnitTests/templates/neocontractnep17/TestingArtifacts/Nep17ContractTemplate.artifacts.cs @@ -10,12 +10,12 @@ public abstract class Nep17ContractTemplate(Neo.SmartContract.Testing.SmartContr { #region Compiled data - public static Neo.SmartContract.Manifest.ContractManifest Manifest => Neo.SmartContract.Manifest.ContractManifest.Parse(@"{""name"":""Nep17Contract"",""groups"":[],""features"":{},""supportedstandards"":[""NEP-17""],""abi"":{""methods"":[{""name"":""symbol"",""parameters"":[],""returntype"":""String"",""offset"":0,""safe"":true},{""name"":""decimals"",""parameters"":[],""returntype"":""Integer"",""offset"":10,""safe"":true},{""name"":""totalSupply"",""parameters"":[],""returntype"":""Integer"",""offset"":12,""safe"":true},{""name"":""balanceOf"",""parameters"":[{""name"":""owner"",""type"":""Hash160""}],""returntype"":""Integer"",""offset"":58,""safe"":true},{""name"":""transfer"",""parameters"":[{""name"":""from"",""type"":""Hash160""},{""name"":""to"",""type"":""Hash160""},{""name"":""amount"",""type"":""Integer""},{""name"":""data"",""type"":""Any""}],""returntype"":""Boolean"",""offset"":241,""safe"":false},{""name"":""getOwner"",""parameters"":[],""returntype"":""Hash160"",""offset"":648,""safe"":true},{""name"":""setOwner"",""parameters"":[{""name"":""newOwner"",""type"":""Hash160""}],""returntype"":""Void"",""offset"":690,""safe"":false},{""name"":""burn"",""parameters"":[{""name"":""account"",""type"":""Hash160""},{""name"":""amount"",""type"":""Integer""}],""returntype"":""Void"",""offset"":807,""safe"":false},{""name"":""mint"",""parameters"":[{""name"":""to"",""type"":""Hash160""},{""name"":""amount"",""type"":""Integer""}],""returntype"":""Void"",""offset"":847,""safe"":false},{""name"":""verify"",""parameters"":[],""returntype"":""Boolean"",""offset"":887,""safe"":true},{""name"":""myMethod"",""parameters"":[],""returntype"":""String"",""offset"":893,""safe"":false},{""name"":""_deploy"",""parameters"":[{""name"":""data"",""type"":""Any""},{""name"":""update"",""type"":""Boolean""}],""returntype"":""Void"",""offset"":911,""safe"":false},{""name"":""update"",""parameters"":[{""name"":""nefFile"",""type"":""ByteArray""},{""name"":""manifest"",""type"":""String""},{""name"":""data"",""type"":""Any""}],""returntype"":""Void"",""offset"":1029,""safe"":false},{""name"":""_initialize"",""parameters"":[],""returntype"":""Void"",""offset"":1068,""safe"":false}],""events"":[{""name"":""Transfer"",""parameters"":[{""name"":""from"",""type"":""Hash160""},{""name"":""to"",""type"":""Hash160""},{""name"":""amount"",""type"":""Integer""}]},{""name"":""SetOwner"",""parameters"":[{""name"":""previousOwner"",""type"":""Hash160""},{""name"":""newOwner"",""type"":""Hash160""}]}]},""permissions"":[{""contract"":""*"",""methods"":""*""}],""trusts"":[],""extra"":{""Author"":""\u003CYour Name Or Company Here\u003E"",""Description"":""\u003CDescription Here\u003E"",""Version"":""\u003CVersion String Here\u003E"",""Sourcecode"":""https://github.com/neo-project/neo-devpack-dotnet/tree/master/src/Neo.SmartContract.Template/templates/neocontractnep17/Nep17Contract.cs"",""nef"":{""optimization"":""All""}}}"); + public static Neo.SmartContract.Manifest.ContractManifest Manifest => Neo.SmartContract.Manifest.ContractManifest.Parse(@"{""name"":""Nep17Contract"",""groups"":[],""features"":{},""supportedstandards"":[""NEP-17""],""abi"":{""methods"":[{""name"":""symbol"",""parameters"":[],""returntype"":""String"",""offset"":0,""safe"":true},{""name"":""decimals"",""parameters"":[],""returntype"":""Integer"",""offset"":10,""safe"":true},{""name"":""totalSupply"",""parameters"":[],""returntype"":""Integer"",""offset"":12,""safe"":true},{""name"":""balanceOf"",""parameters"":[{""name"":""owner"",""type"":""Hash160""}],""returntype"":""Integer"",""offset"":69,""safe"":true},{""name"":""transfer"",""parameters"":[{""name"":""from"",""type"":""Hash160""},{""name"":""to"",""type"":""Hash160""},{""name"":""amount"",""type"":""Integer""},{""name"":""data"",""type"":""Any""}],""returntype"":""Boolean"",""offset"":222,""safe"":false},{""name"":""getOwner"",""parameters"":[],""returntype"":""Hash160"",""offset"":629,""safe"":true},{""name"":""setOwner"",""parameters"":[{""name"":""newOwner"",""type"":""Hash160""}],""returntype"":""Void"",""offset"":671,""safe"":false},{""name"":""burn"",""parameters"":[{""name"":""account"",""type"":""Hash160""},{""name"":""amount"",""type"":""Integer""}],""returntype"":""Void"",""offset"":788,""safe"":false},{""name"":""mint"",""parameters"":[{""name"":""to"",""type"":""Hash160""},{""name"":""amount"",""type"":""Integer""}],""returntype"":""Void"",""offset"":828,""safe"":false},{""name"":""verify"",""parameters"":[],""returntype"":""Boolean"",""offset"":868,""safe"":true},{""name"":""myMethod"",""parameters"":[],""returntype"":""String"",""offset"":874,""safe"":false},{""name"":""_deploy"",""parameters"":[{""name"":""data"",""type"":""Any""},{""name"":""update"",""type"":""Boolean""}],""returntype"":""Void"",""offset"":892,""safe"":false},{""name"":""update"",""parameters"":[{""name"":""nefFile"",""type"":""ByteArray""},{""name"":""manifest"",""type"":""String""},{""name"":""data"",""type"":""Any""}],""returntype"":""Void"",""offset"":1010,""safe"":false},{""name"":""_initialize"",""parameters"":[],""returntype"":""Void"",""offset"":1049,""safe"":false}],""events"":[{""name"":""Transfer"",""parameters"":[{""name"":""from"",""type"":""Hash160""},{""name"":""to"",""type"":""Hash160""},{""name"":""amount"",""type"":""Integer""}]},{""name"":""SetOwner"",""parameters"":[{""name"":""previousOwner"",""type"":""Hash160""},{""name"":""newOwner"",""type"":""Hash160""}]}]},""permissions"":[{""contract"":""*"",""methods"":""*""}],""trusts"":[],""extra"":{""Author"":""\u003CYour Name Or Company Here\u003E"",""Description"":""\u003CDescription Here\u003E"",""Version"":""\u003CVersion String Here\u003E"",""Sourcecode"":""https://github.com/neo-project/neo-devpack-dotnet/tree/master/src/Neo.SmartContract.Template/templates/neocontractnep17/Nep17Contract.cs"",""nef"":{""optimization"":""All""}}}"); /// /// Optimization: "All" /// - public static Neo.SmartContract.NefFile Nef => Neo.IO.Helper.AsSerializable(Convert.FromBase64String(@"TkVGM1Rlc3RpbmdFbmdpbmUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAL9o/pDRupTKiWPxJfdrdtkN8n9/wtnZXRDb250cmFjdAEAAQ/9o/pDRupTKiWPxJfdrdtkN8n9/wZ1cGRhdGUDAAAPAAD9LwQMB0VYQU1QTEVAGEBY2CYXDAEAQfa0a+JBkl3oMUrYJgRFEEpgQFcAAXhgeAwBAEGb9mfOQeY/GIRAVwEBeHBoC5cmBQgiDXhK2ShQygAUs6uqJiUMIFRoZSBhcmd1bWVudCAib3duZXIiIGlzIGludmFsaWQuOkGb9mfOERGIThBR0FASwHB4aMFFU4tQQZJd6DFK2CYERRDbI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SwAwIU2V0T3duZXJBlQFvYQwFV29ybGQMBUhlbGxvQZv2Z85B5j8YhEBXAAM1ov7//wmXJhYMEU5vIGF1dGhvcml6YXRpb24uOnp5eDcBAEBWAUDpKFWL")); + public static Neo.SmartContract.NefFile Nef => Neo.IO.Helper.AsSerializable(Convert.FromBase64String(@"TkVGM1Rlc3RpbmdFbmdpbmUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAL9o/pDRupTKiWPxJfdrdtkN8n9/wtnZXRDb250cmFjdAEAAQ/9o/pDRupTKiWPxJfdrdtkN8n9/wZ1cGRhdGUDAAAPAAD9JAQMB0VYQU1QTEVAGEBXAQBYNA5waAuYJgZo2yFAEEBXAAF4Qfa0a+JBkl3oMUBXAAF4WDQDQFcAAnl4QZv2Z85B5j8YhEBXAQF4cGgLlyYFCCINeErZKFDKABSzq6omJQwgVGhlIGFyZ3VtZW50ICJvd25lciIgaXMgaW52YWxpZC46WXiL2yg1l////3BoC5gmBmjbIUAQQFcEAkGb9mfOcFl4i9socWloQZJd6DFyaguYJgdq2yEiAxBza3mec2sQtSYECUBrELMmC2loQS9Yxe0iCmtpaEHmPxiECEBXAQR4cGgLlyYFCCINeErZKFDKABSzq6omJAwfVGhlIGFyZ3VtZW50ICJmcm9tIiBpcyBpbnZhbGlkLjp5cGgLlyYFCCINeUrZKFDKABSzq6omIgwdVGhlIGFyZ3VtZW50ICJ0byIgaXMgaW52YWxpZC46ehC1JioMJVRoZSBhbW91bnQgbXVzdCBiZSBhIHBvc2l0aXZlIG51bWJlci46eEH4J+yMqiYECUB6EJgmF3qbeDUH////qiYECUB6eTX7/v//RXt6eXg0BAhAVwEEenl4E8AMCFRyYW5zZmVyQZUBb2F5cGgLl6okBQkiC3k3AABwaAuXqiYfe3p4E8AfDA5vbk5FUDE3UGF5bWVudHlBYn1bUkVAVwACeZkQtSYLDAZhbW91bnQ6eRCzJgNAeXg1iP7//0U19v3//3meSjUP/v//RQt5eAs1g////0BXAAJ5mRC1JgsMBmFtb3VudDp5ELMmA0B5m3g1T/7//6omDgwJZXhjZXB0aW9uOjWv/f//eZ9KNcj9//9FC3kLeDU8////QAwB/9swNA5K2CQJSsoAFCgDOkBXAAF4Qfa0a+JBkl3oMUA03kH4J+yMQFcBATT1CZcmFgwRTm8gQXV0aG9yaXphdGlvbiE6eErZKFDKABSzqyQFCSIGeBCzqgwTb3duZXIgbXVzdCBiZSB2YWxpZOE0kHB4DAH/2zA0FnhoEsAMCFNldE93bmVyQZUBb2FAVwACeXhBm/ZnzkHmPxiEQFcAAjWA////CZcmFgwRTm8gQXV0aG9yaXphdGlvbiE6eXg1+P7//0BXAAI1WP///wmXJhYMEU5vIEF1dGhvcml6YXRpb24hOnl4NZj+//9ANTP///9ADAVIZWxsb0Gb9mfOQZJd6DFAVwECeSYDQHhwaAuXJgpBLVEIMBPOgHhwaErZKFDKABSzqyQFCSIGaBCzqgwRb3duZXIgbXVzdCBleGlzdHPhaAwB/9swNUP///9oCxLADAhTZXRPd25lckGVAW9hDAVXb3JsZAwFSGVsbG9Bm/ZnzkHmPxiEQFcAAzWi/v//CZcmFgwRTm8gYXV0aG9yaXphdGlvbi46enl4NwEAQFYCDAEAYAwBAWFAGkrkWQ==")); #endregion @@ -64,7 +64,7 @@ public abstract class Nep17ContractTemplate(Neo.SmartContract.Testing.SmartContr /// Safe method /// /// - /// Script: VwEBeHBoC5cmBQgiDXhK2ShQygAUs6uqJiUMVGhlIGFyZ3VtZW50ICJvd25lciIgaXMgaW52YWxpZC46QZv2Z84REYhOEFHQUBLAcHhowUVTi1BBkl3oMUrYJgRFENshQA== + /// Script: VwEBeHBoC5cmBQgiDXhK2ShQygAUs6uqJiUMVGhlIGFyZ3VtZW50ICJvd25lciIgaXMgaW52YWxpZC46WXiL2yg1l////3BoC5gmBmjbIUAQQA== /// 00 : OpCode.INITSLOT 0101 /// 03 : OpCode.LDARG0 /// 04 : OpCode.STLOC0 @@ -86,33 +86,21 @@ public abstract class Nep17ContractTemplate(Neo.SmartContract.Testing.SmartContr /// 18 : OpCode.JMPIFNOT 25 /// 1A : OpCode.PUSHDATA1 54686520617267756D656E7420226F776E65722220697320696E76616C69642E /// 3C : OpCode.THROW - /// 3D : OpCode.SYSCALL 9BF667CE - /// 42 : OpCode.PUSH1 - /// 43 : OpCode.PUSH1 - /// 44 : OpCode.NEWBUFFER - /// 45 : OpCode.TUCK - /// 46 : OpCode.PUSH0 - /// 47 : OpCode.ROT - /// 48 : OpCode.SETITEM - /// 49 : OpCode.SWAP - /// 4A : OpCode.PUSH2 - /// 4B : OpCode.PACK - /// 4C : OpCode.STLOC0 - /// 4D : OpCode.LDARG0 - /// 4E : OpCode.LDLOC0 - /// 4F : OpCode.UNPACK - /// 50 : OpCode.DROP - /// 51 : OpCode.REVERSE3 - /// 52 : OpCode.CAT - /// 53 : OpCode.SWAP - /// 54 : OpCode.SYSCALL 925DE831 - /// 59 : OpCode.DUP - /// 5A : OpCode.ISNULL - /// 5B : OpCode.JMPIFNOT 04 - /// 5D : OpCode.DROP - /// 5E : OpCode.PUSH0 - /// 5F : OpCode.CONVERT 21 - /// 61 : OpCode.RET + /// 3D : OpCode.LDSFLD1 + /// 3E : OpCode.LDARG0 + /// 3F : OpCode.CAT + /// 40 : OpCode.CONVERT 28 + /// 42 : OpCode.CALL_L 97FFFFFF + /// 47 : OpCode.STLOC0 + /// 48 : OpCode.LDLOC0 + /// 49 : OpCode.PUSHNULL + /// 4A : OpCode.NOTEQUAL + /// 4B : OpCode.JMPIFNOT 06 + /// 4D : OpCode.LDLOC0 + /// 4E : OpCode.CONVERT 21 + /// 50 : OpCode.RET + /// 51 : OpCode.PUSH0 + /// 52 : OpCode.RET /// [DisplayName("balanceOf")] public abstract BigInteger? BalanceOf(UInt160? owner); @@ -178,7 +166,7 @@ public abstract class Nep17ContractTemplate(Neo.SmartContract.Testing.SmartContr /// Unsafe method /// /// - /// Script: VwEEeHBoC5cmBQgiDXhK2ShQygAUs6uqJiQMVGhlIGFyZ3VtZW50ICJmcm9tIiBpcyBpbnZhbGlkLjp5cGgLlyYFCCINeUrZKFDKABSzq6omIgxUaGUgYXJndW1lbnQgInRvIiBpcyBpbnZhbGlkLjp6ELUmKgxUaGUgYW1vdW50IG11c3QgYmUgYSBwb3NpdGl2ZSBudW1iZXIuOnhB+CfsjKomBAlAehCYJhd6m3g1+P7//6omBAlAenk17P7//0V7enl4NAQIQA== + /// Script: VwEEeHBoC5cmBQgiDXhK2ShQygAUs6uqJiQMVGhlIGFyZ3VtZW50ICJmcm9tIiBpcyBpbnZhbGlkLjp5cGgLlyYFCCINeUrZKFDKABSzq6omIgxUaGUgYXJndW1lbnQgInRvIiBpcyBpbnZhbGlkLjp6ELUmKgxUaGUgYW1vdW50IG11c3QgYmUgYSBwb3NpdGl2ZSBudW1iZXIuOnhB+CfsjKomBAlAehCYJhd6m3g1B////6omBAlAenk1+/7//0V7enl4NAQIQA== /// 00 : OpCode.INITSLOT 0104 /// 03 : OpCode.LDARG0 /// 04 : OpCode.STLOC0 @@ -239,14 +227,14 @@ public abstract class Nep17ContractTemplate(Neo.SmartContract.Testing.SmartContr /// B0 : OpCode.LDARG2 /// B1 : OpCode.NEGATE /// B2 : OpCode.LDARG0 - /// B3 : OpCode.CALL_L F8FEFFFF + /// B3 : OpCode.CALL_L 07FFFFFF /// B8 : OpCode.NOT /// B9 : OpCode.JMPIFNOT 04 /// BB : OpCode.PUSHF /// BC : OpCode.RET /// BD : OpCode.LDARG2 /// BE : OpCode.LDARG1 - /// BF : OpCode.CALL_L ECFEFFFF + /// BF : OpCode.CALL_L FBFEFFFF /// C4 : OpCode.DROP /// C5 : OpCode.LDARG3 /// C6 : OpCode.LDARG2