diff --git a/src/Neo.Compiler.CSharp/MethodConvert/Helpers/CallHelpers.cs b/src/Neo.Compiler.CSharp/MethodConvert/Helpers/CallHelpers.cs index b6ff59b48..005c91b0a 100644 --- a/src/Neo.Compiler.CSharp/MethodConvert/Helpers/CallHelpers.cs +++ b/src/Neo.Compiler.CSharp/MethodConvert/Helpers/CallHelpers.cs @@ -73,6 +73,15 @@ private void CallInstanceMethod(SemanticModel model, IMethodSymbol symbol, bool var (convert, methodCallingConvention) = GetMethodConvertAndCallingConvention(model, symbol); + if (NeedInstanceConstructor(symbol) && convert != null && convert.Instructions.Count >= 2) + { + Instruction initslot = convert.Instructions[0]; + Instruction ret = convert.Instructions[1]; + if (initslot.OpCode == OpCode.INITSLOT && initslot.Operand?[0] == 0 && initslot.Operand[1] == 1 + && ret.OpCode == OpCode.RET) + return; // Do not call meaningless contructors + } + HandleConstructorDuplication(instanceOnStack, methodCallingConvention, symbol); PrepareArgumentsForMethod(model, symbol, arguments, methodCallingConvention); @@ -98,6 +107,15 @@ private void CallMethodWithInstanceExpression(SemanticModel model, IMethodSymbol var (convert, methodCallingConvention) = GetMethodConvertAndCallingConvention(model, symbol, instanceExpression); + if (NeedInstanceConstructor(symbol) && convert != null && convert.Instructions.Count >= 2) + { + Instruction initslot = convert.Instructions[0]; + Instruction ret = convert.Instructions[1]; + if (initslot.OpCode == OpCode.INITSLOT && initslot.Operand?[0] == 0 && initslot.Operand[1] == 1 + && ret.OpCode == OpCode.RET) + return; // Do not call meaningless contructors + } + HandleInstanceExpression(model, symbol, instanceExpression, methodCallingConvention, beforeArguments: true); PrepareArgumentsForMethod(model, symbol, arguments, methodCallingConvention); diff --git a/tests/Neo.Compiler.CSharp.UnitTests/DebugAndTestBase.cs b/tests/Neo.Compiler.CSharp.UnitTests/DebugAndTestBase.cs index e4d251380..8fee84db9 100644 --- a/tests/Neo.Compiler.CSharp.UnitTests/DebugAndTestBase.cs +++ b/tests/Neo.Compiler.CSharp.UnitTests/DebugAndTestBase.cs @@ -14,7 +14,8 @@ namespace Neo.Compiler.CSharp.UnitTests; public class DebugAndTestBase : TestBase where T : SmartContract.Testing.SmartContract, IContractInfo { - internal bool TestGasConsume { set; get; } = true; + // allowing specific derived class to enable/disable Gas test + protected virtual bool TestGasConsume { set; get; } = false; static DebugAndTestBase() { diff --git a/tests/Neo.Compiler.CSharp.UnitTests/TestingArtifacts/Contract_ClassInit.cs b/tests/Neo.Compiler.CSharp.UnitTests/TestingArtifacts/Contract_ClassInit.cs index 7a2ca8f47..aed690b92 100644 --- a/tests/Neo.Compiler.CSharp.UnitTests/TestingArtifacts/Contract_ClassInit.cs +++ b/tests/Neo.Compiler.CSharp.UnitTests/TestingArtifacts/Contract_ClassInit.cs @@ -15,7 +15,7 @@ public abstract class Contract_ClassInit(Neo.SmartContract.Testing.SmartContract /// /// Optimization: "All" /// - public static Neo.SmartContract.NefFile Nef => Neo.IO.Helper.AsSerializable(Convert.FromBase64String(@"TkVGM1Rlc3RpbmdFbmdpbmUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/FShDPShDPSjQDQFcAAUA8l/ge")); + public static Neo.SmartContract.NefFile Nef => Neo.IO.Helper.AsSerializable(Convert.FromBase64String(@"TkVGM1Rlc3RpbmdFbmdpbmUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAjFShDPShDPQEc58Bo=")); #endregion @@ -28,5 +28,4 @@ public abstract class Contract_ClassInit(Neo.SmartContract.Testing.SmartContract public abstract IList? TestInitInt(); #endregion - } diff --git a/tests/Neo.Compiler.CSharp.UnitTests/TestingArtifacts/Contract_Foreach.cs b/tests/Neo.Compiler.CSharp.UnitTests/TestingArtifacts/Contract_Foreach.cs index 52f9916cf..ca8cc0f61 100644 --- a/tests/Neo.Compiler.CSharp.UnitTests/TestingArtifacts/Contract_Foreach.cs +++ b/tests/Neo.Compiler.CSharp.UnitTests/TestingArtifacts/Contract_Foreach.cs @@ -10,12 +10,12 @@ public abstract class Contract_Foreach(Neo.SmartContract.Testing.SmartContractIn { #region Compiled data - public static Neo.SmartContract.Manifest.ContractManifest Manifest => Neo.SmartContract.Manifest.ContractManifest.Parse(@"{""name"":""Contract_Foreach"",""groups"":[],""features"":{},""supportedstandards"":[],""abi"":{""methods"":[{""name"":""intForeach"",""parameters"":[],""returntype"":""Integer"",""offset"":0,""safe"":false},{""name"":""stringForeach"",""parameters"":[],""returntype"":""String"",""offset"":84,""safe"":false},{""name"":""byteStringEmpty"",""parameters"":[],""returntype"":""Integer"",""offset"":136,""safe"":false},{""name"":""byteStringForeach"",""parameters"":[],""returntype"":""ByteArray"",""offset"":145,""safe"":false},{""name"":""structForeach"",""parameters"":[],""returntype"":""Map"",""offset"":201,""safe"":false},{""name"":""byteArrayForeach"",""parameters"":[],""returntype"":""Array"",""offset"":313,""safe"":false},{""name"":""uInt160Foreach"",""parameters"":[],""returntype"":""Array"",""offset"":351,""safe"":false},{""name"":""uInt256Foreach"",""parameters"":[],""returntype"":""Array"",""offset"":428,""safe"":false},{""name"":""eCPointForeach"",""parameters"":[],""returntype"":""Array"",""offset"":529,""safe"":false},{""name"":""bigIntegerForeach"",""parameters"":[],""returntype"":""Array"",""offset"":590,""safe"":false},{""name"":""objectArrayForeach"",""parameters"":[],""returntype"":""Array"",""offset"":645,""safe"":false},{""name"":""intForeachBreak"",""parameters"":[{""name"":""breakIndex"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":692,""safe"":false},{""name"":""testContinue"",""parameters"":[],""returntype"":""Integer"",""offset"":846,""safe"":false},{""name"":""intForloop"",""parameters"":[],""returntype"":""Integer"",""offset"":948,""safe"":false},{""name"":""testIteratorForEach"",""parameters"":[],""returntype"":""Void"",""offset"":1075,""safe"":false},{""name"":""testForEachVariable"",""parameters"":[],""returntype"":""Void"",""offset"":1181,""safe"":false},{""name"":""testDo"",""parameters"":[],""returntype"":""Void"",""offset"":1227,""safe"":false},{""name"":""testWhile"",""parameters"":[],""returntype"":""Void"",""offset"":1298,""safe"":false},{""name"":""_initialize"",""parameters"":[],""returntype"":""Void"",""offset"":1371,""safe"":false}],""events"":[]},""permissions"":[{""contract"":""0xacce6fd80d44e1796aa0c2c625e9e4e0ce39efc0"",""methods"":[""itoa""]}],""trusts"":[],""extra"":{""nef"":{""optimization"":""All""}}}"); + public static Neo.SmartContract.Manifest.ContractManifest Manifest => Neo.SmartContract.Manifest.ContractManifest.Parse(@"{""name"":""Contract_Foreach"",""groups"":[],""features"":{},""supportedstandards"":[],""abi"":{""methods"":[{""name"":""intForeach"",""parameters"":[],""returntype"":""Integer"",""offset"":0,""safe"":false},{""name"":""stringForeach"",""parameters"":[],""returntype"":""String"",""offset"":84,""safe"":false},{""name"":""byteStringEmpty"",""parameters"":[],""returntype"":""Integer"",""offset"":136,""safe"":false},{""name"":""byteStringForeach"",""parameters"":[],""returntype"":""ByteArray"",""offset"":145,""safe"":false},{""name"":""structForeach"",""parameters"":[],""returntype"":""Map"",""offset"":201,""safe"":false},{""name"":""byteArrayForeach"",""parameters"":[],""returntype"":""Array"",""offset"":303,""safe"":false},{""name"":""uInt160Foreach"",""parameters"":[],""returntype"":""Array"",""offset"":341,""safe"":false},{""name"":""uInt256Foreach"",""parameters"":[],""returntype"":""Array"",""offset"":418,""safe"":false},{""name"":""eCPointForeach"",""parameters"":[],""returntype"":""Array"",""offset"":519,""safe"":false},{""name"":""bigIntegerForeach"",""parameters"":[],""returntype"":""Array"",""offset"":580,""safe"":false},{""name"":""objectArrayForeach"",""parameters"":[],""returntype"":""Array"",""offset"":635,""safe"":false},{""name"":""intForeachBreak"",""parameters"":[{""name"":""breakIndex"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":682,""safe"":false},{""name"":""testContinue"",""parameters"":[],""returntype"":""Integer"",""offset"":836,""safe"":false},{""name"":""intForloop"",""parameters"":[],""returntype"":""Integer"",""offset"":938,""safe"":false},{""name"":""testIteratorForEach"",""parameters"":[],""returntype"":""Void"",""offset"":1065,""safe"":false},{""name"":""testForEachVariable"",""parameters"":[],""returntype"":""Void"",""offset"":1143,""safe"":false},{""name"":""testDo"",""parameters"":[],""returntype"":""Void"",""offset"":1189,""safe"":false},{""name"":""testWhile"",""parameters"":[],""returntype"":""Void"",""offset"":1260,""safe"":false},{""name"":""_initialize"",""parameters"":[],""returntype"":""Void"",""offset"":1333,""safe"":false}],""events"":[]},""permissions"":[{""contract"":""0xacce6fd80d44e1796aa0c2c625e9e4e0ce39efc0"",""methods"":[""itoa""]}],""trusts"":[],""extra"":{""nef"":{""optimization"":""All""}}}"); /// /// Optimization: "All" /// - public static Neo.SmartContract.NefFile Nef => Neo.IO.Helper.AsSerializable(Convert.FromBase64String(@"TkVGM1Rlc3RpbmdFbmdpbmUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHA7znO4OTpJcbCoGp54UQN2G/OrARpdG9hAQABDwAA/ZQFVwYAFBMSERTAcBBxaEpyynMQdCI7amzOdWltnkoCAAAAgC4EIgpKAv///38yHgP/////AAAAAJFKAv///38yDAMAAAAAAQAAAJ9xbJx0bGswxWlAVwYADANoaWoMA2RlZgwDYWJjE8BwDABxaEpyynMQdCIPamzOdWlti9socWycdGxrMPFpQFcBAAwAcGjKQFcGAAwADAAMA2hpagwDZGVmDANhYmMVwHAMAHFoSnLKcxB0Ig9qbM51aW2L2yhxbJx0bGsw8WlAVwgAxUoLz0oQz0o0YXAMBXRlc3QxSmgQUdBFEUpoEVHQRcVKC89KEM9KNEJxDAV0ZXN0MkppEFHQRRJKaRFR0EVpaBLAcshzakp0ynUQdiIXbG7OdwdvBxHOSm8HEM5rU9BFbpx2bm0w6WtAVwABQFcGAAwDAQoR2zBwwnFoSnLKcxB0IgxqbM51aW3PbJx0bGsw9GlAVwYADBQAAAAAAAAAAAAAAAAAAAAAAAAAAAwUAAAAAAA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MOJAVwEAEHBoNwAAQc/nR5ZoSpxKAgAAAIAuBCIKSgL///9/Mh4D/////wAAAACRSgL///9/MgwDAAAAAAEAAACfcEVoFbUkwUBXAQAQcGgVtSZAaDcAAEHP50eWaEqcSgIAAACALgQiCkoC////fzIeA/////8AAAAAkUoC////fzIMAwAAAAABAAAAn3BFIr9AVgIMIQJHANsukNnwLE+fyGKrrKknJflbT93MjX/6U4aT7PRjqWAKAAAAAAoAAAAACgAAAAATwGFAuhdxtQ==")); + public static Neo.SmartContract.NefFile Nef => Neo.IO.Helper.AsSerializable(Convert.FromBase64String(@"TkVGM1Rlc3RpbmdFbmdpbmUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHA7znO4OTpJcbCoGp54UQN2G/OrARpdG9hAQABDwAA/W4FVwYAFBMSERTAcBBxaEpyynMQdCI7amzOdWltnkoCAAAAgC4EIgpKAv///38yHgP/////AAAAAJFKAv///38yDAMAAAAAAQAAAJ9xbJx0bGswxWlAVwYADANoaWoMA2RlZgwDYWJjE8BwDABxaEpyynMQdCIPamzOdWlti9socWycdGxrMPFpQFcBAAwAcGjKQFcGAAwADAAMA2hpagwDZGVmDANhYmMVwHAMAHFoSnLKcxB0Ig9qbM51aW2L2yhxbJx0bGsw8WlAVwgAxUoLz0oQz3AMBXRlc3QxSmgQUdBFEUpoEVHQRcVKC89KEM9xDAV0ZXN0MkppEFHQRRJKaRFR0EVpaBLAcshzakp0ynUQdiIXbG7OdwdvBxHOSm8HEM5rU9BFbpx2bm0w6WtAVwYADAMBChHbMHDCcWhKcspzEHQiDGpsznVpbc9snHRsazD0aUBXBgAMFAAAAAAAAAAAAAAAAAAAAAAAAAAADBQAAAAAAAAAAAAAAAAAAAAAAAAAABLAcMJxaEpyynMQdCIMamzOdWltz2ycdGxrMPRpQFcGAAwgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMIAAAAAAAAAA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AAJFKAv///38yDAMAAAAAAQAAAJ9wRSK/QFYCDCECRwDbLpDZ8CxPn8hiq6ypJyX5W0/dzI1/+lOGk+z0Y6lgCgAAAAAKAAAAAAoAAAAAE8BhQC1sWXI=")); #endregion @@ -516,7 +516,7 @@ public abstract class Contract_Foreach(Neo.SmartContract.Testing.SmartContractIn /// Unsafe method /// /// - /// Script: VwgAxUoLz0oQz0o0YXAMdGVzdDFKaBBR0EURSmgRUdBFxUoLz0oQz0o0QnEMdGVzdDJKaRBR0EUSSmkRUdBFaWgSwHLIc2pKdMp1EHYiF2xuzncHbwcRzkpvBxDOa1PQRW6cdm5tMOlrQA== + /// Script: VwgAxUoLz0oQz3AMdGVzdDFKaBBR0EURSmgRUdBFxUoLz0oQz3EMdGVzdDJKaRBR0EUSSmkRUdBFaWgSwHLIc2pKdMp1EHYiF2xuzncHbwcRzkpvBxDOa1PQRW6cdm5tMOlrQA== /// 00 : OpCode.INITSLOT 0800 /// 03 : OpCode.NEWSTRUCT0 /// 04 : OpCode.DUP @@ -525,85 +525,81 @@ public abstract class Contract_Foreach(Neo.SmartContract.Testing.SmartContractIn /// 07 : OpCode.DUP /// 08 : OpCode.PUSH0 /// 09 : OpCode.APPEND - /// 0A : OpCode.DUP - /// 0B : OpCode.CALL 61 - /// 0D : OpCode.STLOC0 - /// 0E : OpCode.PUSHDATA1 7465737431 - /// 15 : OpCode.DUP - /// 16 : OpCode.LDLOC0 - /// 17 : OpCode.PUSH0 - /// 18 : OpCode.ROT - /// 19 : OpCode.SETITEM - /// 1A : OpCode.DROP + /// 0A : OpCode.STLOC0 + /// 0B : OpCode.PUSHDATA1 7465737431 + /// 12 : OpCode.DUP + /// 13 : OpCode.LDLOC0 + /// 14 : OpCode.PUSH0 + /// 15 : OpCode.ROT + /// 16 : OpCode.SETITEM + /// 17 : OpCode.DROP + /// 18 : OpCode.PUSH1 + /// 19 : OpCode.DUP + /// 1A : OpCode.LDLOC0 /// 1B : OpCode.PUSH1 - /// 1C : OpCode.DUP - /// 1D : OpCode.LDLOC0 - /// 1E : OpCode.PUSH1 - /// 1F : OpCode.ROT - /// 20 : OpCode.SETITEM - /// 21 : OpCode.DROP - /// 22 : OpCode.NEWSTRUCT0 + /// 1C : OpCode.ROT + /// 1D : OpCode.SETITEM + /// 1E : OpCode.DROP + /// 1F : OpCode.NEWSTRUCT0 + /// 20 : OpCode.DUP + /// 21 : OpCode.PUSHNULL + /// 22 : OpCode.APPEND /// 23 : OpCode.DUP - /// 24 : OpCode.PUSHNULL + /// 24 : OpCode.PUSH0 /// 25 : OpCode.APPEND - /// 26 : OpCode.DUP - /// 27 : OpCode.PUSH0 - /// 28 : OpCode.APPEND - /// 29 : OpCode.DUP - /// 2A : OpCode.CALL 42 - /// 2C : OpCode.STLOC1 - /// 2D : OpCode.PUSHDATA1 7465737432 - /// 34 : OpCode.DUP - /// 35 : OpCode.LDLOC1 - /// 36 : OpCode.PUSH0 - /// 37 : OpCode.ROT - /// 38 : OpCode.SETITEM - /// 39 : OpCode.DROP - /// 3A : OpCode.PUSH2 - /// 3B : OpCode.DUP - /// 3C : OpCode.LDLOC1 - /// 3D : OpCode.PUSH1 - /// 3E : OpCode.ROT - /// 3F : OpCode.SETITEM - /// 40 : OpCode.DROP - /// 41 : OpCode.LDLOC1 - /// 42 : OpCode.LDLOC0 - /// 43 : OpCode.PUSH2 - /// 44 : OpCode.PACK - /// 45 : OpCode.STLOC2 - /// 46 : OpCode.NEWMAP - /// 47 : OpCode.STLOC3 - /// 48 : OpCode.LDLOC2 - /// 49 : OpCode.DUP - /// 4A : OpCode.STLOC4 - /// 4B : OpCode.SIZE - /// 4C : OpCode.STLOC5 - /// 4D : OpCode.PUSH0 - /// 4E : OpCode.STLOC6 - /// 4F : OpCode.JMP 17 - /// 51 : OpCode.LDLOC4 - /// 52 : OpCode.LDLOC6 + /// 26 : OpCode.STLOC1 + /// 27 : OpCode.PUSHDATA1 7465737432 + /// 2E : OpCode.DUP + /// 2F : OpCode.LDLOC1 + /// 30 : OpCode.PUSH0 + /// 31 : OpCode.ROT + /// 32 : OpCode.SETITEM + /// 33 : OpCode.DROP + /// 34 : OpCode.PUSH2 + /// 35 : OpCode.DUP + /// 36 : OpCode.LDLOC1 + /// 37 : OpCode.PUSH1 + /// 38 : OpCode.ROT + /// 39 : OpCode.SETITEM + /// 3A : OpCode.DROP + /// 3B : OpCode.LDLOC1 + /// 3C : OpCode.LDLOC0 + /// 3D : OpCode.PUSH2 + /// 3E : OpCode.PACK + /// 3F : OpCode.STLOC2 + /// 40 : OpCode.NEWMAP + /// 41 : OpCode.STLOC3 + /// 42 : OpCode.LDLOC2 + /// 43 : OpCode.DUP + /// 44 : OpCode.STLOC4 + /// 45 : OpCode.SIZE + /// 46 : OpCode.STLOC5 + /// 47 : OpCode.PUSH0 + /// 48 : OpCode.STLOC6 + /// 49 : OpCode.JMP 17 + /// 4B : OpCode.LDLOC4 + /// 4C : OpCode.LDLOC6 + /// 4D : OpCode.PICKITEM + /// 4E : OpCode.STLOC 07 + /// 50 : OpCode.LDLOC 07 + /// 52 : OpCode.PUSH1 /// 53 : OpCode.PICKITEM - /// 54 : OpCode.STLOC 07 - /// 56 : OpCode.LDLOC 07 - /// 58 : OpCode.PUSH1 - /// 59 : OpCode.PICKITEM - /// 5A : OpCode.DUP - /// 5B : OpCode.LDLOC 07 - /// 5D : OpCode.PUSH0 - /// 5E : OpCode.PICKITEM - /// 5F : OpCode.LDLOC3 - /// 60 : OpCode.REVERSE3 - /// 61 : OpCode.SETITEM - /// 62 : OpCode.DROP - /// 63 : OpCode.LDLOC6 - /// 64 : OpCode.INC - /// 65 : OpCode.STLOC6 - /// 66 : OpCode.LDLOC6 - /// 67 : OpCode.LDLOC5 - /// 68 : OpCode.JMPLT E9 - /// 6A : OpCode.LDLOC3 - /// 6B : OpCode.RET + /// 54 : OpCode.DUP + /// 55 : OpCode.LDLOC 07 + /// 57 : OpCode.PUSH0 + /// 58 : OpCode.PICKITEM + /// 59 : OpCode.LDLOC3 + /// 5A : OpCode.REVERSE3 + /// 5B : OpCode.SETITEM + /// 5C : OpCode.DROP + /// 5D : OpCode.LDLOC6 + /// 5E : OpCode.INC + /// 5F : OpCode.STLOC6 + /// 60 : OpCode.LDLOC6 + /// 61 : OpCode.LDLOC5 + /// 62 : OpCode.JMPLT E9 + /// 64 : OpCode.LDLOC3 + /// 65 : OpCode.RET /// [DisplayName("structForeach")] public abstract IDictionary? StructForeach(); @@ -720,9 +716,9 @@ public abstract class Contract_Foreach(Neo.SmartContract.Testing.SmartContractIn /// Unsafe method /// /// - /// Script: VwUANMpKcMpxEHIiHmhqzsFFc3RrNwAADDogi2yL2yhBz+dHlmqccmppMOJA + /// Script: VwUANOZKcMpxEHIiHmhqzsFFc3RrNwAADDogi2yL2yhBz+dHlmqccmppMOJA /// 00 : OpCode.INITSLOT 0500 - /// 03 : OpCode.CALL CA + /// 03 : OpCode.CALL E6 /// 05 : OpCode.DUP /// 06 : OpCode.STLOC0 /// 07 : OpCode.SIZE diff --git a/tests/Neo.Compiler.CSharp.UnitTests/TestingArtifacts/Contract_Instance.cs b/tests/Neo.Compiler.CSharp.UnitTests/TestingArtifacts/Contract_Instance.cs index 0a5945da5..be8e61f23 100644 --- a/tests/Neo.Compiler.CSharp.UnitTests/TestingArtifacts/Contract_Instance.cs +++ b/tests/Neo.Compiler.CSharp.UnitTests/TestingArtifacts/Contract_Instance.cs @@ -10,12 +10,12 @@ public abstract class Contract_Instance(Neo.SmartContract.Testing.SmartContractI { #region Compiled data - public static Neo.SmartContract.Manifest.ContractManifest Manifest => Neo.SmartContract.Manifest.ContractManifest.Parse(@"{""name"":""Contract_Instance"",""groups"":[],""features"":{},""supportedstandards"":[],""abi"":{""methods"":[{""name"":""sum"",""parameters"":[{""name"":""a"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":191,""safe"":false},{""name"":""sum2"",""parameters"":[{""name"":""a"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":205,""safe"":false}],""events"":[]},""permissions"":[],""trusts"":[],""extra"":{""nef"":{""optimization"":""All""}}}"); + public static Neo.SmartContract.Manifest.ContractManifest Manifest => Neo.SmartContract.Manifest.ContractManifest.Parse(@"{""name"":""Contract_Instance"",""groups"":[],""features"":{},""supportedstandards"":[],""abi"":{""methods"":[{""name"":""sum"",""parameters"":[{""name"":""a"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":184,""safe"":false},{""name"":""sum2"",""parameters"":[{""name"":""a"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":198,""safe"":false}],""events"":[]},""permissions"":[],""trusts"":[],""extra"":{""nef"":{""optimization"":""All""}}}"); /// /// Optimization: "All" /// - public static Neo.SmartContract.NefFile Nef => Neo.IO.Helper.AsSerializable(Convert.FromBase64String(@"TkVGM1Rlc3RpbmdFbmdpbmUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAANlXAAJ5eBDOnkoCAAAAgC4EIgpKAv///38yHgP/////AAAAAJFKAv///38yDAMAAAAAAQAAAJ9AVwABeBAQ0Hg0O3hKEM5OnEoCAAAAgC4EIgpKAv///38yHgP/////AAAAAJFKAv///38yDAMAAAAAAQAAAJ8QUNBFQFcAAUBXAAJ5eDV9////eXg1dv///55KAgAAAIAuBCIKSgL///9/Mh4D/////wAAAACRSgL///9/MgwDAAAAAAEAAACfQBARwEo1dP///yM4////EBHASjVm////IqhARtQX7w==")); + public static Neo.SmartContract.NefFile Nef => Neo.IO.Helper.AsSerializable(Convert.FromBase64String(@"TkVGM1Rlc3RpbmdFbmdpbmUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAANJXAAJ5eBDOnkoCAAAAgC4EIgpKAv///38yHgP/////AAAAAJFKAv///38yDAMAAAAAAQAAAJ9AVwABeBAQ0HhKEM5OnEoCAAAAgC4EIgpKAv///38yHgP/////AAAAAJFKAv///38yDAMAAAAAAQAAAJ8QUNBFQFcAAnl4NYT///95eDV9////nkoCAAAAgC4EIgpKAv///38yHgP/////AAAAAJFKAv///38yDAMAAAAAAQAAAJ9AEBHASjV7////Iz////8QEcBKNW3///8iqEDLjHES")); #endregion @@ -34,5 +34,4 @@ public abstract class Contract_Instance(Neo.SmartContract.Testing.SmartContractI public abstract BigInteger? Sum2(BigInteger? a); #endregion - } diff --git a/tests/Neo.Compiler.CSharp.UnitTests/TestingArtifacts/Contract_Linq.cs b/tests/Neo.Compiler.CSharp.UnitTests/TestingArtifacts/Contract_Linq.cs index 3c941a92f..707275c0e 100644 --- a/tests/Neo.Compiler.CSharp.UnitTests/TestingArtifacts/Contract_Linq.cs +++ b/tests/Neo.Compiler.CSharp.UnitTests/TestingArtifacts/Contract_Linq.cs @@ -10,12 +10,12 @@ public abstract class Contract_Linq(Neo.SmartContract.Testing.SmartContractIniti { #region Compiled data - public static Neo.SmartContract.Manifest.ContractManifest Manifest => Neo.SmartContract.Manifest.ContractManifest.Parse(@"{""name"":""Contract_Linq"",""groups"":[],""features"":{},""supportedstandards"":[],""abi"":{""methods"":[{""name"":""aggregateSum"",""parameters"":[{""name"":""array"",""type"":""Array""}],""returntype"":""Integer"",""offset"":0,""safe"":false},{""name"":""allGreaterThanZero"",""parameters"":[{""name"":""array"",""type"":""Array""}],""returntype"":""Boolean"",""offset"":158,""safe"":false},{""name"":""isEmpty"",""parameters"":[{""name"":""array"",""type"":""Array""}],""returntype"":""Boolean"",""offset"":253,""safe"":false},{""name"":""anyGreaterThanZero"",""parameters"":[{""name"":""array"",""type"":""Array""}],""returntype"":""Boolean"",""offset"":314,""safe"":false},{""name"":""anyGreaterThan"",""parameters"":[{""name"":""array"",""type"":""Array""},{""name"":""target"",""type"":""Integer""}],""returntype"":""Boolean"",""offset"":411,""safe"":false},{""name"":""average"",""parameters"":[{""name"":""array"",""type"":""Array""}],""returntype"":""Integer"",""offset"":432,""safe"":false},{""name"":""averageTwice"",""parameters"":[{""name"":""array"",""type"":""Array""}],""returntype"":""Integer"",""offset"":626,""safe"":false},{""name"":""count"",""parameters"":[{""name"":""array"",""type"":""Array""}],""returntype"":""Integer"",""offset"":896,""safe"":false},{""name"":""countGreaterThanZero"",""parameters"":[{""name"":""array"",""type"":""Array""}],""returntype"":""Integer"",""offset"":1010,""safe"":false},{""name"":""contains"",""parameters"":[{""name"":""array"",""type"":""Array""},{""name"":""target"",""type"":""Integer""}],""returntype"":""Boolean"",""offset"":1158,""safe"":false},{""name"":""containsText"",""parameters"":[{""name"":""array"",""type"":""Array""},{""name"":""target"",""type"":""String""}],""returntype"":""Boolean"",""offset"":1242,""safe"":false},{""name"":""containsPerson"",""parameters"":[{""name"":""array"",""type"":""Array""},{""name"":""target"",""type"":""Integer""}],""returntype"":""Boolean"",""offset"":1250,""safe"":false},{""name"":""containsPersonIndex"",""parameters"":[{""name"":""array"",""type"":""Array""},{""name"":""targetIndex"",""type"":""Integer""}],""returntype"":""Boolean"",""offset"":1334,""safe"":false},{""name"":""containsPersonS"",""parameters"":[{""name"":""array"",""type"":""Array""},{""name"":""target"",""type"":""Integer""}],""returntype"":""Boolean"",""offset"":1393,""safe"":false},{""name"":""firstGreaterThanZero"",""parameters"":[{""name"":""array"",""type"":""Array""}],""returntype"":""Integer"",""offset"":1479,""safe"":false},{""name"":""selectTwice"",""parameters"":[{""name"":""array"",""type"":""Array""}],""returntype"":""Any"",""offset"":1577,""safe"":false},{""name"":""selectPersonS"",""parameters"":[{""name"":""array"",""type"":""Array""}],""returntype"":""Any"",""offset"":1719,""safe"":false},{""name"":""skip"",""parameters"":[{""name"":""array"",""type"":""Array""},{""name"":""count"",""type"":""Integer""}],""returntype"":""Any"",""offset"":1812,""safe"":false},{""name"":""sum"",""parameters"":[{""name"":""array"",""type"":""Array""}],""returntype"":""Integer"",""offset"":1937,""safe"":false},{""name"":""sumTwice"",""parameters"":[{""name"":""array"",""type"":""Array""}],""returntype"":""Integer"",""offset"":2027,""safe"":false},{""name"":""take"",""parameters"":[{""name"":""array"",""type"":""Array""},{""name"":""count"",""type"":""Integer""}],""returntype"":""Any"",""offset"":2216,""safe"":false},{""name"":""toMap"",""parameters"":[{""name"":""array"",""type"":""Array""}],""returntype"":""Any"",""offset"":2341,""safe"":false},{""name"":""whereGreaterThanZero"",""parameters"":[{""name"":""array"",""type"":""Array""}],""returntype"":""Any"",""offset"":2521,""safe"":false},{""name"":""_initialize"",""parameters"":[],""returntype"":""Void"",""offset"":2621,""safe"":false}],""events"":[]},""permissions"":[{""contract"":""0xacce6fd80d44e1796aa0c2c625e9e4e0ce39efc0"",""methods"":[""itoa""]}],""trusts"":[],""extra"":{""nef"":{""optimization"":""All""}}}"); + public static Neo.SmartContract.Manifest.ContractManifest Manifest => Neo.SmartContract.Manifest.ContractManifest.Parse(@"{""name"":""Contract_Linq"",""groups"":[],""features"":{},""supportedstandards"":[],""abi"":{""methods"":[{""name"":""aggregateSum"",""parameters"":[{""name"":""array"",""type"":""Array""}],""returntype"":""Integer"",""offset"":0,""safe"":false},{""name"":""allGreaterThanZero"",""parameters"":[{""name"":""array"",""type"":""Array""}],""returntype"":""Boolean"",""offset"":158,""safe"":false},{""name"":""isEmpty"",""parameters"":[{""name"":""array"",""type"":""Array""}],""returntype"":""Boolean"",""offset"":253,""safe"":false},{""name"":""anyGreaterThanZero"",""parameters"":[{""name"":""array"",""type"":""Array""}],""returntype"":""Boolean"",""offset"":314,""safe"":false},{""name"":""anyGreaterThan"",""parameters"":[{""name"":""array"",""type"":""Array""},{""name"":""target"",""type"":""Integer""}],""returntype"":""Boolean"",""offset"":411,""safe"":false},{""name"":""average"",""parameters"":[{""name"":""array"",""type"":""Array""}],""returntype"":""Integer"",""offset"":432,""safe"":false},{""name"":""averageTwice"",""parameters"":[{""name"":""array"",""type"":""Array""}],""returntype"":""Integer"",""offset"":626,""safe"":false},{""name"":""count"",""parameters"":[{""name"":""array"",""type"":""Array""}],""returntype"":""Integer"",""offset"":896,""safe"":false},{""name"":""countGreaterThanZero"",""parameters"":[{""name"":""array"",""type"":""Array""}],""returntype"":""Integer"",""offset"":1010,""safe"":false},{""name"":""contains"",""parameters"":[{""name"":""array"",""type"":""Array""},{""name"":""target"",""type"":""Integer""}],""returntype"":""Boolean"",""offset"":1158,""safe"":false},{""name"":""containsText"",""parameters"":[{""name"":""array"",""type"":""Array""},{""name"":""target"",""type"":""String""}],""returntype"":""Boolean"",""offset"":1242,""safe"":false},{""name"":""containsPerson"",""parameters"":[{""name"":""array"",""type"":""Array""},{""name"":""target"",""type"":""Integer""}],""returntype"":""Boolean"",""offset"":1250,""safe"":false},{""name"":""containsPersonIndex"",""parameters"":[{""name"":""array"",""type"":""Array""},{""name"":""targetIndex"",""type"":""Integer""}],""returntype"":""Boolean"",""offset"":1334,""safe"":false},{""name"":""containsPersonS"",""parameters"":[{""name"":""array"",""type"":""Array""},{""name"":""target"",""type"":""Integer""}],""returntype"":""Boolean"",""offset"":1393,""safe"":false},{""name"":""firstGreaterThanZero"",""parameters"":[{""name"":""array"",""type"":""Array""}],""returntype"":""Integer"",""offset"":1469,""safe"":false},{""name"":""selectTwice"",""parameters"":[{""name"":""array"",""type"":""Array""}],""returntype"":""Any"",""offset"":1567,""safe"":false},{""name"":""selectPersonS"",""parameters"":[{""name"":""array"",""type"":""Array""}],""returntype"":""Any"",""offset"":1709,""safe"":false},{""name"":""skip"",""parameters"":[{""name"":""array"",""type"":""Array""},{""name"":""count"",""type"":""Integer""}],""returntype"":""Any"",""offset"":1796,""safe"":false},{""name"":""sum"",""parameters"":[{""name"":""array"",""type"":""Array""}],""returntype"":""Integer"",""offset"":1921,""safe"":false},{""name"":""sumTwice"",""parameters"":[{""name"":""array"",""type"":""Array""}],""returntype"":""Integer"",""offset"":2011,""safe"":false},{""name"":""take"",""parameters"":[{""name"":""array"",""type"":""Array""},{""name"":""count"",""type"":""Integer""}],""returntype"":""Any"",""offset"":2200,""safe"":false},{""name"":""toMap"",""parameters"":[{""name"":""array"",""type"":""Array""}],""returntype"":""Any"",""offset"":2325,""safe"":false},{""name"":""whereGreaterThanZero"",""parameters"":[{""name"":""array"",""type"":""Array""}],""returntype"":""Any"",""offset"":2499,""safe"":false},{""name"":""_initialize"",""parameters"":[],""returntype"":""Void"",""offset"":2599,""safe"":false}],""events"":[]},""permissions"":[{""contract"":""0xacce6fd80d44e1796aa0c2c625e9e4e0ce39efc0"",""methods"":[""itoa""]}],""trusts"":[],""extra"":{""nef"":{""optimization"":""All""}}}"); /// /// Optimization: "All" /// - public static Neo.SmartContract.NefFile Nef => Neo.IO.Helper.AsSerializable(Convert.FromBase64String(@"TkVGM1Rlc3RpbmdFbmdpbmUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHA7znO4OTpJcbCoGp54UQN2G/OrARpdG9hAQABDwAA/UAKVwABCmYAAAAQeDQDQFcEA3g0JgwEZnVuY3o0N3hKcMpxEHIiDmhqznNreXo2gWqccmppMPJ5QFcAAXgLlyYTDA5zb3VyY2UgaXMgbnVsbDpAVwACeAuXJhF5DAggaXMgbnVsbIvbKDpAVwACeHmeSgIAAACALgQiCkoC////fzIeA/////8AAAAAkUoC////fzIMAwAAAAABAAAAn0BXAAEKVQAAAHg0A0BXBAJ4NC4MCXByZWRpY2F0ZXk0lXhKcMpxEHIiEWhqznNreTaqJgQJQGqccmppMO8IQFcAAXgLlyYTDA5zb3VyY2UgaXMgbnVsbDpAVwABeBC3QFcAAXg0BKpAVwQBeDQXeEpwynEQciIIaGrOcwhAamkw+AlAVwABeAuXJhMMDnNvdXJjZSBpcyBudWxsOkBXAAEKVwAAAHg0A0BXBAJ4NDAMCXByZWRpY2F0ZXk1+f7//3hKcMpxEHIiEGhqznNreTYmBAhAapxyamkw8AlAVwABeAuXJhMMDnNvdXJjZSBpcyBudWxsOkBXAAF4ELdAVwACeWAKCQAAAHg0oEBXAAF4WLdAVwABeDQDQFcGAXg1nQAAABBwEHF4SnLKcxB0Im5qbM51aEqcSgIAAACALgQiCkoC////fzIeA/////8AAAAAkUoC////fzIMAwAAAAABAAAAn3BFaW2eSgIAAACALgQiCkoC////fzIeA/////8AAAAAkUoC////fzIMAwAAAAABAAAAn3FsnHRsazCSaBCXJhQMD3NvdXJjZSBpcyBlbXB0eTppaKFAVwABeAuXJhMMDnNvdXJjZSBpcyBudWxsOkBXAAEK1gAAAHg0A0BXBgJ4Na8AAAAMCHNlbGVjdG9yeTW//f//EHAQcXhKcspzEHQicGpsznVoSpxKAgAAAIAuBCIKSgL///9/Mh4D/////wAAAACRSgL///9/MgwDAAAAAAEAAACfcEVpbXk2nkoCAAAAgC4EIgpKAv///38yHgP/////AAAAAJFKAv///38yDAMAAAAAAQAAAJ9xbJx0bGswkGgQlyYUDA9zb3VyY2UgaXMgZW1wdHk6aWihQFcAAXgLlyYTDA5zb3VyY2UgaXMgbnVsbDpAVwABEnigSgIAAACALgQiCkoC////fzIeA/////8AAAAAkUoC////fzIMAwAAAAABAAAAn0BXAAF4NANAVwUBeDRNEHB4SnHKchBzIjxpa850aEqcSgIAAACALgQiCkoC////fzIeA/////8AAAAAkUoC////fzIMAwAAAAABAAAAn3BFa5xza2owxGhAVwABeAuXJhMMDnNvdXJjZSBpcyBudWxsOkBXAAEKigAAAHg0A0BXBQJ4NGMMCXByZWRpY2F0ZXk1Qfz//xBweEpxynIQcyJBaWvOdGx5NiY1aEqcSgIAAACALgQiCkoC////fzIeA/////8AAAAAkUoC////fzIMAwAAAAABAAAAn3BFa5xza2owv2hAVwABeAuXJhMMDnNvdXJjZSBpcyBudWxsOkBXAAF4ELdAVwACeXg0A0BXAAJ5YQpAAAAAeDQDQFcEAng12vz//wwJcHJlZGljYXRleTWg+///eEpwynEQciIQaGrOc2t5NiYECEBqnHJqaTDwCUBXAAF4WZdAVwACeXg0r0BXBQLCcHhKccpyEHMiH2lrznRoEAsSwEo0NGw3AABLEFHQbEsRUdDPa5xza2ow4RALEsBKNBh5NwAASxBR0HlLEVHQcWloNWb///9AVwABeBAL0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AAACALgQiCkoC////fzIeA/////8AAAAAkUoC////fzIMAwAAAAABAAAAn0BXAAJ5eDQDQFcFAng0V8JweEpxynIQcyJGaWvOdHkQtiYEIj9obM95Sp1KAgAAAIAuBCIKSgL///9/Mh4D/////wAAAACRSgL///9/MgwDAAAAAAEAAACfgUVrnHNrajC6aEBXAAF4C5cmEwwOc291cmNlIGlzIG51bGw6QFcBAQoaAAAAeDUH/f//cAqZAAAACpkAAABoNCFAVwABxUoLz0oQz0o1dvz//3g3AABLEFHQeEsRUdBAVwUDeDRPDAtrZXlTZWxlY3Rvcnk13fb//wwPZWxlbWVudFNlbGVjdG9yejXG9v//yHB4SnHKchBzIhRpa850bHo2Smx5NmhT0EVrnHNrajDsaEBXAAF4C5cmEwwOc291cmNlIGlzIG51bGw6QFcAAXhAVwABeBDOQFcAAQpaAAAAeDQDQFcFAng0MwwJcHJlZGljYXRleTVa9v//wnB4SnHKchBzIhFpa850bHk2JgVobM9rnHNrajDvaEBXAAF4C5cmEwwOc291cmNlIGlzIG51bGw6QFcAAXgQt0BWAkB2hJ2t")); + public static Neo.SmartContract.NefFile Nef => Neo.IO.Helper.AsSerializable(Convert.FromBase64String(@"TkVGM1Rlc3RpbmdFbmdpbmUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHA7znO4OTpJcbCoGp54UQN2G/OrARpdG9hAQABDwAA/SoKVwABCmYAAAAQeDQDQFcEA3g0JgwEZnVuY3o0N3hKcMpxEHIiDmhqznNreXo2gWqccmppMPJ5QFcAAXgLlyYTDA5zb3VyY2UgaXMgbnVsbDpAVwACeAuXJhF5DAggaXMgbnVsbIvbKDpAVwACeHmeSgIAAACALgQiCkoC////fzIeA/////8AAAAAkUoC////fzIMAwAAAAABAAAAn0BXAAEKVQAAAHg0A0BXBAJ4NC4MCXByZWRpY2F0ZXk0lXhKcMpxEHIiEWhqznNreTaqJgQJQGqccmppMO8IQFcAAXgLly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AACALgQiCkoC////fzIeA/////8AAAAAkUoC////fzIMAwAAAAABAAAAn3BFa5xza2owv2hAVwABeAuXJhMMDnNvdXJjZSBpcyBudWxsOkBXAAF4ELdAVwACeXg0A0BXAAJ5YQpAAAAAeDQDQFcEAng12vz//wwJcHJlZGljYXRleTWg+///eEpwynEQciIQaGrOc2t5NiYECEBqnHJqaTDwCUBXAAF4WZdAVwACeXg0r0BXBQLCcHhKccpyEHMiH2lrznRoEAsSwEo0NGw3AABLEFHQbEsRUdDPa5xza2ow4RALEsBKNBh5NwAASxBR0HlLEVHQcWloNWb///9AVwABeBAL0EBXBQLCcHhKccpyEHMiH2lrznRoEAsSwEo04Gw3AABLEFHQbEsRUdDPa5xza2ow4Wh5znFpaDUj////QFcFAsJweEpxynIQcyIfaWvOdGjFSgvPShDPbDcAAEsQUdBsSxFR0M9rnHNrajDhxUoLz0oQz3k3AABLEFHQeUsRUdBxaWg11/7//0BXAAEPClcAAAB4NANAVwQDeDQwDAlwcmVkaWNhdGV5NXX6//94SnDKcRByIhBoas5za3k2JgRrQGqccmppMPB6QFcAAXgLlyYTDA5zb3VyY2UgaXMgbnVsbDpAVwABeBC3QFcAAQpWAAAAeDQDQFcFAng0LwwIc2VsZWN0b3J5NRX6///CcHhKccpyEHMiDmlrznRobHk2z2ucc2tqMPJoQFcAAXgLlyYTDA5zb3VyY2UgaXMgbnVsbDpAVwABeBKgSgIAAACALgQiCkoC////fzIeA/////8AAAAAkUoC////fzIMAwAAAAABAAAAn0BXBQHCcHhKccpyEHMiImlrznRoEAsSwEo1af7//2w3AABLEFHQbEsRUdDPa5xza2ow3goMAAAAaDVG////QFcAAcVKC89KEM94EM5LEFHQeBHOSxFR0EBXAAJ5eDQDQFcFAng0V8JweEpxynIQcyJGaWvOdHkQtyY3eUqdSgIAAACALgQiCkoC////fzIeA/////8AAAAAkUoC////fzIMAwAAAAABAAAAn4FFIgVobM9rnHNrajC6aEBXAAF4C5cmEwwOc291cmNlIGlzIG51bGw6QFcAAXg0A0BXBQF4Ncz6//8QcHhKccpyEHMiO2lrznRobJ5KAgAAAIAuBCIKSgL///9/Mh4D/////wAAAACRSgL///9/MgwDAAAAAAEAAACfcGucc2tqMMVoQFcAAQqFAAAAeDQDQFcFAng0XgwIc2VsZWN0b3J5NVn4//8QcHhKccpyEHMiPWlrznRobHk2nkoCAAAAgC4EIgpKAv///38yHgP/////AAAAAJFKAv///38yDAMAAAAAAQAAAJ9wa5xza2oww2hAVwABeAuXJhMMDnNvdXJjZSBpcyBudWxsOkBXAAESeKBKAgAAAIAuBCIKSgL///9/Mh4D/////wAAAACRSgL///9/MgwDAAAAAAEAAACfQFcAAnl4NANAVwUCeDRXwnB4SnHKchBzIkZpa850eRC2JgQiP2hsz3lKnUoCAAAAgC4EIgpKAv///38yHgP/////AAAAAJFKAv///38yDAMAAAAAAQAAAJ+BRWucc2tqMLpoQFcAAXgLlyYTDA5zb3VyY2UgaXMgbnVsbDpAVwEBChoAAAB4NQ39//9wCpMAAAAKkwAAAGg0G0BXAAHFSgvPShDPeDcAAEsQUdB4SxFR0EBXBQN4NE8MC2tleVNlbGVjdG9yeTXz9v//DA9lbGVtZW50U2VsZWN0b3J6Ndz2///IcHhKccpyEHMiFGlrznRsejZKbHk2aFPQRWucc2tqMOxoQFcAAXgLlyYTDA5zb3VyY2UgaXMgbnVsbDpAVwABeEBXAAF4EM5AVwABCloAAAB4NANAVwUCeDQzDAlwcmVkaWNhdGV5NXD2///CcHhKccpyEHMiEWlrznRseTYmBWhsz2ucc2tqMO9oQFcAAXgLlyYTDA5zb3VyY2UgaXMgbnVsbDpAVwABeBC3QFYCQD/Si6g=")); #endregion @@ -328,7 +328,7 @@ public abstract class Contract_Linq(Neo.SmartContract.Testing.SmartContractIniti /// Unsafe method /// /// - /// Script: VwUCwnB4SnHKchBzIiJpa850aMVKC89KEM9KNDdsNwAASxBR0GxLEVHQz2ucc2tqMN7FSgvPShDPSjQYeTcAAEsQUdB5SxFR0HFpaDXR/v//QA== + /// Script: VwUCwnB4SnHKchBzIh9pa850aMVKC89KEM9sNwAASxBR0GxLEVHQz2ucc2tqMOHFSgvPShDPeTcAAEsQUdB5SxFR0HFpaDXX/v//QA== /// 00 : OpCode.INITSLOT 0502 /// 03 : OpCode.NEWARRAY0 /// 04 : OpCode.STLOC0 @@ -339,7 +339,7 @@ public abstract class Contract_Linq(Neo.SmartContract.Testing.SmartContractIniti /// 09 : OpCode.STLOC2 /// 0A : OpCode.PUSH0 /// 0B : OpCode.STLOC3 - /// 0C : OpCode.JMP 22 + /// 0C : OpCode.JMP 1F /// 0E : OpCode.LDLOC1 /// 0F : OpCode.LDLOC3 /// 10 : OpCode.PICKITEM @@ -352,51 +352,47 @@ public abstract class Contract_Linq(Neo.SmartContract.Testing.SmartContractIniti /// 17 : OpCode.DUP /// 18 : OpCode.PUSH0 /// 19 : OpCode.APPEND - /// 1A : OpCode.DUP - /// 1B : OpCode.CALL 37 - /// 1D : OpCode.LDLOC4 - /// 1E : OpCode.CALLT 0000 - /// 21 : OpCode.OVER - /// 22 : OpCode.PUSH0 - /// 23 : OpCode.ROT - /// 24 : OpCode.SETITEM - /// 25 : OpCode.LDLOC4 - /// 26 : OpCode.OVER - /// 27 : OpCode.PUSH1 - /// 28 : OpCode.ROT - /// 29 : OpCode.SETITEM - /// 2A : OpCode.APPEND + /// 1A : OpCode.LDLOC4 + /// 1B : OpCode.CALLT 0000 + /// 1E : OpCode.OVER + /// 1F : OpCode.PUSH0 + /// 20 : OpCode.ROT + /// 21 : OpCode.SETITEM + /// 22 : OpCode.LDLOC4 + /// 23 : OpCode.OVER + /// 24 : OpCode.PUSH1 + /// 25 : OpCode.ROT + /// 26 : OpCode.SETITEM + /// 27 : OpCode.APPEND + /// 28 : OpCode.LDLOC3 + /// 29 : OpCode.INC + /// 2A : OpCode.STLOC3 /// 2B : OpCode.LDLOC3 - /// 2C : OpCode.INC - /// 2D : OpCode.STLOC3 - /// 2E : OpCode.LDLOC3 - /// 2F : OpCode.LDLOC2 - /// 30 : OpCode.JMPLT DE - /// 32 : OpCode.NEWSTRUCT0 + /// 2C : OpCode.LDLOC2 + /// 2D : OpCode.JMPLT E1 + /// 2F : OpCode.NEWSTRUCT0 + /// 30 : OpCode.DUP + /// 31 : OpCode.PUSHNULL + /// 32 : OpCode.APPEND /// 33 : OpCode.DUP - /// 34 : OpCode.PUSHNULL + /// 34 : OpCode.PUSH0 /// 35 : OpCode.APPEND - /// 36 : OpCode.DUP - /// 37 : OpCode.PUSH0 - /// 38 : OpCode.APPEND - /// 39 : OpCode.DUP - /// 3A : OpCode.CALL 18 - /// 3C : OpCode.LDARG1 - /// 3D : OpCode.CALLT 0000 - /// 40 : OpCode.OVER - /// 41 : OpCode.PUSH0 - /// 42 : OpCode.ROT - /// 43 : OpCode.SETITEM - /// 44 : OpCode.LDARG1 - /// 45 : OpCode.OVER - /// 46 : OpCode.PUSH1 - /// 47 : OpCode.ROT - /// 48 : OpCode.SETITEM - /// 49 : OpCode.STLOC1 - /// 4A : OpCode.LDLOC1 - /// 4B : OpCode.LDLOC0 - /// 4C : OpCode.CALL_L D1FEFFFF - /// 51 : OpCode.RET + /// 36 : OpCode.LDARG1 + /// 37 : OpCode.CALLT 0000 + /// 3A : OpCode.OVER + /// 3B : OpCode.PUSH0 + /// 3C : OpCode.ROT + /// 3D : OpCode.SETITEM + /// 3E : OpCode.LDARG1 + /// 3F : OpCode.OVER + /// 40 : OpCode.PUSH1 + /// 41 : OpCode.ROT + /// 42 : OpCode.SETITEM + /// 43 : OpCode.STLOC1 + /// 44 : OpCode.LDLOC1 + /// 45 : OpCode.LDLOC0 + /// 46 : OpCode.CALL_L D7FEFFFF + /// 4B : OpCode.RET /// [DisplayName("containsPersonS")] public abstract bool? ContainsPersonS(IList? array, BigInteger? target); @@ -522,7 +518,7 @@ public abstract class Contract_Linq(Neo.SmartContract.Testing.SmartContractIniti /// Unsafe method /// /// - /// Script: VwUBwnB4SnHKchBzIiJpa850aBALEsBKNV/+//9sNwAASxBR0GxLEVHQz2ucc2tqMN4KDAAAAGg1Rv///0A= + /// Script: VwUBwnB4SnHKchBzIiJpa850aBALEsBKNWn+//9sNwAASxBR0GxLEVHQz2ucc2tqMN4KDAAAAGg1Rv///0A= /// 00 : OpCode.INITSLOT 0501 /// 03 : OpCode.NEWARRAY0 /// 04 : OpCode.STLOC0 @@ -544,7 +540,7 @@ public abstract class Contract_Linq(Neo.SmartContract.Testing.SmartContractIniti /// 15 : OpCode.PUSH2 /// 16 : OpCode.PACK /// 17 : OpCode.DUP - /// 18 : OpCode.CALL_L 5FFEFFFF + /// 18 : OpCode.CALL_L 69FEFFFF /// 1D : OpCode.LDLOC4 /// 1E : OpCode.CALLT 0000 /// 21 : OpCode.OVER @@ -650,13 +646,13 @@ public abstract class Contract_Linq(Neo.SmartContract.Testing.SmartContractIniti /// Unsafe method /// /// - /// Script: VwUCeDReDHNlbGVjdG9yeTVJ+P//EHB4SnHKchBzIj1pa850aGx5Np5KAgAAAIAuBCIKSgL///9/Mh4D/////wAAAACRSgL///9/MgwDAAAAAAEAAACfcGucc2tqMMNoQA== + /// Script: VwUCeDReDHNlbGVjdG9yeTVZ+P//EHB4SnHKchBzIj1pa850aGx5Np5KAgAAAIAuBCIKSgL///9/Mh4D/////wAAAACRSgL///9/MgwDAAAAAAEAAACfcGucc2tqMMNoQA== /// 00 : OpCode.INITSLOT 0502 /// 03 : OpCode.LDARG0 /// 04 : OpCode.CALL 5E /// 06 : OpCode.PUSHDATA1 73656C6563746F72 /// 10 : OpCode.LDARG1 - /// 11 : OpCode.CALL_L 49F8FFFF + /// 11 : OpCode.CALL_L 59F8FFFF /// 16 : OpCode.PUSH0 /// 17 : OpCode.STLOC0 /// 18 : OpCode.LDARG0 @@ -782,16 +778,16 @@ public abstract class Contract_Linq(Neo.SmartContract.Testing.SmartContractIniti /// Unsafe method /// /// - /// Script: VwUDeDRPDGtleVNlbGVjdG9yeTXd9v//DGVsZW1lbnRTZWxlY3Rvcno1xvb//8hweEpxynIQcyIUaWvOdGx6NkpseTZoU9BFa5xza2ow7GhA + /// Script: VwUDeDRPDGtleVNlbGVjdG9yeTXz9v//DGVsZW1lbnRTZWxlY3Rvcno13Pb//8hweEpxynIQcyIUaWvOdGx6NkpseTZoU9BFa5xza2ow7GhA /// 00 : OpCode.INITSLOT 0503 /// 03 : OpCode.LDARG0 /// 04 : OpCode.CALL 4F /// 06 : OpCode.PUSHDATA1 6B657953656C6563746F72 /// 13 : OpCode.LDARG1 - /// 14 : OpCode.CALL_L DDF6FFFF + /// 14 : OpCode.CALL_L F3F6FFFF /// 19 : OpCode.PUSHDATA1 656C656D656E7453656C6563746F72 /// 2A : OpCode.LDARG2 - /// 2B : OpCode.CALL_L C6F6FFFF + /// 2B : OpCode.CALL_L DCF6FFFF /// 30 : OpCode.NEWMAP /// 31 : OpCode.STLOC0 /// 32 : OpCode.LDARG0 diff --git a/tests/Neo.Compiler.CSharp.UnitTests/TestingArtifacts/Contract_NEP11.cs b/tests/Neo.Compiler.CSharp.UnitTests/TestingArtifacts/Contract_NEP11.cs index 6721deb42..bceafba5a 100644 --- a/tests/Neo.Compiler.CSharp.UnitTests/TestingArtifacts/Contract_NEP11.cs +++ b/tests/Neo.Compiler.CSharp.UnitTests/TestingArtifacts/Contract_NEP11.cs @@ -165,7 +165,7 @@ public abstract class Contract_NEP11(Neo.SmartContract.Testing.SmartContractInit /// Safe method /// /// - /// Script: VwIBExGIThBR0EGb9mfOEsBweGjBRVOLUEGSXegxNwAAcchpEc5LU9BA + /// Script: VwIBExGIThBR0EGb9mfOEsBweGjBRVOLUEGSXegxNwAAcchKDG5hbWVpEc7QQA== /// 00 : OpCode.INITSLOT 0201 /// 03 : OpCode.PUSH3 /// 04 : OpCode.PUSH1 @@ -189,13 +189,13 @@ public abstract class Contract_NEP11(Neo.SmartContract.Testing.SmartContractInit /// 1E : OpCode.CALLT 0000 /// 21 : OpCode.STLOC1 /// 22 : OpCode.NEWMAP - /// 23 : OpCode.LDLOC1 - /// 24 : OpCode.PUSH1 - /// 25 : OpCode.PICKITEM - /// 26 : OpCode.OVER - /// 27 : OpCode.REVERSE3 - /// 28 : OpCode.SETITEM - /// 29 : OpCode.RET + /// 23 : OpCode.DUP + /// 24 : OpCode.PUSHDATA1 6E616D65 + /// 2A : OpCode.LDLOC1 + /// 2B : OpCode.PUSH1 + /// 2C : OpCode.PICKITEM + /// 2D : OpCode.SETITEM + /// 2E : OpCode.RET /// [DisplayName("properties")] public abstract IDictionary? Properties(byte[]? tokenId); diff --git a/tests/Neo.Compiler.CSharp.UnitTests/TestingArtifacts/Contract_NULL.cs b/tests/Neo.Compiler.CSharp.UnitTests/TestingArtifacts/Contract_NULL.cs index 89d1f7df1..2afd85583 100644 --- a/tests/Neo.Compiler.CSharp.UnitTests/TestingArtifacts/Contract_NULL.cs +++ b/tests/Neo.Compiler.CSharp.UnitTests/TestingArtifacts/Contract_NULL.cs @@ -15,7 +15,7 @@ public abstract class Contract_NULL(Neo.SmartContract.Testing.SmartContractIniti /// /// Optimization: "All" /// - public static Neo.SmartContract.NefFile Nef => Neo.IO.Helper.AsSerializable(Convert.FromBase64String(@"TkVGM1Rlc3RpbmdFbmdpbmUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOVXAQF4cGgLl0BXAAELeJdAVwABeAuXQFcAAQt4mEBXAAF4C5hAVwEBeErYJAUREoxwaEBXAQF4StgmCkUMBWxpbnV4cGhAVwABeErYJAPKELdAVwABeErYJAPKELVAVwABeErYJAPKELhAVwABeErYJAPKELZAVwABeErYJAPKEJhAVwABeCYECEAJQFcBAUGb9mfOcHhoQZJd6DFK2CYKRQwBe9sw2yhAVwEBQZv2Z85wDAMxMTF4aEHmPxiEeGhBkl3oMUrYJgpFDAF72zDbKEBXAQALcGhK2CQFNAVARUBXAAFARiQ5mA==")); + public static Neo.SmartContract.NefFile Nef => Neo.IO.Helper.AsSerializable(Convert.FromBase64String(@"TkVGM1Rlc3RpbmdFbmdpbmUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAN9XAQF4cGgLl0BXAAELeJdAVwABeAuXQFcAAQt4mEBXAAF4C5hAVwEBeErYJAUREoxwaEBXAQF4StgmCkUMBWxpbnV4cGhAVwABeErYJAPKELdAVwABeErYJAPKELVAVwABeErYJAPKELhAVwABeErYJAPKELZAVwABeErYJAPKEJhAVwABeCYECEAJQFcBAUGb9mfOcHhoQZJd6DFK2CYKRQwBe9sw2yhAVwEBQZv2Z85wDAMxMTF4aEHmPxiEeGhBkl3oMUrYJgpFDAF72zDbKEBXAQALcGhK2CQDQEVAaY7bZQ==")); #endregion @@ -292,18 +292,17 @@ public abstract class Contract_NULL(Neo.SmartContract.Testing.SmartContractIniti /// Unsafe method /// /// - /// Script: VwEAC3BoStgkBTQFQEVA + /// Script: VwEAC3BoStgkA0BFQA== /// 00 : OpCode.INITSLOT 0100 /// 03 : OpCode.PUSHNULL /// 04 : OpCode.STLOC0 /// 05 : OpCode.LDLOC0 /// 06 : OpCode.DUP /// 07 : OpCode.ISNULL - /// 08 : OpCode.JMPIF 05 - /// 0A : OpCode.CALL 05 + /// 08 : OpCode.JMPIF 03 + /// 0A : OpCode.RET + /// 0B : OpCode.DROP /// 0C : OpCode.RET - /// 0D : OpCode.DROP - /// 0E : OpCode.RET /// [DisplayName("nullType")] public abstract void NullType(); diff --git a/tests/Neo.Compiler.CSharp.UnitTests/TestingArtifacts/Contract_Polymorphism.cs b/tests/Neo.Compiler.CSharp.UnitTests/TestingArtifacts/Contract_Polymorphism.cs index 8d9f6fef8..988d714d2 100644 --- a/tests/Neo.Compiler.CSharp.UnitTests/TestingArtifacts/Contract_Polymorphism.cs +++ b/tests/Neo.Compiler.CSharp.UnitTests/TestingArtifacts/Contract_Polymorphism.cs @@ -10,12 +10,12 @@ public abstract class Contract_Polymorphism(Neo.SmartContract.Testing.SmartContr { #region Compiled data - public static Neo.SmartContract.Manifest.ContractManifest Manifest => Neo.SmartContract.Manifest.ContractManifest.Parse(@"{""name"":""Contract_Polymorphism"",""groups"":[],""features"":{},""supportedstandards"":[],""abi"":{""methods"":[{""name"":""sum"",""parameters"":[{""name"":""a"",""type"":""Integer""},{""name"":""b"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":210,""safe"":false},{""name"":""test"",""parameters"":[],""returntype"":""String"",""offset"":225,""safe"":false},{""name"":""test2"",""parameters"":[],""returntype"":""String"",""offset"":240,""safe"":false},{""name"":""mul"",""parameters"":[{""name"":""a"",""type"":""Integer""},{""name"":""b"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":255,""safe"":false},{""name"":""_initialize"",""parameters"":[],""returntype"":""Void"",""offset"":168,""safe"":false}],""events"":[]},""permissions"":[],""trusts"":[],""extra"":{""nef"":{""optimization"":""All""}}}"); + public static Neo.SmartContract.Manifest.ContractManifest Manifest => Neo.SmartContract.Manifest.ContractManifest.Parse(@"{""name"":""Contract_Polymorphism"",""groups"":[],""features"":{},""supportedstandards"":[],""abi"":{""methods"":[{""name"":""sum"",""parameters"":[{""name"":""a"",""type"":""Integer""},{""name"":""b"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":185,""safe"":false},{""name"":""test"",""parameters"":[],""returntype"":""String"",""offset"":194,""safe"":false},{""name"":""test2"",""parameters"":[],""returntype"":""String"",""offset"":203,""safe"":false},{""name"":""mul"",""parameters"":[{""name"":""a"",""type"":""Integer""},{""name"":""b"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":212,""safe"":false},{""name"":""_initialize"",""parameters"":[],""returntype"":""Void"",""offset"":143,""safe"":false}],""events"":[]},""permissions"":[],""trusts"":[],""extra"":{""nef"":{""optimization"":""All""}}}"); /// /// Optimization: "All" /// - public static Neo.SmartContract.NefFile Nef => Neo.IO.Helper.AsSerializable(Convert.FromBase64String(@"TkVGM1Rlc3RpbmdFbmdpbmUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP0PAVcAA3l6nkoCAAAAgC4EIgpKAv///38yHgP/////AAAAAJFKAv///38yDAMAAAAAAQAAAJ9AVwABeDQDQFcAAUBXAAEMBHRlc3RAVwABeDQDQFcAAXg04EBXAAF4NA0MBS50ZXN0i9soQFcAAQwEYmFzZUBXAAN5eqBKAgAAAIAuBCIKSgL///9/Mh4D/////wAAAACRSgL///9/MgwDAAAAAAEAAACfQFYDCr////8KAAAAABLAYAqh////CoT///8SwGEKpf///woAAAAAEsBiQMJKWM9KNV7///8jJP///8JKWc9KNWT///8jVf///8JKWc9KNVX///8jXv///8JKWs9KNU3///8jav///0BjzI3j")); + public static Neo.SmartContract.NefFile Nef => Neo.IO.Helper.AsSerializable(Convert.FromBase64String(@"TkVGM1Rlc3RpbmdFbmdpbmUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAN5XAAN5ep5KAgAAAIAuBCIKSgL///9/Mh4D/////wAAAACRSgL///9/MgwDAAAAAAEAAACfQFcAAQwEdGVzdEBXAAF4NA0MBS50ZXN0i9soQFcAAQwEYmFzZUBXAAN5eqBKAgAAAIAuBCIKSgL///9/Mh4D/////wAAAACRSgL///9/MgwDAAAAAAEAAACfQFYDCr////8KAAAAABLAYAqh////CpL///8SwGEKpf///woAAAAAEsBiQMJKWM8jQ////8JKWc8jb////8JKWc8jcP///8JKWs8jgv///0BB1CHo")); #endregion @@ -46,5 +46,4 @@ public abstract class Contract_Polymorphism(Neo.SmartContract.Testing.SmartContr public abstract string? Test2(); #endregion - } diff --git a/tests/Neo.Compiler.CSharp.UnitTests/TestingArtifacts/Contract_PropertyMethod.cs b/tests/Neo.Compiler.CSharp.UnitTests/TestingArtifacts/Contract_PropertyMethod.cs index d881bac62..c50b1decb 100644 --- a/tests/Neo.Compiler.CSharp.UnitTests/TestingArtifacts/Contract_PropertyMethod.cs +++ b/tests/Neo.Compiler.CSharp.UnitTests/TestingArtifacts/Contract_PropertyMethod.cs @@ -10,12 +10,12 @@ public abstract class Contract_PropertyMethod(Neo.SmartContract.Testing.SmartCon { #region Compiled data - public static Neo.SmartContract.Manifest.ContractManifest Manifest => Neo.SmartContract.Manifest.ContractManifest.Parse(@"{""name"":""Contract_PropertyMethod"",""groups"":[],""features"":{},""supportedstandards"":[],""abi"":{""methods"":[{""name"":""testProperty"",""parameters"":[],""returntype"":""Array"",""offset"":0,""safe"":false},{""name"":""testProperty2"",""parameters"":[],""returntype"":""Void"",""offset"":50,""safe"":false},{""name"":""testProperty3"",""parameters"":[],""returntype"":""Any"",""offset"":71,""safe"":false},{""name"":""testProperty4"",""parameters"":[],""returntype"":""Map"",""offset"":94,""safe"":false},{""name"":""testProperty5"",""parameters"":[],""returntype"":""Array"",""offset"":110,""safe"":false},{""name"":""testPropertyInit"",""parameters"":[],""returntype"":""Array"",""offset"":120,""safe"":false}],""events"":[]},""permissions"":[],""trusts"":[],""extra"":{""nef"":{""optimization"":""All""}}}"); + public static Neo.SmartContract.Manifest.ContractManifest Manifest => Neo.SmartContract.Manifest.ContractManifest.Parse(@"{""name"":""Contract_PropertyMethod"",""groups"":[],""features"":{},""supportedstandards"":[],""abi"":{""methods"":[{""name"":""testProperty"",""parameters"":[],""returntype"":""Array"",""offset"":0,""safe"":false},{""name"":""testProperty2"",""parameters"":[],""returntype"":""Void"",""offset"":50,""safe"":false},{""name"":""testProperty3"",""parameters"":[],""returntype"":""Any"",""offset"":71,""safe"":false},{""name"":""testProperty4"",""parameters"":[],""returntype"":""Map"",""offset"":87,""safe"":false},{""name"":""testProperty5"",""parameters"":[],""returntype"":""Array"",""offset"":103,""safe"":false},{""name"":""testPropertyInit"",""parameters"":[],""returntype"":""Array"",""offset"":113,""safe"":false}],""events"":[]},""permissions"":[],""trusts"":[],""extra"":{""nef"":{""optimization"":""All""}}}"); /// /// Optimization: "All" /// - public static Neo.SmartContract.NefFile Nef => Neo.IO.Helper.AsSerializable(Convert.FromBase64String(@"TkVGM1Rlc3RpbmdFbmdpbmUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAALRXAQALEAsTwBoMBE5FTzMSTTQPcMVKaBDOz0poEc7PQFcAA3lKeBBR0EV6SngRUdBFQFcBAAsQCxPAGgwETkVPMxJNNN1wQAsQCxPASjQNDARORU8zSxBR0EBXAAFAyEoMBE5hbWUMBE5FTzPQQMJFFRQTEhEVwEBXAQALEAsTwBoMBE5FTzMSTTSXDBExMjMgQmxvY2tjaGFpbiBTdEsSUdBwxUpoEM7PSmgRzs9KaBLOz0Dp1QFJ")); + public static Neo.SmartContract.NefFile Nef => Neo.IO.Helper.AsSerializable(Convert.FromBase64String(@"TkVGM1Rlc3RpbmdFbmdpbmUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAK1XAQALEAsTwBoMBE5FTzMSTTQPcMVKaBDOz0poEc7PQFcAA3lKeBBR0EV6SngRUdBFQFcBAAsQCxPAGgwETkVPMxJNNN1wQAsQCxPADARORU8zSxBR0EDISgwETmFtZQwETkVPM9BAwkUVFBMSERXAQFcBAAsQCxPAGgwETkVPMxJNNJ4METEyMyBCbG9ja2NoYWluIFN0SxJR0HDFSmgQzs9KaBHOz0poEs7PQB4opaE=")); #endregion @@ -58,5 +58,4 @@ public abstract class Contract_PropertyMethod(Neo.SmartContract.Testing.SmartCon public abstract IList? TestPropertyInit(); #endregion - } diff --git a/tests/Neo.Compiler.CSharp.UnitTests/TestingArtifacts/Contract_Recursion.cs b/tests/Neo.Compiler.CSharp.UnitTests/TestingArtifacts/Contract_Recursion.cs index 3240db916..5b20e7e03 100644 --- a/tests/Neo.Compiler.CSharp.UnitTests/TestingArtifacts/Contract_Recursion.cs +++ b/tests/Neo.Compiler.CSharp.UnitTests/TestingArtifacts/Contract_Recursion.cs @@ -10,12 +10,12 @@ public abstract class Contract_Recursion(Neo.SmartContract.Testing.SmartContract { #region Compiled data - public static Neo.SmartContract.Manifest.ContractManifest Manifest => Neo.SmartContract.Manifest.ContractManifest.Parse(@"{""name"":""Contract_Recursion"",""groups"":[],""features"":{},""supportedstandards"":[],""abi"":{""methods"":[{""name"":""factorial"",""parameters"":[{""name"":""a"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":0,""safe"":false},{""name"":""hanoiTower"",""parameters"":[{""name"":""n"",""type"":""Integer""},{""name"":""src"",""type"":""Integer""},{""name"":""aux"",""type"":""Integer""},{""name"":""dst"",""type"":""Integer""}],""returntype"":""Array"",""offset"":50,""safe"":false},{""name"":""even"",""parameters"":[{""name"":""n"",""type"":""Integer""}],""returntype"":""Boolean"",""offset"":186,""safe"":false},{""name"":""odd"",""parameters"":[{""name"":""n"",""type"":""Integer""}],""returntype"":""Boolean"",""offset"":212,""safe"":false}],""events"":[]},""permissions"":[],""trusts"":[],""extra"":{""nef"":{""optimization"":""All""}}}"); + public static Neo.SmartContract.Manifest.ContractManifest Manifest => Neo.SmartContract.Manifest.ContractManifest.Parse(@"{""name"":""Contract_Recursion"",""groups"":[],""features"":{},""supportedstandards"":[],""abi"":{""methods"":[{""name"":""factorial"",""parameters"":[{""name"":""a"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":0,""safe"":false},{""name"":""hanoiTower"",""parameters"":[{""name"":""n"",""type"":""Integer""},{""name"":""src"",""type"":""Integer""},{""name"":""aux"",""type"":""Integer""},{""name"":""dst"",""type"":""Integer""}],""returntype"":""Array"",""offset"":50,""safe"":false},{""name"":""even"",""parameters"":[{""name"":""n"",""type"":""Integer""}],""returntype"":""Boolean"",""offset"":176,""safe"":false},{""name"":""odd"",""parameters"":[{""name"":""n"",""type"":""Integer""}],""returntype"":""Boolean"",""offset"":202,""safe"":false}],""events"":[]},""permissions"":[],""trusts"":[],""extra"":{""nef"":{""optimization"":""All""}}}"); /// /// Optimization: "All" /// - public static Neo.SmartContract.NefFile Nef => Neo.IO.Helper.AsSerializable(Convert.FromBase64String(@"TkVGM1Rlc3RpbmdFbmdpbmUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAO5XAAF4ELgMGk1pbnVzIG51bWJlciBub3Qgc3VwcG9ydGVk4XgSuCYKeHgRnzTUoEARQFcFBHgQtwwTQ291bnQgb2YgZGlza3MgPD0gMOF4EZcmIcJwaMVKEM9KEM9KEM9KNFVKEBHQShF50EoSe9DPaEB6e3l4EZ80unBoxUoQz0oQz0oQz0o0L0oQeNBKEXnQShJ70M97eXp4EZ80lkpxynIQcyIMaWvOdGhsz2ucc2tqMPRoQFcAAUBXAAF4EJcmBAhAeBC1Jgd4EZ4iBXgRnzQDQFcAAXgQlyYECUB4ELUmB3gRniIFeBGfNM9AIOeXHg==")); + public static Neo.SmartContract.NefFile Nef => Neo.IO.Helper.AsSerializable(Convert.FromBase64String(@"TkVGM1Rlc3RpbmdFbmdpbmUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAORXAAF4ELgMGk1pbnVzIG51bWJlciBub3Qgc3VwcG9ydGVk4XgSuCYKeHgRnzTUoEARQFcFBHgQtwwTQ291bnQgb2YgZGlza3MgPD0gMOF4EZcmHsJwaMVKEM9KEM9KEM9KEBHQShF50EoSe9DPaEB6e3l4EZ80vXBoxUoQz0oQz0oQz0oQeNBKEXnQShJ70M97eXp4EZ80nEpxynIQcyIMaWvOdGhsz2ucc2tqMPRoQFcAAXgQlyYECEB4ELUmB3gRniIFeBGfNANAVwABeBCXJgQJQHgQtSYHeBGeIgV4EZ80z0DyeJfO")); #endregion @@ -82,7 +82,7 @@ public abstract class Contract_Recursion(Neo.SmartContract.Testing.SmartContract /// Unsafe method /// /// - /// Script: VwUEeBC3DENvdW50IG9mIGRpc2tzIDw9IDDheBGXJiHCcGjFShDPShDPShDPSjRVShAR0EoRedBKEnvQz2hAent5eBGfNLpwaMVKEM9KEM9KEM9KNC9KEHjQShF50EoSe9DPe3l6eBGfNJZKccpyEHMiDGlrznRobM9rnHNrajD0aEA= + /// Script: VwUEeBC3DENvdW50IG9mIGRpc2tzIDw9IDDheBGXJh7CcGjFShDPShDPShDPShAR0EoRedBKEnvQz2hAent5eBGfNL1waMVKEM9KEM9KEM9KEHjQShF50EoSe9DPe3l6eBGfNJxKccpyEHMiDGlrznRobM9rnHNrajD0aEA= /// 00 : OpCode.INITSLOT 0504 /// 03 : OpCode.LDARG0 /// 04 : OpCode.PUSH0 @@ -92,7 +92,7 @@ public abstract class Contract_Recursion(Neo.SmartContract.Testing.SmartContract /// 1C : OpCode.LDARG0 /// 1D : OpCode.PUSH1 /// 1E : OpCode.EQUAL - /// 1F : OpCode.JMPIFNOT 21 + /// 1F : OpCode.JMPIFNOT 1E /// 21 : OpCode.NEWARRAY0 /// 22 : OpCode.STLOC0 /// 23 : OpCode.LDLOC0 @@ -107,32 +107,33 @@ public abstract class Contract_Recursion(Neo.SmartContract.Testing.SmartContract /// 2C : OpCode.PUSH0 /// 2D : OpCode.APPEND /// 2E : OpCode.DUP - /// 2F : OpCode.CALL 55 - /// 31 : OpCode.DUP - /// 32 : OpCode.PUSH0 + /// 2F : OpCode.PUSH0 + /// 30 : OpCode.PUSH1 + /// 31 : OpCode.SETITEM + /// 32 : OpCode.DUP /// 33 : OpCode.PUSH1 - /// 34 : OpCode.SETITEM - /// 35 : OpCode.DUP - /// 36 : OpCode.PUSH1 - /// 37 : OpCode.LDARG1 - /// 38 : OpCode.SETITEM - /// 39 : OpCode.DUP - /// 3A : OpCode.PUSH2 - /// 3B : OpCode.LDARG3 - /// 3C : OpCode.SETITEM - /// 3D : OpCode.APPEND - /// 3E : OpCode.LDLOC0 - /// 3F : OpCode.RET - /// 40 : OpCode.LDARG2 - /// 41 : OpCode.LDARG3 - /// 42 : OpCode.LDARG1 - /// 43 : OpCode.LDARG0 - /// 44 : OpCode.PUSH1 - /// 45 : OpCode.SUB - /// 46 : OpCode.CALL BA - /// 48 : OpCode.STLOC0 - /// 49 : OpCode.LDLOC0 - /// 4A : OpCode.NEWSTRUCT0 + /// 34 : OpCode.LDARG1 + /// 35 : OpCode.SETITEM + /// 36 : OpCode.DUP + /// 37 : OpCode.PUSH2 + /// 38 : OpCode.LDARG3 + /// 39 : OpCode.SETITEM + /// 3A : OpCode.APPEND + /// 3B : OpCode.LDLOC0 + /// 3C : OpCode.RET + /// 3D : OpCode.LDARG2 + /// 3E : OpCode.LDARG3 + /// 3F : OpCode.LDARG1 + /// 40 : OpCode.LDARG0 + /// 41 : OpCode.PUSH1 + /// 42 : OpCode.SUB + /// 43 : OpCode.CALL BD + /// 45 : OpCode.STLOC0 + /// 46 : OpCode.LDLOC0 + /// 47 : OpCode.NEWSTRUCT0 + /// 48 : OpCode.DUP + /// 49 : OpCode.PUSH0 + /// 4A : OpCode.APPEND /// 4B : OpCode.DUP /// 4C : OpCode.PUSH0 /// 4D : OpCode.APPEND @@ -141,51 +142,46 @@ public abstract class Contract_Recursion(Neo.SmartContract.Testing.SmartContract /// 50 : OpCode.APPEND /// 51 : OpCode.DUP /// 52 : OpCode.PUSH0 - /// 53 : OpCode.APPEND - /// 54 : OpCode.DUP - /// 55 : OpCode.CALL 2F - /// 57 : OpCode.DUP - /// 58 : OpCode.PUSH0 - /// 59 : OpCode.LDARG0 - /// 5A : OpCode.SETITEM - /// 5B : OpCode.DUP - /// 5C : OpCode.PUSH1 - /// 5D : OpCode.LDARG1 - /// 5E : OpCode.SETITEM - /// 5F : OpCode.DUP - /// 60 : OpCode.PUSH2 - /// 61 : OpCode.LDARG3 - /// 62 : OpCode.SETITEM - /// 63 : OpCode.APPEND - /// 64 : OpCode.LDARG3 - /// 65 : OpCode.LDARG1 - /// 66 : OpCode.LDARG2 - /// 67 : OpCode.LDARG0 - /// 68 : OpCode.PUSH1 - /// 69 : OpCode.SUB - /// 6A : OpCode.CALL 96 - /// 6C : OpCode.DUP - /// 6D : OpCode.STLOC1 - /// 6E : OpCode.SIZE - /// 6F : OpCode.STLOC2 - /// 70 : OpCode.PUSH0 - /// 71 : OpCode.STLOC3 - /// 72 : OpCode.JMP 0C - /// 74 : OpCode.LDLOC1 + /// 53 : OpCode.LDARG0 + /// 54 : OpCode.SETITEM + /// 55 : OpCode.DUP + /// 56 : OpCode.PUSH1 + /// 57 : OpCode.LDARG1 + /// 58 : OpCode.SETITEM + /// 59 : OpCode.DUP + /// 5A : OpCode.PUSH2 + /// 5B : OpCode.LDARG3 + /// 5C : OpCode.SETITEM + /// 5D : OpCode.APPEND + /// 5E : OpCode.LDARG3 + /// 5F : OpCode.LDARG1 + /// 60 : OpCode.LDARG2 + /// 61 : OpCode.LDARG0 + /// 62 : OpCode.PUSH1 + /// 63 : OpCode.SUB + /// 64 : OpCode.CALL 9C + /// 66 : OpCode.DUP + /// 67 : OpCode.STLOC1 + /// 68 : OpCode.SIZE + /// 69 : OpCode.STLOC2 + /// 6A : OpCode.PUSH0 + /// 6B : OpCode.STLOC3 + /// 6C : OpCode.JMP 0C + /// 6E : OpCode.LDLOC1 + /// 6F : OpCode.LDLOC3 + /// 70 : OpCode.PICKITEM + /// 71 : OpCode.STLOC4 + /// 72 : OpCode.LDLOC0 + /// 73 : OpCode.LDLOC4 + /// 74 : OpCode.APPEND /// 75 : OpCode.LDLOC3 - /// 76 : OpCode.PICKITEM - /// 77 : OpCode.STLOC4 - /// 78 : OpCode.LDLOC0 - /// 79 : OpCode.LDLOC4 - /// 7A : OpCode.APPEND - /// 7B : OpCode.LDLOC3 - /// 7C : OpCode.INC - /// 7D : OpCode.STLOC3 - /// 7E : OpCode.LDLOC3 - /// 7F : OpCode.LDLOC2 - /// 80 : OpCode.JMPLT F4 - /// 82 : OpCode.LDLOC0 - /// 83 : OpCode.RET + /// 76 : OpCode.INC + /// 77 : OpCode.STLOC3 + /// 78 : OpCode.LDLOC3 + /// 79 : OpCode.LDLOC2 + /// 7A : OpCode.JMPLT F4 + /// 7C : OpCode.LDLOC0 + /// 7D : OpCode.RET /// [DisplayName("hanoiTower")] public abstract IList? HanoiTower(BigInteger? n, BigInteger? src, BigInteger? aux, BigInteger? dst); diff --git a/tests/Neo.Compiler.CSharp.UnitTests/TestingArtifacts/Contract_Reentrancy.cs b/tests/Neo.Compiler.CSharp.UnitTests/TestingArtifacts/Contract_Reentrancy.cs index dde4b191c..f2f69eae7 100644 --- a/tests/Neo.Compiler.CSharp.UnitTests/TestingArtifacts/Contract_Reentrancy.cs +++ b/tests/Neo.Compiler.CSharp.UnitTests/TestingArtifacts/Contract_Reentrancy.cs @@ -10,12 +10,12 @@ public abstract class Contract_Reentrancy(Neo.SmartContract.Testing.SmartContrac { #region Compiled data - public static Neo.SmartContract.Manifest.ContractManifest Manifest => Neo.SmartContract.Manifest.ContractManifest.Parse(@"{""name"":""Contract_Reentrancy"",""groups"":[],""features"":{},""supportedstandards"":[],""abi"":{""methods"":[{""name"":""hasReentrancy"",""parameters"":[],""returntype"":""Void"",""offset"":0,""safe"":false},{""name"":""hasReentrancyFromSingleBasicBlock"",""parameters"":[],""returntype"":""Void"",""offset"":115,""safe"":false},{""name"":""hasReentrancyFromCall"",""parameters"":[],""returntype"":""Void"",""offset"":219,""safe"":false},{""name"":""noReentrancy"",""parameters"":[],""returntype"":""Void"",""offset"":309,""safe"":false},{""name"":""noReentrancyFromCall"",""parameters"":[],""returntype"":""Void"",""offset"":413,""safe"":false},{""name"":""noReentrancyFromJump"",""parameters"":[{""name"":""input"",""type"":""Boolean""}],""returntype"":""Void"",""offset"":432,""safe"":false},{""name"":""noReentrancyByAttribute"",""parameters"":[],""returntype"":""Void"",""offset"":543,""safe"":false},{""name"":""_initialize"",""parameters"":[],""returntype"":""Void"",""offset"":708,""safe"":false}],""events"":[]},""permissions"":[],""trusts"":[],""extra"":{""nef"":{""optimization"":""All""}}}"); + public static Neo.SmartContract.Manifest.ContractManifest Manifest => Neo.SmartContract.Manifest.ContractManifest.Parse(@"{""name"":""Contract_Reentrancy"",""groups"":[],""features"":{},""supportedstandards"":[],""abi"":{""methods"":[{""name"":""hasReentrancy"",""parameters"":[],""returntype"":""Void"",""offset"":0,""safe"":false},{""name"":""hasReentrancyFromSingleBasicBlock"",""parameters"":[],""returntype"":""Void"",""offset"":115,""safe"":false},{""name"":""hasReentrancyFromCall"",""parameters"":[],""returntype"":""Void"",""offset"":219,""safe"":false},{""name"":""noReentrancy"",""parameters"":[],""returntype"":""Void"",""offset"":309,""safe"":false},{""name"":""noReentrancyFromCall"",""parameters"":[],""returntype"":""Void"",""offset"":413,""safe"":false},{""name"":""noReentrancyFromJump"",""parameters"":[{""name"":""input"",""type"":""Boolean""}],""returntype"":""Void"",""offset"":432,""safe"":false},{""name"":""noReentrancyByAttribute"",""parameters"":[],""returntype"":""Void"",""offset"":543,""safe"":false},{""name"":""_initialize"",""parameters"":[],""returntype"":""Void"",""offset"":701,""safe"":false}],""events"":[]},""permissions"":[],""trusts"":[],""extra"":{""nef"":{""optimization"":""All""}}}"); /// /// Optimization: "All" /// - public static Neo.SmartContract.NefFile Nef => Neo.IO.Helper.AsSerializable(Convert.FromBase64String(@"TkVGM1Rlc3RpbmdFbmdpbmUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP3UAlcBADtcAAsQDBQAAAAAAAAAAAAAAAAAAAAAAAAAAAwUAAAAAAAAAAAAAAAAAAAAAAAAAAAUwB8MCHRyYW5zZmVyDBT1Y+pAvCg9TQ4FxI6jBbPyoHNA70FifVtSRT0VcBEMAQHbMEGb9mfOQeY/GIQ9AkALEAwUAAAAAAAAAAAAAAAAAAAAAAAAAAAMFAAAAAAAAAAAAAAAAAAAAAAAAAAAFMAfDAh0cmFuc2ZlcgwU9WPqQLwoPU0OBcSOowWz8qBzQO9BYn1bUkURDAEB2zBBm/ZnzkHmPxiEQAsQ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fDAh0cmFuc2ZlcgwU9WPqQLwoPU0OBcSOowWz8qBzQO9BYn1bUkURDAEB2zBBm/ZnzkHmPxiEQAsQDBQAAAAAAAAAAAAAAAAAAAAAAAAAAAwUAAAAAAAAAAAAAAAAAAAAAAAAAAAUwB8MCHRyYW5zZmVyDBTPduKL0AYsSkeO41VhARMZ88+k0kFifVtSRTQDQBEMAQHbMEGb9mfOQeY/GIQLEAwUAAAAAAAAAAAAAAAAAAAAAAAAAAAMFAAAAAAAAAAAAAAAAAAAAAAAAAAAFMAfDAh0cmFuc2ZlcgwU9WPqQLwoPU0OBcSOowWz8qBzQO9BYn1bUkVAEQwBAdswQZv2Z85B5j8YhDSIQFcAAXgmWgsQDBQAAAAAAAAAAAAAAAAAAAAAAAAAAAwUAAAAAAAAAAAAAAAAAAAAAAAAAAAUwB8MCHRyYW5zZmVyDBTPduKL0AYsSkeO41VhARMZ88+k0kFifVtSRUARDAEB2zBBm/ZnzkHmPxiEQFjYJh4LCxLASlnPDAtub1JlZW50cmFudAH/ABJNNBJgWDQuNTH+//9YNWEAAABAVwADekp4EVHQRUGb9mfOeRGIThBR0FASwEp4EFHQRUBXAQF4Ec54EM7BRVOLUEGSXegxcGgLlwwPQWxyZWFkeSBlbnRlcmVk4RF4Ec54EM7BRVOLUEHmPxiEQFcAAXgRzngQzsFFU4tQQS9Yxe1AVgIK6v///wqq////EsBhQAME3TQ=")); #endregion @@ -24,45 +24,184 @@ public abstract class Contract_Reentrancy(Neo.SmartContract.Testing.SmartContrac /// /// Unsafe method /// + /// + /// Script: VwEAO1wACxAMAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAUwB8MdHJhbnNmZXIM9WPqQLwoPU0OBcSOowWz8qBzQO9BYn1bUkU9FXARDAHbMEGb9mfOQeY/GIQ9AkA= + /// 00 : OpCode.INITSLOT 0100 + /// 03 : OpCode.TRY 5C00 + /// 06 : OpCode.PUSHNULL + /// 07 : OpCode.PUSH0 + /// 08 : OpCode.PUSHDATA1 0000000000000000000000000000000000000000 + /// 1E : OpCode.PUSHDATA1 0000000000000000000000000000000000000000 + /// 34 : OpCode.PUSH4 + /// 35 : OpCode.PACK + /// 36 : OpCode.PUSH15 + /// 37 : OpCode.PUSHDATA1 7472616E73666572 + /// 41 : OpCode.PUSHDATA1 F563EA40BC283D4D0E05C48EA305B3F2A07340EF + /// 57 : OpCode.SYSCALL 627D5B52 + /// 5C : OpCode.DROP + /// 5D : OpCode.ENDTRY 15 + /// 5F : OpCode.STLOC0 + /// 60 : OpCode.PUSH1 + /// 61 : OpCode.PUSHDATA1 01 + /// 64 : OpCode.CONVERT 30 + /// 66 : OpCode.SYSCALL 9BF667CE + /// 6B : OpCode.SYSCALL E63F1884 + /// 70 : OpCode.ENDTRY 02 + /// 72 : OpCode.RET + /// [DisplayName("hasReentrancy")] public abstract void HasReentrancy(); /// /// Unsafe method /// + /// + /// Script: CxAMAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAUwB8MdHJhbnNmZXIMz3bii9AGLEpHjuNVYQETGfPPpNJBYn1bUkU0A0A= + /// 00 : OpCode.PUSHNULL + /// 01 : OpCode.PUSH0 + /// 02 : OpCode.PUSHDATA1 0000000000000000000000000000000000000000 + /// 18 : OpCode.PUSHDATA1 0000000000000000000000000000000000000000 + /// 2E : OpCode.PUSH4 + /// 2F : OpCode.PACK + /// 30 : OpCode.PUSH15 + /// 31 : OpCode.PUSHDATA1 7472616E73666572 + /// 3B : OpCode.PUSHDATA1 CF76E28BD0062C4A478EE35561011319F3CFA4D2 + /// 51 : OpCode.SYSCALL 627D5B52 + /// 56 : OpCode.DROP + /// 57 : OpCode.CALL 03 + /// 59 : OpCode.RET + /// [DisplayName("hasReentrancyFromCall")] public abstract void HasReentrancyFromCall(); /// /// Unsafe method /// + /// + /// Script: CxAMAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAUwB8MdHJhbnNmZXIM9WPqQLwoPU0OBcSOowWz8qBzQO9BYn1bUkURDAHbMEGb9mfOQeY/GIRA + /// 00 : OpCode.PUSHNULL + /// 01 : OpCode.PUSH0 + /// 02 : OpCode.PUSHDATA1 0000000000000000000000000000000000000000 + /// 18 : OpCode.PUSHDATA1 0000000000000000000000000000000000000000 + /// 2E : OpCode.PUSH4 + /// 2F : OpCode.PACK + /// 30 : OpCode.PUSH15 + /// 31 : OpCode.PUSHDATA1 7472616E73666572 + /// 3B : OpCode.PUSHDATA1 F563EA40BC283D4D0E05C48EA305B3F2A07340EF + /// 51 : OpCode.SYSCALL 627D5B52 + /// 56 : OpCode.DROP + /// 57 : OpCode.PUSH1 + /// 58 : OpCode.PUSHDATA1 01 + /// 5B : OpCode.CONVERT 30 + /// 5D : OpCode.SYSCALL 9BF667CE + /// 62 : OpCode.SYSCALL E63F1884 + /// 67 : OpCode.RET + /// [DisplayName("hasReentrancyFromSingleBasicBlock")] public abstract void HasReentrancyFromSingleBasicBlock(); /// /// Unsafe method /// + /// + /// Script: EQwB2zBBm/ZnzkHmPxiECxAMAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAUwB8MdHJhbnNmZXIM9WPqQLwoPU0OBcSOowWz8qBzQO9BYn1bUkVA + /// 00 : OpCode.PUSH1 + /// 01 : OpCode.PUSHDATA1 01 + /// 04 : OpCode.CONVERT 30 + /// 06 : OpCode.SYSCALL 9BF667CE + /// 0B : OpCode.SYSCALL E63F1884 + /// 10 : OpCode.PUSHNULL + /// 11 : OpCode.PUSH0 + /// 12 : OpCode.PUSHDATA1 0000000000000000000000000000000000000000 + /// 28 : OpCode.PUSHDATA1 0000000000000000000000000000000000000000 + /// 3E : OpCode.PUSH4 + /// 3F : OpCode.PACK + /// 40 : OpCode.PUSH15 + /// 41 : OpCode.PUSHDATA1 7472616E73666572 + /// 4B : OpCode.PUSHDATA1 F563EA40BC283D4D0E05C48EA305B3F2A07340EF + /// 61 : OpCode.SYSCALL 627D5B52 + /// 66 : OpCode.DROP + /// 67 : OpCode.RET + /// [DisplayName("noReentrancy")] public abstract void NoReentrancy(); /// /// Unsafe method /// + /// + /// Script: WNgmHgsLEsBKWc8Mbm9SZWVudHJhbnQB/wASTTQSYFg0LjUx/v//WDVhAAAAQA== + /// 00 : OpCode.LDSFLD0 + /// 01 : OpCode.ISNULL + /// 02 : OpCode.JMPIFNOT 1E + /// 04 : OpCode.PUSHNULL + /// 05 : OpCode.PUSHNULL + /// 06 : OpCode.PUSH2 + /// 07 : OpCode.PACK + /// 08 : OpCode.DUP + /// 09 : OpCode.LDSFLD1 + /// 0A : OpCode.APPEND + /// 0B : OpCode.PUSHDATA1 6E6F5265656E7472616E74 + /// 18 : OpCode.PUSHINT16 FF00 + /// 1B : OpCode.PUSH2 + /// 1C : OpCode.PICK + /// 1D : OpCode.CALL 12 + /// 1F : OpCode.STSFLD0 + /// 20 : OpCode.LDSFLD0 + /// 21 : OpCode.CALL 2E + /// 23 : OpCode.CALL_L 31FEFFFF + /// 28 : OpCode.LDSFLD0 + /// 29 : OpCode.CALL_L 61000000 + /// 2E : OpCode.RET + /// [DisplayName("noReentrancyByAttribute")] public abstract void NoReentrancyByAttribute(); /// /// Unsafe method /// + /// + /// Script: EQwB2zBBm/ZnzkHmPxiENIhA + /// 00 : OpCode.PUSH1 + /// 01 : OpCode.PUSHDATA1 01 + /// 04 : OpCode.CONVERT 30 + /// 06 : OpCode.SYSCALL 9BF667CE + /// 0B : OpCode.SYSCALL E63F1884 + /// 10 : OpCode.CALL 88 + /// 12 : OpCode.RET + /// [DisplayName("noReentrancyFromCall")] public abstract void NoReentrancyFromCall(); /// /// Unsafe method /// + /// + /// Script: VwABeCZaCxAMAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAUwB8MdHJhbnNmZXIMz3bii9AGLEpHjuNVYQETGfPPpNJBYn1bUkVAEQwB2zBBm/ZnzkHmPxiEQA== + /// 00 : OpCode.INITSLOT 0001 + /// 03 : OpCode.LDARG0 + /// 04 : OpCode.JMPIFNOT 5A + /// 06 : OpCode.PUSHNULL + /// 07 : OpCode.PUSH0 + /// 08 : OpCode.PUSHDATA1 0000000000000000000000000000000000000000 + /// 1E : OpCode.PUSHDATA1 0000000000000000000000000000000000000000 + /// 34 : OpCode.PUSH4 + /// 35 : OpCode.PACK + /// 36 : OpCode.PUSH15 + /// 37 : OpCode.PUSHDATA1 7472616E73666572 + /// 41 : OpCode.PUSHDATA1 CF76E28BD0062C4A478EE35561011319F3CFA4D2 + /// 57 : OpCode.SYSCALL 627D5B52 + /// 5C : OpCode.DROP + /// 5D : OpCode.RET + /// 5E : OpCode.PUSH1 + /// 5F : OpCode.PUSHDATA1 01 + /// 62 : OpCode.CONVERT 30 + /// 64 : OpCode.SYSCALL 9BF667CE + /// 69 : OpCode.SYSCALL E63F1884 + /// 6E : OpCode.RET + /// [DisplayName("noReentrancyFromJump")] public abstract void NoReentrancyFromJump(bool? input); #endregion - } diff --git a/tests/Neo.Compiler.CSharp.UnitTests/TestingArtifacts/Contract_StaticClass.cs b/tests/Neo.Compiler.CSharp.UnitTests/TestingArtifacts/Contract_StaticClass.cs index ffb11c452..b0d4456b6 100644 --- a/tests/Neo.Compiler.CSharp.UnitTests/TestingArtifacts/Contract_StaticClass.cs +++ b/tests/Neo.Compiler.CSharp.UnitTests/TestingArtifacts/Contract_StaticClass.cs @@ -15,7 +15,7 @@ public abstract class Contract_StaticClass(Neo.SmartContract.Testing.SmartContra /// /// Optimization: "All" /// - public static Neo.SmartContract.NefFile Nef => Neo.IO.Helper.AsSerializable(Convert.FromBase64String(@"TkVGM1Rlc3RpbmdFbmdpbmUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFVZNAZaNDlAVwABWBGeSgIAAACALgQiCkoC////fzIeA/////8AAAAAkUoC////fzIMAwAAAAABAAAAn2BAVwABWEBWAxFgwko0CWHCSjQEYkBXAAFAkpbMeA==")); + public static Neo.SmartContract.NefFile Nef => Neo.IO.Helper.AsSerializable(Convert.FromBase64String(@"TkVGM1Rlc3RpbmdFbmdpbmUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEtZNAZaNDlAVwABWBGeSgIAAACALgQiCkoC////fzIeA/////8AAAAAkUoC////fzIMAwAAAAABAAAAn2BAVwABWEBWAxFgwmHCYkBDH0c0")); #endregion diff --git a/tests/Neo.Compiler.CSharp.UnitTests/TestingArtifacts/Contract_Tuple.cs b/tests/Neo.Compiler.CSharp.UnitTests/TestingArtifacts/Contract_Tuple.cs index 38c198a70..6826ebb18 100644 --- a/tests/Neo.Compiler.CSharp.UnitTests/TestingArtifacts/Contract_Tuple.cs +++ b/tests/Neo.Compiler.CSharp.UnitTests/TestingArtifacts/Contract_Tuple.cs @@ -15,7 +15,7 @@ public abstract class Contract_Tuple(Neo.SmartContract.Testing.SmartContractInit /// /// Optimization: "All" /// - public static Neo.SmartContract.NefFile Nef => Neo.IO.Helper.AsSerializable(Convert.FromBase64String(@"TkVGM1Rlc3RpbmdFbmdpbmUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFrFShHPShLPShPPShTPQFcCAMVKC89KC89KEM9KEM9KC89KNDBwxUoLz0oQz0o0KUpoFFHQRRBxNMlKwUVoElHQaBTOEVHQRXFFaUpoE1HQRWhAVwABQFcAAUB+EaX0")); + public static Neo.SmartContract.NefFile Nef => Neo.IO.Helper.AsSerializable(Convert.FromBase64String(@"TkVGM1Rlc3RpbmdFbmdpbmUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEzFShHPShLPShPPShTPQFcCAMVKC89KC89KEM9KEM9KC89wxUoLz0oQz0poFFHQRRBxNM9KwUVoElHQaBTOEVHQRXFFaUpoE1HQRWhAW5sP4w==")); #endregion @@ -48,7 +48,7 @@ public abstract class Contract_Tuple(Neo.SmartContract.Testing.SmartContractInit /// Unsafe method /// /// - /// Script: VwIAxUoLz0oLz0oQz0oQz0oLz0o0MHDFSgvPShDPSjQpSmgUUdBFEHE0yUrBRWgSUdBoFM4RUdBFcUVpSmgTUdBFaEA= + /// Script: VwIAxUoLz0oLz0oQz0oQz0oLz3DFSgvPShDPSmgUUdBFEHE0z0rBRWgSUdBoFM4RUdBFcUVpSmgTUdBFaEA= /// 00 : OpCode.INITSLOT 0200 /// 03 : OpCode.NEWSTRUCT0 /// 04 : OpCode.DUP @@ -66,52 +66,48 @@ public abstract class Contract_Tuple(Neo.SmartContract.Testing.SmartContractInit /// 10 : OpCode.DUP /// 11 : OpCode.PUSHNULL /// 12 : OpCode.APPEND - /// 13 : OpCode.DUP - /// 14 : OpCode.CALL 30 - /// 16 : OpCode.STLOC0 - /// 17 : OpCode.NEWSTRUCT0 + /// 13 : OpCode.STLOC0 + /// 14 : OpCode.NEWSTRUCT0 + /// 15 : OpCode.DUP + /// 16 : OpCode.PUSHNULL + /// 17 : OpCode.APPEND /// 18 : OpCode.DUP - /// 19 : OpCode.PUSHNULL + /// 19 : OpCode.PUSH0 /// 1A : OpCode.APPEND /// 1B : OpCode.DUP - /// 1C : OpCode.PUSH0 - /// 1D : OpCode.APPEND - /// 1E : OpCode.DUP - /// 1F : OpCode.CALL 29 - /// 21 : OpCode.DUP - /// 22 : OpCode.LDLOC0 - /// 23 : OpCode.PUSH4 - /// 24 : OpCode.ROT - /// 25 : OpCode.SETITEM - /// 26 : OpCode.DROP - /// 27 : OpCode.PUSH0 - /// 28 : OpCode.STLOC1 - /// 29 : OpCode.CALL C9 - /// 2B : OpCode.DUP - /// 2C : OpCode.UNPACK - /// 2D : OpCode.DROP - /// 2E : OpCode.LDLOC0 - /// 2F : OpCode.PUSH2 + /// 1C : OpCode.LDLOC0 + /// 1D : OpCode.PUSH4 + /// 1E : OpCode.ROT + /// 1F : OpCode.SETITEM + /// 20 : OpCode.DROP + /// 21 : OpCode.PUSH0 + /// 22 : OpCode.STLOC1 + /// 23 : OpCode.CALL CF + /// 25 : OpCode.DUP + /// 26 : OpCode.UNPACK + /// 27 : OpCode.DROP + /// 28 : OpCode.LDLOC0 + /// 29 : OpCode.PUSH2 + /// 2A : OpCode.ROT + /// 2B : OpCode.SETITEM + /// 2C : OpCode.LDLOC0 + /// 2D : OpCode.PUSH4 + /// 2E : OpCode.PICKITEM + /// 2F : OpCode.PUSH1 /// 30 : OpCode.ROT /// 31 : OpCode.SETITEM - /// 32 : OpCode.LDLOC0 - /// 33 : OpCode.PUSH4 - /// 34 : OpCode.PICKITEM - /// 35 : OpCode.PUSH1 - /// 36 : OpCode.ROT - /// 37 : OpCode.SETITEM - /// 38 : OpCode.DROP - /// 39 : OpCode.STLOC1 - /// 3A : OpCode.DROP - /// 3B : OpCode.LDLOC1 - /// 3C : OpCode.DUP - /// 3D : OpCode.LDLOC0 - /// 3E : OpCode.PUSH3 - /// 3F : OpCode.ROT - /// 40 : OpCode.SETITEM - /// 41 : OpCode.DROP - /// 42 : OpCode.LDLOC0 - /// 43 : OpCode.RET + /// 32 : OpCode.DROP + /// 33 : OpCode.STLOC1 + /// 34 : OpCode.DROP + /// 35 : OpCode.LDLOC1 + /// 36 : OpCode.DUP + /// 37 : OpCode.LDLOC0 + /// 38 : OpCode.PUSH3 + /// 39 : OpCode.ROT + /// 3A : OpCode.SETITEM + /// 3B : OpCode.DROP + /// 3C : OpCode.LDLOC0 + /// 3D : OpCode.RET /// [DisplayName("t1")] public abstract object? T1(); diff --git a/tests/Neo.Compiler.CSharp.UnitTests/TestingArtifacts/Contract_Types.cs b/tests/Neo.Compiler.CSharp.UnitTests/TestingArtifacts/Contract_Types.cs index 1ded8f8b3..09c45b2e6 100644 --- a/tests/Neo.Compiler.CSharp.UnitTests/TestingArtifacts/Contract_Types.cs +++ b/tests/Neo.Compiler.CSharp.UnitTests/TestingArtifacts/Contract_Types.cs @@ -10,12 +10,12 @@ public abstract class Contract_Types(Neo.SmartContract.Testing.SmartContractInit { #region Compiled data - public static Neo.SmartContract.Manifest.ContractManifest Manifest => Neo.SmartContract.Manifest.ContractManifest.Parse(@"{""name"":""Contract_Types"",""groups"":[],""features"":{},""supportedstandards"":[],""abi"":{""methods"":[{""name"":""checkBoolString"",""parameters"":[{""name"":""value"",""type"":""Boolean""}],""returntype"":""String"",""offset"":0,""safe"":false},{""name"":""checkNull"",""parameters"":[],""returntype"":""Any"",""offset"":21,""safe"":false},{""name"":""checkBoolTrue"",""parameters"":[],""returntype"":""Boolean"",""offset"":23,""safe"":false},{""name"":""checkBoolFalse"",""parameters"":[],""returntype"":""Boolean"",""offset"":25,""safe"":false},{""name"":""checkSbyte"",""parameters"":[],""returntype"":""Integer"",""offset"":27,""safe"":false},{""name"":""checkByte"",""parameters"":[],""returntype"":""Integer"",""offset"":29,""safe"":false},{""name"":""checkShort"",""parameters"":[],""returntype"":""Integer"",""offset"":31,""safe"":false},{""name"":""checkUshort"",""parameters"":[],""returntype"":""Integer"",""offset"":33,""safe"":false},{""name"":""checkInt"",""parameters"":[],""returntype"":""Integer"",""offset"":35,""safe"":false},{""name"":""checkUint"",""parameters"":[],""returntype"":""Integer"",""offset"":37,""safe"":false},{""name"":""checkLong"",""parameters"":[],""returntype"":""Integer"",""offset"":39,""safe"":false},{""name"":""checkUlong"",""parameters"":[],""returntype"":""Integer"",""offset"":41,""safe"":false},{""name"":""checkChar"",""parameters"":[],""returntype"":""Integer"",""offset"":43,""safe"":false},{""name"":""checkString"",""parameters"":[],""returntype"":""String"",""offset"":46,""safe"":false},{""name"":""checkStringIndex"",""parameters"":[{""name"":""input"",""type"":""String""},{""name"":""index"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":52,""safe"":false},{""name"":""checkArrayObj"",""parameters"":[],""returntype"":""Array"",""offset"":59,""safe"":false},{""name"":""checkBigInteger"",""parameters"":[],""returntype"":""Integer"",""offset"":67,""safe"":false},{""name"":""checkByteArray"",""parameters"":[],""returntype"":""ByteArray"",""offset"":69,""safe"":false},{""name"":""checkEnum"",""parameters"":[],""returntype"":""Any"",""offset"":77,""safe"":false},{""name"":""checkEnumArg"",""parameters"":[{""name"":""arg"",""type"":""Integer""}],""returntype"":""Void"",""offset"":79,""safe"":false},{""name"":""checkNameof"",""parameters"":[],""returntype"":""String"",""offset"":83,""safe"":false},{""name"":""checkDelegate"",""parameters"":[],""returntype"":""Any"",""offset"":95,""safe"":false},{""name"":""checkLambda"",""parameters"":[],""returntype"":""Any"",""offset"":101,""safe"":false},{""name"":""checkEvent"",""parameters"":[],""returntype"":""Void"",""offset"":107,""safe"":false},{""name"":""checkClass"",""parameters"":[],""returntype"":""Any"",""offset"":133,""safe"":false},{""name"":""checkStruct"",""parameters"":[],""returntype"":""Any"",""offset"":164,""safe"":false},{""name"":""checkTuple"",""parameters"":[],""returntype"":""Array"",""offset"":192,""safe"":false},{""name"":""checkTuple2"",""parameters"":[],""returntype"":""Array"",""offset"":218,""safe"":false},{""name"":""concatByteString"",""parameters"":[{""name"":""a"",""type"":""ByteArray""},{""name"":""b"",""type"":""ByteArray""}],""returntype"":""String"",""offset"":249,""safe"":false},{""name"":""toAddress"",""parameters"":[{""name"":""address"",""type"":""Hash160""},{""name"":""version"",""type"":""Integer""}],""returntype"":""String"",""offset"":266,""safe"":false},{""name"":""call"",""parameters"":[{""name"":""scriptHash"",""type"":""Hash160""},{""name"":""method"",""type"":""String""},{""name"":""flag"",""type"":""Integer""},{""name"":""args"",""type"":""Array""}],""returntype"":""Any"",""offset"":295,""safe"":false},{""name"":""create"",""parameters"":[{""name"":""nef"",""type"":""ByteArray""},{""name"":""manifest"",""type"":""String""}],""returntype"":""Any"",""offset"":308,""safe"":false}],""events"":[{""name"":""DummyEvent"",""parameters"":[{""name"":""msg"",""type"":""String""}]}]},""permissions"":[{""contract"":""*"",""methods"":""*""}],""trusts"":[],""extra"":{""nef"":{""optimization"":""All""}}}"); + public static Neo.SmartContract.Manifest.ContractManifest Manifest => Neo.SmartContract.Manifest.ContractManifest.Parse(@"{""name"":""Contract_Types"",""groups"":[],""features"":{},""supportedstandards"":[],""abi"":{""methods"":[{""name"":""checkBoolString"",""parameters"":[{""name"":""value"",""type"":""Boolean""}],""returntype"":""String"",""offset"":0,""safe"":false},{""name"":""checkNull"",""parameters"":[],""returntype"":""Any"",""offset"":21,""safe"":false},{""name"":""checkBoolTrue"",""parameters"":[],""returntype"":""Boolean"",""offset"":23,""safe"":false},{""name"":""checkBoolFalse"",""parameters"":[],""returntype"":""Boolean"",""offset"":25,""safe"":false},{""name"":""checkSbyte"",""parameters"":[],""returntype"":""Integer"",""offset"":27,""safe"":false},{""name"":""checkByte"",""parameters"":[],""returntype"":""Integer"",""offset"":29,""safe"":false},{""name"":""checkShort"",""parameters"":[],""returntype"":""Integer"",""offset"":31,""safe"":false},{""name"":""checkUshort"",""parameters"":[],""returntype"":""Integer"",""offset"":33,""safe"":false},{""name"":""checkInt"",""parameters"":[],""returntype"":""Integer"",""offset"":35,""safe"":false},{""name"":""checkUint"",""parameters"":[],""returntype"":""Integer"",""offset"":37,""safe"":false},{""name"":""checkLong"",""parameters"":[],""returntype"":""Integer"",""offset"":39,""safe"":false},{""name"":""checkUlong"",""parameters"":[],""returntype"":""Integer"",""offset"":41,""safe"":false},{""name"":""checkChar"",""parameters"":[],""returntype"":""Integer"",""offset"":43,""safe"":false},{""name"":""checkString"",""parameters"":[],""returntype"":""String"",""offset"":46,""safe"":false},{""name"":""checkStringIndex"",""parameters"":[{""name"":""input"",""type"":""String""},{""name"":""index"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":52,""safe"":false},{""name"":""checkArrayObj"",""parameters"":[],""returntype"":""Array"",""offset"":59,""safe"":false},{""name"":""checkBigInteger"",""parameters"":[],""returntype"":""Integer"",""offset"":67,""safe"":false},{""name"":""checkByteArray"",""parameters"":[],""returntype"":""ByteArray"",""offset"":69,""safe"":false},{""name"":""checkEnum"",""parameters"":[],""returntype"":""Any"",""offset"":77,""safe"":false},{""name"":""checkEnumArg"",""parameters"":[{""name"":""arg"",""type"":""Integer""}],""returntype"":""Void"",""offset"":79,""safe"":false},{""name"":""checkNameof"",""parameters"":[],""returntype"":""String"",""offset"":83,""safe"":false},{""name"":""checkDelegate"",""parameters"":[],""returntype"":""Any"",""offset"":95,""safe"":false},{""name"":""checkLambda"",""parameters"":[],""returntype"":""Any"",""offset"":101,""safe"":false},{""name"":""checkEvent"",""parameters"":[],""returntype"":""Void"",""offset"":107,""safe"":false},{""name"":""checkClass"",""parameters"":[],""returntype"":""Any"",""offset"":133,""safe"":false},{""name"":""checkStruct"",""parameters"":[],""returntype"":""Any"",""offset"":164,""safe"":false},{""name"":""checkTuple"",""parameters"":[],""returntype"":""Array"",""offset"":185,""safe"":false},{""name"":""checkTuple2"",""parameters"":[],""returntype"":""Array"",""offset"":211,""safe"":false},{""name"":""concatByteString"",""parameters"":[{""name"":""a"",""type"":""ByteArray""},{""name"":""b"",""type"":""ByteArray""}],""returntype"":""String"",""offset"":242,""safe"":false},{""name"":""toAddress"",""parameters"":[{""name"":""address"",""type"":""Hash160""},{""name"":""version"",""type"":""Integer""}],""returntype"":""String"",""offset"":259,""safe"":false},{""name"":""call"",""parameters"":[{""name"":""scriptHash"",""type"":""Hash160""},{""name"":""method"",""type"":""String""},{""name"":""flag"",""type"":""Integer""},{""name"":""args"",""type"":""Array""}],""returntype"":""Any"",""offset"":288,""safe"":false},{""name"":""create"",""parameters"":[{""name"":""nef"",""type"":""ByteArray""},{""name"":""manifest"",""type"":""String""}],""returntype"":""Any"",""offset"":301,""safe"":false}],""events"":[{""name"":""DummyEvent"",""parameters"":[{""name"":""msg"",""type"":""String""}]}]},""permissions"":[{""contract"":""*"",""methods"":""*""}],""trusts"":[],""extra"":{""nef"":{""optimization"":""All""}}}"); /// /// Optimization: "All" /// - public static Neo.SmartContract.NefFile Nef => Neo.IO.Helper.AsSerializable(Convert.FromBase64String(@"TkVGM1Rlc3RpbmdFbmdpbmUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAALA7znO4OTpJcbCoGp54UQN2G/OrBFiYXNlNThDaGVja0VuY29kZQEAAQ/9o/pDRupTKiWPxJfdrdtkN8n9/wZkZXBsb3kDAAEPAAD9QAFXAAF4JAoMBUZhbHNlQAwEVHJ1ZUALQAhACUAVQBVAFUAVQBVAFUAVQBVAAG5ADANuZW9AVwACeHnOQAwDbmVvEcBAFUAMAwECA9swQBVAVwABQAwJY2hlY2tOdWxsQAoAAAAAQAoAAAAAQMJKDANuZW/PDApEdW1teUV2ZW50QZUBb2FAVwEACxHASjQQcAwDbmVvSmgQUdBFaEBXAAF4EAvQQFcBAMVKC89KNBBwDANuZW9KaBBR0EVoQFcAAUDFSgwDbmVvz0oMDXNtYXJ0IGVjb25vbXnPQFcBAMVKDANuZW/PSgwNc21hcnQgZWNvbm9tec9waEBXAAJ4eYvbKHh5i9soi9soQFcAAnl4NANAVwECEYhKEHnQcGh4i3Bo2yg3AABAVwAEe3p5eEFifVtSQFcAAgt5eNsoNwEAQJCxBjg=")); + public static Neo.SmartContract.NefFile Nef => Neo.IO.Helper.AsSerializable(Convert.FromBase64String(@"TkVGM1Rlc3RpbmdFbmdpbmUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAALA7znO4OTpJcbCoGp54UQN2G/OrBFiYXNlNThDaGVja0VuY29kZQEAAQ/9o/pDRupTKiWPxJfdrdtkN8n9/wZkZXBsb3kDAAEPAAD9OQFXAAF4JAoMBUZhbHNlQAwEVHJ1ZUALQAhACUAVQBVAFUAVQBVAFUAVQBVAAG5ADANuZW9AVwACeHnOQAwDbmVvEcBAFUAMAwECA9swQBVAVwABQAwJY2hlY2tOdWxsQAoAAAAAQAoAAAAAQMJKDANuZW/PDApEdW1teUV2ZW50QZUBb2FAVwEACxHASjQQcAwDbmVvSmgQUdBFaEBXAAF4EAvQQFcBAMVKC89wDANuZW9KaBBR0EVoQMVKDANuZW/PSgwNc21hcnQgZWNvbm9tec9AVwEAxUoMA25lb89KDA1zbWFydCBlY29ub215z3BoQFcAAnh5i9soeHmL2yiL2yhAVwACeXg0A0BXAQIRiEoQedBwaHiLcGjbKDcAAEBXAAR7enl4QWJ9W1JAVwACC3l42yg3AQBAOi+aRA==")); #endregion diff --git a/tests/Neo.Compiler.CSharp.UnitTests/UnitTest_ClassInit.cs b/tests/Neo.Compiler.CSharp.UnitTests/UnitTest_ClassInit.cs index 3be4cc3dc..09067d754 100644 --- a/tests/Neo.Compiler.CSharp.UnitTests/UnitTest_ClassInit.cs +++ b/tests/Neo.Compiler.CSharp.UnitTests/UnitTest_ClassInit.cs @@ -20,7 +20,7 @@ public void Test_InitInt() using var fee = Engine.CreateGasWatcher(); var result = Contract.TestInitInt(); - Assert.AreEqual(1493550, fee.Value); + AssertGasConsumed(1493550); Assert.IsNotNull(result); Assert.AreEqual(cs.A, (BigInteger)result[0]); diff --git a/tests/Neo.SmartContract.Framework.UnitTests/DebugAndTestBase.cs b/tests/Neo.SmartContract.Framework.UnitTests/DebugAndTestBase.cs index 11b4d4eef..09776ede8 100644 --- a/tests/Neo.SmartContract.Framework.UnitTests/DebugAndTestBase.cs +++ b/tests/Neo.SmartContract.Framework.UnitTests/DebugAndTestBase.cs @@ -8,7 +8,8 @@ public class DebugAndTestBase : TestBase where T : SmartContract.Testing.SmartContract, IContractInfo { - internal bool TestGasConsume { set; get; } = true; + // allowing specific derived class to enable/disable Gas test + protected virtual bool TestGasConsume { set; get; } = false; static DebugAndTestBase() { diff --git a/tests/Neo.SmartContract.Framework.UnitTests/TestingArtifacts/Contract_Attribute.cs b/tests/Neo.SmartContract.Framework.UnitTests/TestingArtifacts/Contract_Attribute.cs index 5486d0d9c..ba7c7bf03 100644 --- a/tests/Neo.SmartContract.Framework.UnitTests/TestingArtifacts/Contract_Attribute.cs +++ b/tests/Neo.SmartContract.Framework.UnitTests/TestingArtifacts/Contract_Attribute.cs @@ -10,12 +10,12 @@ public abstract class Contract_Attribute(Neo.SmartContract.Testing.SmartContract { #region Compiled data - public static Neo.SmartContract.Manifest.ContractManifest Manifest => Neo.SmartContract.Manifest.ContractManifest.Parse(@"{""name"":""Contract_Attribute"",""groups"":[],""features"":{},""supportedstandards"":[],""abi"":{""methods"":[{""name"":""test"",""parameters"":[],""returntype"":""Boolean"",""offset"":0,""safe"":false},{""name"":""reentrantB"",""parameters"":[],""returntype"":""Void"",""offset"":113,""safe"":false},{""name"":""reentrantA"",""parameters"":[],""returntype"":""Void"",""offset"":269,""safe"":false},{""name"":""reentrantTest"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Void"",""offset"":319,""safe"":false},{""name"":""_initialize"",""parameters"":[],""returntype"":""Void"",""offset"":496,""safe"":false}],""events"":[]},""permissions"":[{""contract"":""0xacce6fd80d44e1796aa0c2c625e9e4e0ce39efc0"",""methods"":[""base64Decode""]}],""trusts"":[],""extra"":{""nef"":{""optimization"":""All""}}}"); + public static Neo.SmartContract.Manifest.ContractManifest Manifest => Neo.SmartContract.Manifest.ContractManifest.Parse(@"{""name"":""Contract_Attribute"",""groups"":[],""features"":{},""supportedstandards"":[],""abi"":{""methods"":[{""name"":""test"",""parameters"":[],""returntype"":""Boolean"",""offset"":0,""safe"":false},{""name"":""reentrantB"",""parameters"":[],""returntype"":""Void"",""offset"":106,""safe"":false},{""name"":""reentrantA"",""parameters"":[],""returntype"":""Void"",""offset"":259,""safe"":false},{""name"":""reentrantTest"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Void"",""offset"":309,""safe"":false},{""name"":""_initialize"",""parameters"":[],""returntype"":""Void"",""offset"":480,""safe"":false}],""events"":[]},""permissions"":[{""contract"":""0xacce6fd80d44e1796aa0c2c625e9e4e0ce39efc0"",""methods"":[""base64Decode""]}],""trusts"":[],""extra"":{""nef"":{""optimization"":""All""}}}"); /// /// Optimization: "All" /// - public static Neo.SmartContract.NefFile Nef => Neo.IO.Helper.AsSerializable(Convert.FromBase64String(@"TkVGM1Rlc3RpbmdFbmdpbmUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHA7znO4OTpJcbCoGp54UQN2G/OrAxiYXNlNjREZWNvZGUBAAEPAAD9GgJY2CYrCxHASlnPDBxBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUE9EU00CGBYNCgIQFcAAng0HHk3AADbMNsoStgkCUrKABQoAzpKeBBR0EVAVwABQFcAAXgQzkH4J+yMqiYODAlleGNlcHRpb246QFrYJh4LCxLASlvPDAtub1JlZW50cmFudAH/ABJNNA1iWjQsWjVkAAAAQFcAA3g0s3pKeBFR0EVBm/ZnznkRiE4QUdBQEsBKeBBR0EVAVwEBeBHOeBDOwUVTi1BBkl3oMXBoC5cMD0FscmVhZHkgZW50ZXJlZOEReBHOeBDOwUVTi1BB5j8YhEBXAAF4Ec54EM7BRVOLUEEvWMXtQFzYJiELCxLASlvPDAtub1JlZW50cmFudAH/ABJNNXH///9kXDWN////NTv///9cNL1AVwABXdgmIAsLEsBKXs8MDXJlZW50cmFudFRlc3QB/wASTTQaZV00PHgQlyYEIgt4AHuXJgUQNMpdNGRAVwADeDXT/v//ekp4EVHQRUGb9mfOeRGIThBR0FASwEp4EFHQRUBXAQF4Ec54EM7BRVOLUEGSXegxcGgLlwwPQWxyZWFkeSBlbnRlcmVk4RF4Ec54EM7BRVOLUEHmPxiEQFcAAXgRzngQzsFFU4tQQS9Yxe1AVgcKAAAAAApf/v//EsBhCvr+//8Kuv7//xLAYwrQ////CpD///8SwGZAAKqtGw==")); + public static Neo.SmartContract.NefFile Nef => Neo.IO.Helper.AsSerializable(Convert.FromBase64String(@"TkVGM1Rlc3RpbmdFbmdpbmUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHA7znO4OTpJcbCoGp54UQN2G/OrAxiYXNlNjREZWNvZGUBAAEPAAD9CgJY2CYrCxHASlnPDBxBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUE9EU00CGBYNCEIQFcAAnk3AADbMNsoStgkCUrKABQoAzpKeBBR0EVAVwABeBDOQfgn7IyqJg4MCWV4Y2VwdGlvbjpAWtgmHgsLEsBKW88MC25vUmVlbnRyYW50Af8AEk00DWJaNClaNWEAAABAVwADekp4EVHQRUGb9mfOeRGIThBR0FASwEp4EFHQRUBXAQF4Ec54EM7BRVOLUEGSXegxcGgLlwwPQWxyZWFkeSBlbnRlcmVk4RF4Ec54EM7BRVOLUEHmPxiEQFcAAXgRzngQzsFFU4tQQS9Yxe1AXNgmIQsLEsBKW88MC25vUmVlbnRyYW50Af8AEk01dP///2RcNY3///81Pv///1w0vUBXAAFd2CYgCwsSwEpezwwNcmVlbnRyYW50VGVzdAH/ABJNNBplXTQ2eBCXJgQiC3gAe5cmBRA0yl00XkBXAAN6SngRUdBFQZv2Z855EYhOEFHQUBLASngQUdBFQFcBAXgRzngQzsFFU4tQQZJd6DFwaAuXDA9BbHJlYWR5IGVudGVyZWThEXgRzngQzsFFU4tQQeY/GIRAVwABeBHOeBDOwUVTi1BBL1jF7UBWBwoAAAAACmj+//8SwGEKAP///wrA/v//EsBjCtD///8KkP///xLAZkCdFA1y")); #endregion @@ -46,5 +46,4 @@ public abstract class Contract_Attribute(Neo.SmartContract.Testing.SmartContract public abstract bool? Test(); #endregion - } diff --git a/tests/Neo.SmartContract.Framework.UnitTests/TestingArtifacts/Contract_ManifestAttribute.cs b/tests/Neo.SmartContract.Framework.UnitTests/TestingArtifacts/Contract_ManifestAttribute.cs index e47942a66..28646cf74 100644 --- a/tests/Neo.SmartContract.Framework.UnitTests/TestingArtifacts/Contract_ManifestAttribute.cs +++ b/tests/Neo.SmartContract.Framework.UnitTests/TestingArtifacts/Contract_ManifestAttribute.cs @@ -10,12 +10,12 @@ public abstract class Contract_ManifestAttribute(Neo.SmartContract.Testing.Smart { #region Compiled data - public static Neo.SmartContract.Manifest.ContractManifest Manifest => Neo.SmartContract.Manifest.ContractManifest.Parse(@"{""name"":""Contract_ManifestAttribute"",""groups"":[],""features"":{},""supportedstandards"":[],""abi"":{""methods"":[{""name"":""reentrantTest"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Void"",""offset"":0,""safe"":false},{""name"":""_initialize"",""parameters"":[],""returntype"":""Void"",""offset"":179,""safe"":false}],""events"":[]},""permissions"":[],""trusts"":[],""extra"":{""Author"":""core-dev"",""E-mail"":""dev@neo.org"",""Version"":""v3.6.3"",""Description"":""This is a test contract."",""ExtraKey"":""ExtraValue"",""nef"":{""optimization"":""All""}}}"); + public static Neo.SmartContract.Manifest.ContractManifest Manifest => Neo.SmartContract.Manifest.ContractManifest.Parse(@"{""name"":""Contract_ManifestAttribute"",""groups"":[],""features"":{},""supportedstandards"":[],""abi"":{""methods"":[{""name"":""reentrantTest"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Void"",""offset"":0,""safe"":false},{""name"":""_initialize"",""parameters"":[],""returntype"":""Void"",""offset"":172,""safe"":false}],""events"":[]},""permissions"":[],""trusts"":[],""extra"":{""Author"":""core-dev"",""E-mail"":""dev@neo.org"",""Version"":""v3.6.3"",""Description"":""This is a test contract."",""ExtraKey"":""ExtraValue"",""nef"":{""optimization"":""All""}}}"); /// /// Optimization: "All" /// - public static Neo.SmartContract.NefFile Nef => Neo.IO.Helper.AsSerializable(Convert.FromBase64String(@"TkVGM1Rlc3RpbmdFbmdpbmUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMNXAAFY2CYeCwsSwEpZzwwLbm9SZWVudHJhbnQB/wASTTQdYFg0QHgQlyYEIgt4AHuXJgUQNMxYNWgAAABAVwADeDQfekp4EVHQRUGb9mfOeRGIThBR0FASwEp4EFHQRUBXAAFAVwEBeBHOeBDOwUVTi1BBkl3oMXBoC5cMD0FscmVhZHkgZW50ZXJlZOEReBHOeBDOwUVTi1BB5j8YhEBXAAF4Ec54EM7BRVOLUEEvWMXtQFYCCur///8Kqv///xLAYUCnSflU")); + public static Neo.SmartContract.NefFile Nef => Neo.IO.Helper.AsSerializable(Convert.FromBase64String(@"TkVGM1Rlc3RpbmdFbmdpbmUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAALxXAAFY2CYeCwsSwEpZzwwLbm9SZWVudHJhbnQB/wASTTQdYFg0OXgQlyYEIgt4AHuXJgUQNMxYNWEAAABAVwADekp4EVHQRUGb9mfOeRGIThBR0FASwEp4EFHQRUBXAQF4Ec54EM7BRVOLUEGSXegxcGgLlwwPQWxyZWFkeSBlbnRlcmVk4RF4Ec54EM7BRVOLUEHmPxiEQFcAAXgRzngQzsFFU4tQQS9Yxe1AVgIK6v///wqq////EsBhQJprTnQ=")); #endregion @@ -28,5 +28,4 @@ public abstract class Contract_ManifestAttribute(Neo.SmartContract.Testing.Smart public abstract void ReentrantTest(BigInteger? value); #endregion - } diff --git a/tests/Neo.SmartContract.Framework.UnitTests/TestingArtifacts/Contract_Storage.cs b/tests/Neo.SmartContract.Framework.UnitTests/TestingArtifacts/Contract_Storage.cs index b7c437ca8..7b2fa81ed 100644 --- a/tests/Neo.SmartContract.Framework.UnitTests/TestingArtifacts/Contract_Storage.cs +++ b/tests/Neo.SmartContract.Framework.UnitTests/TestingArtifacts/Contract_Storage.cs @@ -10,12 +10,12 @@ public abstract class Contract_Storage(Neo.SmartContract.Testing.SmartContractIn { #region Compiled data - public static Neo.SmartContract.Manifest.ContractManifest Manifest => Neo.SmartContract.Manifest.ContractManifest.Parse(@"{""name"":""Contract_Storage"",""groups"":[],""features"":{},""supportedstandards"":[],""abi"":{""methods"":[{""name"":""testPutByte"",""parameters"":[{""name"":""key"",""type"":""ByteArray""},{""name"":""value"",""type"":""ByteArray""}],""returntype"":""Boolean"",""offset"":0,""safe"":false},{""name"":""testDeleteByte"",""parameters"":[{""name"":""key"",""type"":""ByteArray""}],""returntype"":""Void"",""offset"":39,""safe"":false},{""name"":""testGetByte"",""parameters"":[{""name"":""key"",""type"":""ByteArray""}],""returntype"":""ByteArray"",""offset"":74,""safe"":false},{""name"":""testOver16Bytes"",""parameters"":[],""returntype"":""ByteArray"",""offset"":115,""safe"":false},{""name"":""testPutString"",""parameters"":[{""name"":""key"",""type"":""ByteArray""},{""name"":""value"",""type"":""ByteArray""}],""returntype"":""Boolean"",""offset"":207,""safe"":false},{""name"":""testDeleteString"",""parameters"":[{""name"":""key"",""type"":""ByteArray""}],""returntype"":""Void"",""offset"":243,""safe"":false},{""name"":""testGetString"",""parameters"":[{""name"":""key"",""type"":""ByteArray""}],""returntype"":""ByteArray"",""offset"":275,""safe"":false},{""name"":""testPutByteArray"",""parameters"":[{""name"":""key"",""type"":""ByteArray""},{""name"":""value"",""type"":""ByteArray""}],""returntype"":""Boolean"",""offset"":313,""safe"":false},{""name"":""testDeleteByteArray"",""parameters"":[{""name"":""key"",""type"":""ByteArray""}],""returntype"":""Void"",""offset"":351,""safe"":false},{""name"":""testGetByteArray"",""parameters"":[{""name"":""key"",""type"":""ByteArray""}],""returntype"":""ByteArray"",""offset"":385,""safe"":false},{""name"":""testNewGetMethods"",""parameters"":[],""returntype"":""Boolean"",""offset"":430,""safe"":false},{""name"":""testNewGetByteArray"",""parameters"":[],""returntype"":""ByteArray"",""offset"":910,""safe"":false},{""name"":""testPutReadOnly"",""parameters"":[{""name"":""key"",""type"":""ByteArray""},{""name"":""value"",""type"":""ByteArray""}],""returntype"":""Boolean"",""offset"":988,""safe"":false},{""name"":""serializeTest"",""parameters"":[{""name"":""key"",""type"":""ByteArray""},{""name"":""value"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":1033,""safe"":false},{""name"":""testFind"",""parameters"":[],""returntype"":""ByteArray"",""offset"":1133,""safe"":false},{""name"":""testIndexPut"",""parameters"":[{""name"":""key"",""type"":""ByteArray""},{""name"":""value"",""type"":""ByteArray""}],""returntype"":""Boolean"",""offset"":1207,""safe"":false},{""name"":""testIndexGet"",""parameters"":[{""name"":""key"",""type"":""ByteArray""}],""returntype"":""ByteArray"",""offset"":1245,""safe"":false}],""events"":[]},""permissions"":[{""contract"":""0xacce6fd80d44e1796aa0c2c625e9e4e0ce39efc0"",""methods"":[""deserialize"",""serialize""]}],""trusts"":[],""extra"":{""nef"":{""optimization"":""All""}}}"); + public static Neo.SmartContract.Manifest.ContractManifest Manifest => Neo.SmartContract.Manifest.ContractManifest.Parse(@"{""name"":""Contract_Storage"",""groups"":[],""features"":{},""supportedstandards"":[],""abi"":{""methods"":[{""name"":""testPutByte"",""parameters"":[{""name"":""key"",""type"":""ByteArray""},{""name"":""value"",""type"":""ByteArray""}],""returntype"":""Boolean"",""offset"":0,""safe"":false},{""name"":""testDeleteByte"",""parameters"":[{""name"":""key"",""type"":""ByteArray""}],""returntype"":""Void"",""offset"":39,""safe"":false},{""name"":""testGetByte"",""parameters"":[{""name"":""key"",""type"":""ByteArray""}],""returntype"":""ByteArray"",""offset"":74,""safe"":false},{""name"":""testOver16Bytes"",""parameters"":[],""returntype"":""ByteArray"",""offset"":115,""safe"":false},{""name"":""testPutString"",""parameters"":[{""name"":""key"",""type"":""ByteArray""},{""name"":""value"",""type"":""ByteArray""}],""returntype"":""Boolean"",""offset"":207,""safe"":false},{""name"":""testDeleteString"",""parameters"":[{""name"":""key"",""type"":""ByteArray""}],""returntype"":""Void"",""offset"":243,""safe"":false},{""name"":""testGetString"",""parameters"":[{""name"":""key"",""type"":""ByteArray""}],""returntype"":""ByteArray"",""offset"":275,""safe"":false},{""name"":""testPutByteArray"",""parameters"":[{""name"":""key"",""type"":""ByteArray""},{""name"":""value"",""type"":""ByteArray""}],""returntype"":""Boolean"",""offset"":313,""safe"":false},{""name"":""testDeleteByteArray"",""parameters"":[{""name"":""key"",""type"":""ByteArray""}],""returntype"":""Void"",""offset"":351,""safe"":false},{""name"":""testGetByteArray"",""parameters"":[{""name"":""key"",""type"":""ByteArray""}],""returntype"":""ByteArray"",""offset"":385,""safe"":false},{""name"":""testNewGetMethods"",""parameters"":[],""returntype"":""Boolean"",""offset"":430,""safe"":false},{""name"":""testNewGetByteArray"",""parameters"":[],""returntype"":""ByteArray"",""offset"":910,""safe"":false},{""name"":""testPutReadOnly"",""parameters"":[{""name"":""key"",""type"":""ByteArray""},{""name"":""value"",""type"":""ByteArray""}],""returntype"":""Boolean"",""offset"":988,""safe"":false},{""name"":""serializeTest"",""parameters"":[{""name"":""key"",""type"":""ByteArray""},{""name"":""value"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":1033,""safe"":false},{""name"":""testFind"",""parameters"":[],""returntype"":""ByteArray"",""offset"":1126,""safe"":false},{""name"":""testIndexPut"",""parameters"":[{""name"":""key"",""type"":""ByteArray""},{""name"":""value"",""type"":""ByteArray""}],""returntype"":""Boolean"",""offset"":1200,""safe"":false},{""name"":""testIndexGet"",""parameters"":[{""name"":""key"",""type"":""ByteArray""}],""returntype"":""ByteArray"",""offset"":1238,""safe"":false}],""events"":[]},""permissions"":[{""contract"":""0xacce6fd80d44e1796aa0c2c625e9e4e0ce39efc0"",""methods"":[""deserialize"",""serialize""]}],""trusts"":[],""extra"":{""nef"":{""optimization"":""All""}}}"); /// /// Optimization: "All" /// - public static Neo.SmartContract.NefFile Nef => Neo.IO.Helper.AsSerializable(Convert.FromBase64String(@"TkVGM1Rlc3RpbmdFbmdpbmUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAALA7znO4OTpJcbCoGp54UQN2G/OrAlzZXJpYWxpemUBAAEPwO85zuDk6SXGwqBqeeFEDdhvzqwLZ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BAlAbwhvDpdAVwUADAIA/9swcEGb9mfOcWhpEsByDAIAAdswc2sMCWJ5dGVBcnJheWrBRVOLUEHmPxiEDAlieXRlQXJyYXlqwUVTi1BBkl3oMdswdGxAVwMCDAIA/9swcEGb9mfOQXZMv+lxaGkSwHJ52yh42yhqwUVTi1BB5j8YhAhAVwQCDAIBqtswcEGb9mfOcWhpEsByEBHAShB50HNreGo0C3hqNBtzaxDOQFcAA3o3AAB5eMFFU4tQQeY/GIRAVwICeXjBRVOLUEGSXegxcGhxaQuXJgQLQGg3AQBAVwIAQZv2Z85wDAEB2zDbKAwEa2V5MWhB5j8YhAwBAtsw2ygMBGtleTJoQeY/GIQUDANrZXloQd8wuJpxaUGcCO2cRWlB81S/HUBXAgIMAmlpcGhBm/ZnzhLAcXnbKEp42yhpwUVTi1BB5j8YhEUIQFcEAQwCaWlwQfa0a+JxaGkSwHJ42yhqwUVTi1BBkl3oMXNr2zBAmqR3OQ==")); #endregion @@ -25,7 +25,7 @@ public abstract class Contract_Storage(Neo.SmartContract.Testing.SmartContractIn /// Unsafe method /// /// - /// Script: VwQCDAGq2zBwQZv2Z85xaGkSwHIQEcBKNBVKEHnQc2t4ajQPeGo0H3NrEM5A + /// Script: VwQCDAGq2zBwQZv2Z85xaGkSwHIQEcBKEHnQc2t4ajQLeGo0G3NrEM5A /// 00 : OpCode.INITSLOT 0402 /// 03 : OpCode.PUSHDATA1 01AA /// 07 : OpCode.CONVERT 30 @@ -41,24 +41,22 @@ public abstract class Contract_Storage(Neo.SmartContract.Testing.SmartContractIn /// 16 : OpCode.PUSH1 /// 17 : OpCode.PACK /// 18 : OpCode.DUP - /// 19 : OpCode.CALL 15 - /// 1B : OpCode.DUP - /// 1C : OpCode.PUSH0 - /// 1D : OpCode.LDARG1 - /// 1E : OpCode.SETITEM - /// 1F : OpCode.STLOC3 - /// 20 : OpCode.LDLOC3 - /// 21 : OpCode.LDARG0 - /// 22 : OpCode.LDLOC2 - /// 23 : OpCode.CALL 0F - /// 25 : OpCode.LDARG0 - /// 26 : OpCode.LDLOC2 - /// 27 : OpCode.CALL 1F - /// 29 : OpCode.STLOC3 - /// 2A : OpCode.LDLOC3 - /// 2B : OpCode.PUSH0 - /// 2C : OpCode.PICKITEM - /// 2D : OpCode.RET + /// 19 : OpCode.PUSH0 + /// 1A : OpCode.LDARG1 + /// 1B : OpCode.SETITEM + /// 1C : OpCode.STLOC3 + /// 1D : OpCode.LDLOC3 + /// 1E : OpCode.LDARG0 + /// 1F : OpCode.LDLOC2 + /// 20 : OpCode.CALL 0B + /// 22 : OpCode.LDARG0 + /// 23 : OpCode.LDLOC2 + /// 24 : OpCode.CALL 1B + /// 26 : OpCode.STLOC3 + /// 27 : OpCode.LDLOC3 + /// 28 : OpCode.PUSH0 + /// 29 : OpCode.PICKITEM + /// 2A : OpCode.RET /// [DisplayName("serializeTest")] public abstract BigInteger? SerializeTest(byte[]? key, BigInteger? value); diff --git a/tests/Neo.SmartContract.Framework.UnitTests/TestingArtifacts/Contract_SupportedStandard11Enum.cs b/tests/Neo.SmartContract.Framework.UnitTests/TestingArtifacts/Contract_SupportedStandard11Enum.cs index bb6376a2c..89e343e41 100644 --- a/tests/Neo.SmartContract.Framework.UnitTests/TestingArtifacts/Contract_SupportedStandard11Enum.cs +++ b/tests/Neo.SmartContract.Framework.UnitTests/TestingArtifacts/Contract_SupportedStandard11Enum.cs @@ -165,7 +165,7 @@ public abstract class Contract_SupportedStandard11Enum(Neo.SmartContract.Testing /// Safe method /// /// - /// Script: VwIBExGIThBR0EGb9mfOEsBweGjBRVOLUEGSXegxNwAAcchpEc5LU9BA + /// Script: VwIBExGIThBR0EGb9mfOEsBweGjBRVOLUEGSXegxNwAAcchKDG5hbWVpEc7QQA== /// 00 : OpCode.INITSLOT 0201 /// 03 : OpCode.PUSH3 /// 04 : OpCode.PUSH1 @@ -189,13 +189,13 @@ public abstract class Contract_SupportedStandard11Enum(Neo.SmartContract.Testing /// 1E : OpCode.CALLT 0000 /// 21 : OpCode.STLOC1 /// 22 : OpCode.NEWMAP - /// 23 : OpCode.LDLOC1 - /// 24 : OpCode.PUSH1 - /// 25 : OpCode.PICKITEM - /// 26 : OpCode.OVER - /// 27 : OpCode.REVERSE3 - /// 28 : OpCode.SETITEM - /// 29 : OpCode.RET + /// 23 : OpCode.DUP + /// 24 : OpCode.PUSHDATA1 6E616D65 + /// 2A : OpCode.LDLOC1 + /// 2B : OpCode.PUSH1 + /// 2C : OpCode.PICKITEM + /// 2D : OpCode.SETITEM + /// 2E : OpCode.RET /// [DisplayName("properties")] public abstract IDictionary? Properties(byte[]? tokenId);