diff --git a/src/Neo.Compiler.CSharp/MethodConvert/System/SystemCall.BigInteger.cs b/src/Neo.Compiler.CSharp/MethodConvert/System/SystemCall.BigInteger.cs index e428d11e2..d21df1fee 100644 --- a/src/Neo.Compiler.CSharp/MethodConvert/System/SystemCall.BigInteger.cs +++ b/src/Neo.Compiler.CSharp/MethodConvert/System/SystemCall.BigInteger.cs @@ -488,21 +488,23 @@ private static void HandleMathBigIntegerDivRem(MethodConvert methodConvert, Sema methodConvert.ConvertExpression(model, instanceExpression); if (arguments is not null) methodConvert.PrepareArgumentsForMethod(model, symbol, arguments); + // r, l -> l/r, l%r // Perform division - methodConvert.AddInstruction(OpCode.DUP); - methodConvert.AddInstruction(OpCode.ROT); - methodConvert.AddInstruction(OpCode.TUCK); - methodConvert.AddInstruction(OpCode.DIV); + methodConvert.AddInstruction(OpCode.DUP); // r, l, l + methodConvert.Push(2); + methodConvert.AddInstruction(OpCode.PICK);// r, l, l, r + methodConvert.AddInstruction(OpCode.DIV); // r, l, l/r + // For types that is restricted by range, there should be l/r <= MaxValue + // However it's only possible to get l/r == MaxValue + 1 when l/r > MaxValue + // and it's impossible to get l/r < MinValue + // Therefore we ignore this case; l/r <= MaxValue is not checked // Calculate remainder - methodConvert.AddInstruction(OpCode.DUP); - methodConvert.AddInstruction(OpCode.ROT); - methodConvert.AddInstruction(OpCode.MUL); - methodConvert.AddInstruction(OpCode.ROT); - methodConvert.AddInstruction(OpCode.SWAP); - methodConvert.AddInstruction(OpCode.SUB); + methodConvert.AddInstruction(OpCode.REVERSE3); // l/r, l, r + methodConvert.AddInstruction(OpCode.MOD); // l/r, l%r methodConvert.AddInstruction(OpCode.PUSH2); methodConvert.AddInstruction(OpCode.PACK); + // It's impossible to get l%r out of range } //implement HandleBigIntegerLeadingZeroCount diff --git a/src/Neo.Compiler.CSharp/MethodConvert/System/SystemCall.Math.cs b/src/Neo.Compiler.CSharp/MethodConvert/System/SystemCall.Math.cs index 1fc77c111..483397873 100644 --- a/src/Neo.Compiler.CSharp/MethodConvert/System/SystemCall.Math.cs +++ b/src/Neo.Compiler.CSharp/MethodConvert/System/SystemCall.Math.cs @@ -53,250 +53,42 @@ private static void HandleMathMin(MethodConvert methodConvert, SemanticModel mod private static void HandleMathByteDivRem(MethodConvert methodConvert, SemanticModel model, IMethodSymbol symbol, ExpressionSyntax? instanceExpression, IReadOnlyList? arguments) { - if (instanceExpression is not null) - methodConvert.ConvertExpression(model, instanceExpression); - if (arguments is not null) - methodConvert.PrepareArgumentsForMethod(model, symbol, arguments); - JumpTarget endTarget = new(); - // Perform division - methodConvert.AddInstruction(OpCode.DUP); - methodConvert.AddInstruction(OpCode.ROT); - methodConvert.AddInstruction(OpCode.TUCK); - methodConvert.AddInstruction(OpCode.DIV); - - // Calculate remainder - methodConvert.AddInstruction(OpCode.DUP); - methodConvert.AddInstruction(OpCode.ROT); - methodConvert.AddInstruction(OpCode.MUL); - methodConvert.AddInstruction(OpCode.ROT); - methodConvert.AddInstruction(OpCode.SWAP); - methodConvert.AddInstruction(OpCode.SUB); - methodConvert.AddInstruction(OpCode.DUP); - methodConvert.Push(byte.MinValue); - methodConvert.Push(new BigInteger(byte.MaxValue) + 1); - methodConvert.AddInstruction(OpCode.WITHIN); - methodConvert.Jump(OpCode.JMPIF, endTarget); - methodConvert.AddInstruction(OpCode.THROW); - endTarget.Instruction = methodConvert.AddInstruction(OpCode.NOP); - methodConvert.AddInstruction(OpCode.PUSH2); - methodConvert.AddInstruction(OpCode.PACK); + HandleMathBigIntegerDivRem(methodConvert, model, symbol, instanceExpression, arguments); } private static void HandleMathSByteDivRem(MethodConvert methodConvert, SemanticModel model, IMethodSymbol symbol, ExpressionSyntax? instanceExpression, IReadOnlyList? arguments) { - if (instanceExpression is not null) - methodConvert.ConvertExpression(model, instanceExpression); - if (arguments is not null) - methodConvert.PrepareArgumentsForMethod(model, symbol, arguments); - JumpTarget endTarget = new(); - // Perform division - methodConvert.AddInstruction(OpCode.DUP); - methodConvert.AddInstruction(OpCode.ROT); - methodConvert.AddInstruction(OpCode.TUCK); - methodConvert.AddInstruction(OpCode.DIV); - - // Calculate remainder - methodConvert.AddInstruction(OpCode.DUP); - methodConvert.AddInstruction(OpCode.ROT); - methodConvert.AddInstruction(OpCode.MUL); - methodConvert.AddInstruction(OpCode.ROT); - methodConvert.AddInstruction(OpCode.SWAP); - methodConvert.AddInstruction(OpCode.SUB); - methodConvert.AddInstruction(OpCode.DUP); - methodConvert.Push(sbyte.MinValue); - methodConvert.Push(new BigInteger(sbyte.MaxValue) + 1); - methodConvert.AddInstruction(OpCode.WITHIN); - methodConvert.Jump(OpCode.JMPIF, endTarget); - methodConvert.AddInstruction(OpCode.THROW); - endTarget.Instruction = methodConvert.AddInstruction(OpCode.NOP); - methodConvert.AddInstruction(OpCode.PUSH2); - methodConvert.AddInstruction(OpCode.PACK); + HandleMathBigIntegerDivRem(methodConvert, model, symbol, instanceExpression, arguments); } private static void HandleMathShortDivRem(MethodConvert methodConvert, SemanticModel model, IMethodSymbol symbol, ExpressionSyntax? instanceExpression, IReadOnlyList? arguments) { - if (instanceExpression is not null) - methodConvert.ConvertExpression(model, instanceExpression); - if (arguments is not null) - methodConvert.PrepareArgumentsForMethod(model, symbol, arguments); - JumpTarget endTarget = new(); - // Perform division - methodConvert.AddInstruction(OpCode.DUP); - methodConvert.AddInstruction(OpCode.ROT); - methodConvert.AddInstruction(OpCode.TUCK); - methodConvert.AddInstruction(OpCode.DIV); - - // Calculate remainder - methodConvert.AddInstruction(OpCode.DUP); - methodConvert.AddInstruction(OpCode.ROT); - methodConvert.AddInstruction(OpCode.MUL); - methodConvert.AddInstruction(OpCode.ROT); - methodConvert.AddInstruction(OpCode.SWAP); - methodConvert.AddInstruction(OpCode.SUB); - methodConvert.AddInstruction(OpCode.DUP); - methodConvert.Push(short.MinValue); - methodConvert.Push(new BigInteger(short.MaxValue) + 1); - methodConvert.AddInstruction(OpCode.WITHIN); - methodConvert.Jump(OpCode.JMPIF, endTarget); - methodConvert.AddInstruction(OpCode.THROW); - endTarget.Instruction = methodConvert.AddInstruction(OpCode.NOP); - methodConvert.AddInstruction(OpCode.PUSH2); - methodConvert.AddInstruction(OpCode.PACK); + HandleMathBigIntegerDivRem(methodConvert, model, symbol, instanceExpression, arguments); } private static void HandleMathUShortDivRem(MethodConvert methodConvert, SemanticModel model, IMethodSymbol symbol, ExpressionSyntax? instanceExpression, IReadOnlyList? arguments) { - if (instanceExpression is not null) - methodConvert.ConvertExpression(model, instanceExpression); - if (arguments is not null) - methodConvert.PrepareArgumentsForMethod(model, symbol, arguments); - JumpTarget endTarget = new(); - // Perform division - methodConvert.AddInstruction(OpCode.DUP); - methodConvert.AddInstruction(OpCode.ROT); - methodConvert.AddInstruction(OpCode.TUCK); - methodConvert.AddInstruction(OpCode.DIV); - - // Calculate remainder - methodConvert.AddInstruction(OpCode.DUP); - methodConvert.AddInstruction(OpCode.ROT); - methodConvert.AddInstruction(OpCode.MUL); - methodConvert.AddInstruction(OpCode.ROT); - methodConvert.AddInstruction(OpCode.SWAP); - methodConvert.AddInstruction(OpCode.SUB); - methodConvert.AddInstruction(OpCode.DUP); - methodConvert.Push(ushort.MinValue); - methodConvert.Push(new BigInteger(ushort.MaxValue) + 1); - methodConvert.AddInstruction(OpCode.WITHIN); - methodConvert.Jump(OpCode.JMPIF, endTarget); - methodConvert.AddInstruction(OpCode.THROW); - endTarget.Instruction = methodConvert.AddInstruction(OpCode.NOP); - methodConvert.AddInstruction(OpCode.PUSH2); - methodConvert.AddInstruction(OpCode.PACK); + HandleMathBigIntegerDivRem(methodConvert, model, symbol, instanceExpression, arguments); } private static void HandleMathIntDivRem(MethodConvert methodConvert, SemanticModel model, IMethodSymbol symbol, ExpressionSyntax? instanceExpression, IReadOnlyList? arguments) { - if (instanceExpression is not null) - methodConvert.ConvertExpression(model, instanceExpression); - if (arguments is not null) - methodConvert.PrepareArgumentsForMethod(model, symbol, arguments); - JumpTarget endTarget = new(); - // Perform division - methodConvert.AddInstruction(OpCode.DUP); - methodConvert.AddInstruction(OpCode.ROT); - methodConvert.AddInstruction(OpCode.TUCK); - methodConvert.AddInstruction(OpCode.DIV); - - // Calculate remainder - methodConvert.AddInstruction(OpCode.DUP); - methodConvert.AddInstruction(OpCode.ROT); - methodConvert.AddInstruction(OpCode.MUL); - methodConvert.AddInstruction(OpCode.ROT); - methodConvert.AddInstruction(OpCode.SWAP); - methodConvert.AddInstruction(OpCode.SUB); - methodConvert.AddInstruction(OpCode.DUP); - methodConvert.Push(int.MinValue); - methodConvert.Push(new BigInteger(int.MaxValue) + 1); - methodConvert.AddInstruction(OpCode.WITHIN); - methodConvert.Jump(OpCode.JMPIF, endTarget); - methodConvert.AddInstruction(OpCode.THROW); - endTarget.Instruction = methodConvert.AddInstruction(OpCode.NOP); - methodConvert.AddInstruction(OpCode.PUSH2); - methodConvert.AddInstruction(OpCode.PACK); + HandleMathBigIntegerDivRem(methodConvert, model, symbol, instanceExpression, arguments); } private static void HandleMathUIntDivRem(MethodConvert methodConvert, SemanticModel model, IMethodSymbol symbol, ExpressionSyntax? instanceExpression, IReadOnlyList? arguments) { - if (instanceExpression is not null) - methodConvert.ConvertExpression(model, instanceExpression); - if (arguments is not null) - methodConvert.PrepareArgumentsForMethod(model, symbol, arguments); - JumpTarget endTarget = new(); - // Perform division - methodConvert.AddInstruction(OpCode.DUP); - methodConvert.AddInstruction(OpCode.ROT); - methodConvert.AddInstruction(OpCode.TUCK); - methodConvert.AddInstruction(OpCode.DIV); - - // Calculate remainder - methodConvert.AddInstruction(OpCode.DUP); - methodConvert.AddInstruction(OpCode.ROT); - methodConvert.AddInstruction(OpCode.MUL); - methodConvert.AddInstruction(OpCode.ROT); - methodConvert.AddInstruction(OpCode.SWAP); - methodConvert.AddInstruction(OpCode.SUB); - methodConvert.AddInstruction(OpCode.DUP); - methodConvert.Push(uint.MinValue); - methodConvert.Push(new BigInteger(uint.MaxValue) + 1); - methodConvert.AddInstruction(OpCode.WITHIN); - methodConvert.Jump(OpCode.JMPIF, endTarget); - methodConvert.AddInstruction(OpCode.THROW); - endTarget.Instruction = methodConvert.AddInstruction(OpCode.NOP); - methodConvert.AddInstruction(OpCode.PUSH2); - methodConvert.AddInstruction(OpCode.PACK); + HandleMathBigIntegerDivRem(methodConvert, model, symbol, instanceExpression, arguments); } private static void HandleMathLongDivRem(MethodConvert methodConvert, SemanticModel model, IMethodSymbol symbol, ExpressionSyntax? instanceExpression, IReadOnlyList? arguments) { - if (instanceExpression is not null) - methodConvert.ConvertExpression(model, instanceExpression); - if (arguments is not null) - methodConvert.PrepareArgumentsForMethod(model, symbol, arguments); - JumpTarget endTarget = new(); - // Perform division - methodConvert.AddInstruction(OpCode.DUP); - methodConvert.AddInstruction(OpCode.ROT); - methodConvert.AddInstruction(OpCode.TUCK); - methodConvert.AddInstruction(OpCode.DIV); - - // Calculate remainder - methodConvert.AddInstruction(OpCode.DUP); - methodConvert.AddInstruction(OpCode.ROT); - methodConvert.AddInstruction(OpCode.MUL); - methodConvert.AddInstruction(OpCode.ROT); - methodConvert.AddInstruction(OpCode.SWAP); - methodConvert.AddInstruction(OpCode.SUB); - methodConvert.AddInstruction(OpCode.DUP); - methodConvert.Push(long.MinValue); - methodConvert.Push(new BigInteger(long.MaxValue) + 1); - methodConvert.AddInstruction(OpCode.WITHIN); - methodConvert.Jump(OpCode.JMPIF, endTarget); - methodConvert.AddInstruction(OpCode.THROW); - endTarget.Instruction = methodConvert.AddInstruction(OpCode.NOP); - methodConvert.AddInstruction(OpCode.PUSH2); - methodConvert.AddInstruction(OpCode.PACK); + HandleMathBigIntegerDivRem(methodConvert, model, symbol, instanceExpression, arguments); } private static void HandleMathULongDivRem(MethodConvert methodConvert, SemanticModel model, IMethodSymbol symbol, ExpressionSyntax? instanceExpression, IReadOnlyList? arguments) { - if (instanceExpression is not null) - methodConvert.ConvertExpression(model, instanceExpression); - if (arguments is not null) - methodConvert.PrepareArgumentsForMethod(model, symbol, arguments); - JumpTarget endTarget = new(); - // Perform division - methodConvert.AddInstruction(OpCode.DUP); - methodConvert.AddInstruction(OpCode.ROT); - methodConvert.AddInstruction(OpCode.TUCK); - methodConvert.AddInstruction(OpCode.DIV); - - // Calculate remainder - methodConvert.AddInstruction(OpCode.DUP); - methodConvert.AddInstruction(OpCode.ROT); - methodConvert.AddInstruction(OpCode.MUL); - methodConvert.AddInstruction(OpCode.ROT); - methodConvert.AddInstruction(OpCode.SWAP); - methodConvert.AddInstruction(OpCode.SUB); - methodConvert.AddInstruction(OpCode.DUP); - methodConvert.Push(ulong.MinValue); - methodConvert.Push(new BigInteger(ulong.MaxValue) + 1); - methodConvert.AddInstruction(OpCode.WITHIN); - methodConvert.Jump(OpCode.JMPIF, endTarget); - methodConvert.AddInstruction(OpCode.THROW); - endTarget.Instruction = methodConvert.AddInstruction(OpCode.NOP); - methodConvert.AddInstruction(OpCode.PUSH2); - methodConvert.AddInstruction(OpCode.PACK); + HandleMathBigIntegerDivRem(methodConvert, model, symbol, instanceExpression, arguments); } private static void HandleMathClamp(MethodConvert methodConvert, SemanticModel model, IMethodSymbol symbol, ExpressionSyntax? instanceExpression, IReadOnlyList? arguments) diff --git a/tests/Neo.Compiler.CSharp.UnitTests/TestingArtifacts/Contract_Integer.cs b/tests/Neo.Compiler.CSharp.UnitTests/TestingArtifacts/Contract_Integer.cs index 9b1576c59..c0e615754 100644 --- a/tests/Neo.Compiler.CSharp.UnitTests/TestingArtifacts/Contract_Integer.cs +++ b/tests/Neo.Compiler.CSharp.UnitTests/TestingArtifacts/Contract_Integer.cs @@ -10,12 +10,12 @@ public abstract class Contract_Integer(Neo.SmartContract.Testing.SmartContractIn { #region Compiled data - public static Neo.SmartContract.Manifest.ContractManifest Manifest => Neo.SmartContract.Manifest.ContractManifest.Parse(@"{""name"":""Contract_Integer"",""groups"":[],""features"":{},""supportedstandards"":[],""abi"":{""methods"":[{""name"":""divRemByte"",""parameters"":[{""name"":""left"",""type"":""Integer""},{""name"":""right"",""type"":""Integer""}],""returntype"":""Array"",""offset"":0,""safe"":false},{""name"":""divRemShort"",""parameters"":[{""name"":""left"",""type"":""Integer""},{""name"":""right"",""type"":""Integer""}],""returntype"":""Array"",""offset"":27,""safe"":false},{""name"":""divRemInt"",""parameters"":[{""name"":""left"",""type"":""Integer""},{""name"":""right"",""type"":""Integer""}],""returntype"":""Array"",""offset"":58,""safe"":false},{""name"":""divRemLong"",""parameters"":[{""name"":""left"",""type"":""Integer""},{""name"":""right"",""type"":""Integer""}],""returntype"":""Array"",""offset"":95,""safe"":false},{""name"":""divRemSbyte"",""parameters"":[{""name"":""left"",""type"":""Integer""},{""name"":""right"",""type"":""Integer""}],""returntype"":""Array"",""offset"":144,""safe"":false},{""name"":""divRemUshort"",""parameters"":[{""name"":""left"",""type"":""Integer""},{""name"":""right"",""type"":""Integer""}],""returntype"":""Array"",""offset"":172,""safe"":false},{""name"":""divRemUint"",""parameters"":[{""name"":""left"",""type"":""Integer""},{""name"":""right"",""type"":""Integer""}],""returntype"":""Array"",""offset"":201,""safe"":false},{""name"":""divRemUlong"",""parameters"":[{""name"":""left"",""type"":""Integer""},{""name"":""right"",""type"":""Integer""}],""returntype"":""Array"",""offset"":234,""safe"":false},{""name"":""clampByte"",""parameters"":[{""name"":""value"",""type"":""Integer""},{""name"":""min"",""type"":""Integer""},{""name"":""max"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":275,""safe"":false},{""name"":""clampSByte"",""parameters"":[{""name"":""value"",""type"":""Integer""},{""name"":""min"",""type"":""Integer""},{""name"":""max"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":290,""safe"":false},{""name"":""clampShort"",""parameters"":[{""name"":""value"",""type"":""Integer""},{""name"":""min"",""type"":""Integer""},{""name"":""max"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":305,""safe"":false},{""name"":""clampUShort"",""parameters"":[{""name"":""value"",""type"":""Integer""},{""name"":""min"",""type"":""Integer""},{""name"":""max"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":320,""safe"":false},{""name"":""clampInt"",""parameters"":[{""name"":""value"",""type"":""Integer""},{""name"":""min"",""type"":""Integer""},{""name"":""max"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":335,""safe"":false},{""name"":""clampUInt"",""parameters"":[{""name"":""value"",""type"":""Integer""},{""name"":""min"",""type"":""Integer""},{""name"":""max"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":350,""safe"":false},{""name"":""clampLong"",""parameters"":[{""name"":""value"",""type"":""Integer""},{""name"":""min"",""type"":""Integer""},{""name"":""max"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":365,""safe"":false},{""name"":""clampULong"",""parameters"":[{""name"":""value"",""type"":""Integer""},{""name"":""min"",""type"":""Integer""},{""name"":""max"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":380,""safe"":false},{""name"":""clampBigInteger"",""parameters"":[{""name"":""value"",""type"":""Integer""},{""name"":""min"",""type"":""Integer""},{""name"":""max"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":395,""safe"":false},{""name"":""copySignInt"",""parameters"":[{""name"":""value"",""type"":""Integer""},{""name"":""sign"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":410,""safe"":false},{""name"":""copySignSbyte"",""parameters"":[{""name"":""value"",""type"":""Integer""},{""name"":""sign"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":433,""safe"":false},{""name"":""copySignShort"",""parameters"":[{""name"":""value"",""type"":""Integer""},{""name"":""sign"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":453,""safe"":false},{""name"":""copySignLong"",""parameters"":[{""name"":""value"",""type"":""Integer""},{""name"":""sign"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":474,""safe"":false},{""name"":""createCheckedInt"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":501,""safe"":false},{""name"":""createCheckedByte"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":525,""safe"":false},{""name"":""createCheckedLong"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":539,""safe"":false},{""name"":""createCheckedUlong"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":575,""safe"":false},{""name"":""createCheckedChar"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":603,""safe"":false},{""name"":""createCheckedShort"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":619,""safe"":false},{""name"":""createCheckedSbyte"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":637,""safe"":false},{""name"":""createSaturatingInt"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":652,""safe"":false},{""name"":""createSaturatingByte"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":696,""safe"":false},{""name"":""createSaturatingLong"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":734,""safe"":false},{""name"":""createSaturatingUlong"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":786,""safe"":false},{""name"":""createSaturatingChar"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":838,""safe"":false},{""name"":""createSaturatingSbyte"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":878,""safe"":false},{""name"":""isEvenIntegerInt"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Boolean"",""offset"":916,""safe"":false},{""name"":""isEventUInt"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Boolean"",""offset"":924,""safe"":false},{""name"":""isEvenLong"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Boolean"",""offset"":932,""safe"":false},{""name"":""isEvenUlong"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Boolean"",""offset"":940,""safe"":false},{""name"":""isEvenShort"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Boolean"",""offset"":948,""safe"":false},{""name"":""isEvenUshort"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Boolean"",""offset"":956,""safe"":false},{""name"":""isEvenByte"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Boolean"",""offset"":964,""safe"":false},{""name"":""isEvenSbyte"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Boolean"",""offset"":972,""safe"":false},{""name"":""isOddIntegerInt"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Boolean"",""offset"":980,""safe"":false},{""name"":""isOddUInt"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Boolean"",""offset"":988,""safe"":false},{""name"":""isOddLong"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Boolean"",""offset"":996,""safe"":false},{""name"":""isOddUlong"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Boolean"",""offset"":1004,""safe"":false},{""name"":""isOddShort"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Boolean"",""offset"":1012,""safe"":false},{""name"":""isOddUshort"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Boolean"",""offset"":1020,""safe"":false},{""name"":""isOddByte"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Boolean"",""offset"":1028,""safe"":false},{""name"":""isOddSbyte"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Boolean"",""offset"":1036,""safe"":false},{""name"":""isNegativeInt"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Boolean"",""offset"":1044,""safe"":false},{""name"":""isNegativeLong"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Boolean"",""offset"":1051,""safe"":false},{""name"":""isNegativeShort"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Boolean"",""offset"":1058,""safe"":false},{""name"":""isNegativeSbyte"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Boolean"",""offset"":1065,""safe"":false},{""name"":""isPositiveInt"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Boolean"",""offset"":1072,""safe"":false},{""name"":""isPositiveLong"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Boolean"",""offset"":1079,""safe"":false},{""name"":""isPositiveShort"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Boolean"",""offset"":1086,""safe"":false},{""name"":""isPositiveSbyte"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Boolean"",""offset"":1093,""safe"":false},{""name"":""isPow2Int"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Boolean"",""offset"":1100,""safe"":false},{""name"":""isPow2UInt"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Boolean"",""offset"":1121,""safe"":false},{""name"":""isPow2Long"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Boolean"",""offset"":1142,""safe"":false},{""name"":""isPow2Ulong"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Boolean"",""offset"":1163,""safe"":false},{""name"":""isPow2Short"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Boolean"",""offset"":1184,""safe"":false},{""name"":""isPow2Ushort"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Boolean"",""offset"":1205,""safe"":false},{""name"":""isPow2Byte"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Boolean"",""offset"":1226,""safe"":false},{""name"":""isPow2Sbyte"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Boolean"",""offset"":1247,""safe"":false},{""name"":""leadingZeroCountInt"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":1268,""safe"":false},{""name"":""leadingZeroCountUInt"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":1297,""safe"":false},{""name"":""leadingZeroCountLong"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":1319,""safe"":false},{""name"":""leadingZeroCountShort"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":1348,""safe"":false},{""name"":""leadingZeroCountUshort"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":1376,""safe"":false},{""name"":""leadingZeroCountByte"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":1397,""safe"":false},{""name"":""leadingZeroCountSbyte"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":1418,""safe"":false},{""name"":""log2Int"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":1446,""safe"":false},{""name"":""log2UInt"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":1470,""safe"":false},{""name"":""log2Long"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":1494,""safe"":false},{""name"":""log2Short"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":1518,""safe"":false},{""name"":""log2Ushort"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":1542,""safe"":false},{""name"":""log2Byte"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":1566,""safe"":false},{""name"":""log2Sbyte"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":1590,""safe"":false},{""name"":""rotateLeftInt"",""parameters"":[{""name"":""value"",""type"":""Integer""},{""name"":""offset"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":1614,""safe"":false},{""name"":""rotateLeftUInt"",""parameters"":[{""name"":""value"",""type"":""Integer""},{""name"":""offset"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":1689,""safe"":false},{""name"":""rotateLeftLong"",""parameters"":[{""name"":""value"",""type"":""Integer""},{""name"":""offset"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":1752,""safe"":false},{""name"":""rotateLeftULong"",""parameters"":[{""name"":""value"",""type"":""Integer""},{""name"":""offset"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":1867,""safe"":false},{""name"":""rotateLeftShort"",""parameters"":[{""name"":""value"",""type"":""Integer""},{""name"":""offset"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":1962,""safe"":false},{""name"":""rotateLeftUShort"",""parameters"":[{""name"":""value"",""type"":""Integer""},{""name"":""offset"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":2014,""safe"":false},{""name"":""rotateLeftByte"",""parameters"":[{""name"":""value"",""type"":""Integer""},{""name"":""offset"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":2058,""safe"":false},{""name"":""rotateLeftSByte"",""parameters"":[{""name"":""value"",""type"":""Integer""},{""name"":""offset"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":2094,""safe"":false},{""name"":""rotateRightInt"",""parameters"":[{""name"":""value"",""type"":""Integer""},{""name"":""offset"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":2136,""safe"":false},{""name"":""rotateRightUInt"",""parameters"":[{""name"":""value"",""type"":""Integer""},{""name"":""offset"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":2225,""safe"":false},{""name"":""rotateRightLong"",""parameters"":[{""name"":""value"",""type"":""Integer""},{""name"":""offset"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":2255,""safe"":false},{""name"":""rotateRightULong"",""parameters"":[{""name"":""value"",""type"":""Integer""},{""name"":""offset"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":2384,""safe"":false},{""name"":""rotateRightShort"",""parameters"":[{""name"":""value"",""type"":""Integer""},{""name"":""offset"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":2422,""safe"":false},{""name"":""rotateRightUShort"",""parameters"":[{""name"":""value"",""type"":""Integer""},{""name"":""offset"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":2484,""safe"":false},{""name"":""rotateRightByte"",""parameters"":[{""name"":""value"",""type"":""Integer""},{""name"":""offset"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":2507,""safe"":false},{""name"":""rotateRightSByte"",""parameters"":[{""name"":""value"",""type"":""Integer""},{""name"":""offset"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":2528,""safe"":false},{""name"":""popCountByte"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":2580,""safe"":false},{""name"":""popCountSByte"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":2606,""safe"":false},{""name"":""popCountShort"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":2632,""safe"":false},{""name"":""popCountUShort"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":2660,""safe"":false},{""name"":""popCountInt"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":2688,""safe"":false},{""name"":""popCountUInt"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":2720,""safe"":false},{""name"":""popCountLong"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":2752,""safe"":false},{""name"":""popCountULong"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":2792,""safe"":false},{""name"":""popCountBigInteger"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":2832,""safe"":false},{""name"":""isPow2BigInteger"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Boolean"",""offset"":2953,""safe"":false}],""events"":[]},""permissions"":[],""trusts"":[],""extra"":{""nef"":{""optimization"":""All""}}}"); + public static Neo.SmartContract.Manifest.ContractManifest Manifest => Neo.SmartContract.Manifest.ContractManifest.Parse(@"{""name"":""Contract_Integer"",""groups"":[],""features"":{},""supportedstandards"":[],""abi"":{""methods"":[{""name"":""divRemByte"",""parameters"":[{""name"":""left"",""type"":""Integer""},{""name"":""right"",""type"":""Integer""}],""returntype"":""Array"",""offset"":0,""safe"":false},{""name"":""divRemShort"",""parameters"":[{""name"":""left"",""type"":""Integer""},{""name"":""right"",""type"":""Integer""}],""returntype"":""Array"",""offset"":14,""safe"":false},{""name"":""divRemInt"",""parameters"":[{""name"":""left"",""type"":""Integer""},{""name"":""right"",""type"":""Integer""}],""returntype"":""Array"",""offset"":28,""safe"":false},{""name"":""divRemLong"",""parameters"":[{""name"":""left"",""type"":""Integer""},{""name"":""right"",""type"":""Integer""}],""returntype"":""Array"",""offset"":42,""safe"":false},{""name"":""divRemSbyte"",""parameters"":[{""name"":""left"",""type"":""Integer""},{""name"":""right"",""type"":""Integer""}],""returntype"":""Array"",""offset"":56,""safe"":false},{""name"":""divRemUshort"",""parameters"":[{""name"":""left"",""type"":""Integer""},{""name"":""right"",""type"":""Integer""}],""returntype"":""Array"",""offset"":70,""safe"":false},{""name"":""divRemUint"",""parameters"":[{""name"":""left"",""type"":""Integer""},{""name"":""right"",""type"":""Integer""}],""returntype"":""Array"",""offset"":84,""safe"":false},{""name"":""divRemUlong"",""parameters"":[{""name"":""left"",""type"":""Integer""},{""name"":""right"",""type"":""Integer""}],""returntype"":""Array"",""offset"":98,""safe"":false},{""name"":""clampByte"",""parameters"":[{""name"":""value"",""type"":""Integer""},{""name"":""min"",""type"":""Integer""},{""name"":""max"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":112,""safe"":false},{""name"":""clampSByte"",""parameters"":[{""name"":""value"",""type"":""Integer""},{""name"":""min"",""type"":""Integer""},{""name"":""max"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":127,""safe"":false},{""name"":""clampShort"",""parameters"":[{""name"":""value"",""type"":""Integer""},{""name"":""min"",""type"":""Integer""},{""name"":""max"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":142,""safe"":false},{""name"":""clampUShort"",""parameters"":[{""name"":""value"",""type"":""Integer""},{""name"":""min"",""type"":""Integer""},{""name"":""max"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":157,""safe"":false},{""name"":""clampInt"",""parameters"":[{""name"":""value"",""type"":""Integer""},{""name"":""min"",""type"":""Integer""},{""name"":""max"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":172,""safe"":false},{""name"":""clampUInt"",""parameters"":[{""name"":""value"",""type"":""Integer""},{""name"":""min"",""type"":""Integer""},{""name"":""max"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":187,""safe"":false},{""name"":""clampLong"",""parameters"":[{""name"":""value"",""type"":""Integer""},{""name"":""min"",""type"":""Integer""},{""name"":""max"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":202,""safe"":false},{""name"":""clampULong"",""parameters"":[{""name"":""value"",""type"":""Integer""},{""name"":""min"",""type"":""Integer""},{""name"":""max"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":217,""safe"":false},{""name"":""clampBigInteger"",""parameters"":[{""name"":""value"",""type"":""Integer""},{""name"":""min"",""type"":""Integer""},{""name"":""max"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":232,""safe"":false},{""name"":""copySignInt"",""parameters"":[{""name"":""value"",""type"":""Integer""},{""name"":""sign"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":247,""safe"":false},{""name"":""copySignSbyte"",""parameters"":[{""name"":""value"",""type"":""Integer""},{""name"":""sign"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":270,""safe"":false},{""name"":""copySignShort"",""parameters"":[{""name"":""value"",""type"":""Integer""},{""name"":""sign"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":290,""safe"":false},{""name"":""copySignLong"",""parameters"":[{""name"":""value"",""type"":""Integer""},{""name"":""sign"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":311,""safe"":false},{""name"":""createCheckedInt"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":338,""safe"":false},{""name"":""createCheckedByte"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":362,""safe"":false},{""name"":""createCheckedLong"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":376,""safe"":false},{""name"":""createCheckedUlong"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":412,""safe"":false},{""name"":""createCheckedChar"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":440,""safe"":false},{""name"":""createCheckedShort"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":456,""safe"":false},{""name"":""createCheckedSbyte"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":474,""safe"":false},{""name"":""createSaturatingInt"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":489,""safe"":false},{""name"":""createSaturatingByte"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":533,""safe"":false},{""name"":""createSaturatingLong"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":571,""safe"":false},{""name"":""createSaturatingUlong"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":623,""safe"":false},{""name"":""createSaturatingChar"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":675,""safe"":false},{""name"":""createSaturatingSbyte"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":715,""safe"":false},{""name"":""isEvenIntegerInt"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Boolean"",""offset"":753,""safe"":false},{""name"":""isEventUInt"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Boolean"",""offset"":761,""safe"":false},{""name"":""isEvenLong"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Boolean"",""offset"":769,""safe"":false},{""name"":""isEvenUlong"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Boolean"",""offset"":777,""safe"":false},{""name"":""isEvenShort"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Boolean"",""offset"":785,""safe"":false},{""name"":""isEvenUshort"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Boolean"",""offset"":793,""safe"":false},{""name"":""isEvenByte"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Boolean"",""offset"":801,""safe"":false},{""name"":""isEvenSbyte"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Boolean"",""offset"":809,""safe"":false},{""name"":""isOddIntegerInt"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Boolean"",""offset"":817,""safe"":false},{""name"":""isOddUInt"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Boolean"",""offset"":825,""safe"":false},{""name"":""isOddLong"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Boolean"",""offset"":833,""safe"":false},{""name"":""isOddUlong"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Boolean"",""offset"":841,""safe"":false},{""name"":""isOddShort"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Boolean"",""offset"":849,""safe"":false},{""name"":""isOddUshort"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Boolean"",""offset"":857,""safe"":false},{""name"":""isOddByte"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Boolean"",""offset"":865,""safe"":false},{""name"":""isOddSbyte"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Boolean"",""offset"":873,""safe"":false},{""name"":""isNegativeInt"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Boolean"",""offset"":881,""safe"":false},{""name"":""isNegativeLong"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Boolean"",""offset"":888,""safe"":false},{""name"":""isNegativeShort"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Boolean"",""offset"":895,""safe"":false},{""name"":""isNegativeSbyte"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Boolean"",""offset"":902,""safe"":false},{""name"":""isPositiveInt"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Boolean"",""offset"":909,""safe"":false},{""name"":""isPositiveLong"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Boolean"",""offset"":916,""safe"":false},{""name"":""isPositiveShort"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Boolean"",""offset"":923,""safe"":false},{""name"":""isPositiveSbyte"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Boolean"",""offset"":930,""safe"":false},{""name"":""isPow2Int"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Boolean"",""offset"":937,""safe"":false},{""name"":""isPow2UInt"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Boolean"",""offset"":958,""safe"":false},{""name"":""isPow2Long"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Boolean"",""offset"":979,""safe"":false},{""name"":""isPow2Ulong"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Boolean"",""offset"":1000,""safe"":false},{""name"":""isPow2Short"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Boolean"",""offset"":1021,""safe"":false},{""name"":""isPow2Ushort"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Boolean"",""offset"":1042,""safe"":false},{""name"":""isPow2Byte"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Boolean"",""offset"":1063,""safe"":false},{""name"":""isPow2Sbyte"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Boolean"",""offset"":1084,""safe"":false},{""name"":""leadingZeroCountInt"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":1105,""safe"":false},{""name"":""leadingZeroCountUInt"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":1134,""safe"":false},{""name"":""leadingZeroCountLong"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":1156,""safe"":false},{""name"":""leadingZeroCountShort"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":1185,""safe"":false},{""name"":""leadingZeroCountUshort"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":1213,""safe"":false},{""name"":""leadingZeroCountByte"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":1234,""safe"":false},{""name"":""leadingZeroCountSbyte"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":1255,""safe"":false},{""name"":""log2Int"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":1283,""safe"":false},{""name"":""log2UInt"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":1307,""safe"":false},{""name"":""log2Long"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":1331,""safe"":false},{""name"":""log2Short"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":1355,""safe"":false},{""name"":""log2Ushort"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":1379,""safe"":false},{""name"":""log2Byte"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":1403,""safe"":false},{""name"":""log2Sbyte"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":1427,""safe"":false},{""name"":""rotateLeftInt"",""parameters"":[{""name"":""value"",""type"":""Integer""},{""name"":""offset"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":1451,""safe"":false},{""name"":""rotateLeftUInt"",""parameters"":[{""name"":""value"",""type"":""Integer""},{""name"":""offset"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":1526,""safe"":false},{""name"":""rotateLeftLong"",""parameters"":[{""name"":""value"",""type"":""Integer""},{""name"":""offset"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":1589,""safe"":false},{""name"":""rotateLeftULong"",""parameters"":[{""name"":""value"",""type"":""Integer""},{""name"":""offset"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":1704,""safe"":false},{""name"":""rotateLeftShort"",""parameters"":[{""name"":""value"",""type"":""Integer""},{""name"":""offset"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":1799,""safe"":false},{""name"":""rotateLeftUShort"",""parameters"":[{""name"":""value"",""type"":""Integer""},{""name"":""offset"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":1851,""safe"":false},{""name"":""rotateLeftByte"",""parameters"":[{""name"":""value"",""type"":""Integer""},{""name"":""offset"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":1895,""safe"":false},{""name"":""rotateLeftSByte"",""parameters"":[{""name"":""value"",""type"":""Integer""},{""name"":""offset"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":1931,""safe"":false},{""name"":""rotateRightInt"",""parameters"":[{""name"":""value"",""type"":""Integer""},{""name"":""offset"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":1973,""safe"":false},{""name"":""rotateRightUInt"",""parameters"":[{""name"":""value"",""type"":""Integer""},{""name"":""offset"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":2062,""safe"":false},{""name"":""rotateRightLong"",""parameters"":[{""name"":""value"",""type"":""Integer""},{""name"":""offset"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":2092,""safe"":false},{""name"":""rotateRightULong"",""parameters"":[{""name"":""value"",""type"":""Integer""},{""name"":""offset"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":2221,""safe"":false},{""name"":""rotateRightShort"",""parameters"":[{""name"":""value"",""type"":""Integer""},{""name"":""offset"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":2259,""safe"":false},{""name"":""rotateRightUShort"",""parameters"":[{""name"":""value"",""type"":""Integer""},{""name"":""offset"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":2321,""safe"":false},{""name"":""rotateRightByte"",""parameters"":[{""name"":""value"",""type"":""Integer""},{""name"":""offset"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":2344,""safe"":false},{""name"":""rotateRightSByte"",""parameters"":[{""name"":""value"",""type"":""Integer""},{""name"":""offset"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":2365,""safe"":false},{""name"":""popCountByte"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":2417,""safe"":false},{""name"":""popCountSByte"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":2443,""safe"":false},{""name"":""popCountShort"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":2469,""safe"":false},{""name"":""popCountUShort"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":2497,""safe"":false},{""name"":""popCountInt"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":2525,""safe"":false},{""name"":""popCountUInt"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":2557,""safe"":false},{""name"":""popCountLong"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":2589,""safe"":false},{""name"":""popCountULong"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":2629,""safe"":false},{""name"":""popCountBigInteger"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":2669,""safe"":false},{""name"":""isPow2BigInteger"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Boolean"",""offset"":2790,""safe"":false}],""events"":[]},""permissions"":[],""trusts"":[],""extra"":{""nef"":{""optimization"":""All""}}}"); /// /// Optimization: "All" /// - public static Neo.SmartContract.NefFile Nef => Neo.IO.Helper.AsSerializable(Convert.FromBase64String(@"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//8AAAAAkXkAIFCfAB+RqZID/////wAAAACRQFcAAnh5AD+RUAT//////////wAAAAAAAAAAkVCoBP//////////AAAAAAAAAACReAT//////////wAAAAAAAAAAkXkAQFCfAD+RqZJKBAAAAAAAAACAAAAAAAAAAAAwFAQAAAAAAAAAAAEAAAAAAAAAn0BXAAJ4eQA/kVAE//////////8AAAAAAAAAAJFQqAT//////////wAAAAAAAAAAkXgE//////////8AAAAAAAAAAJF5AEBQnwA/kamSBP//////////AAAAAAAAAACRQFcAAnh5H5FQAv//AACRUKgC//8AAJF4Av//AACReSBQnx+RqZJKAgCAAAAwCAIAAAEAn0BXAAJ4eR+RUAL//wAAkVCoAv//AACReAL//wAAkXkgUJ8fkamSAv//AACRQFcAAnh5F5FQAf8AkVCoAf8AkXgB/wCReRhQnxeRqZIB/wCRQFcAAnh5F5FQAf8AkVCoAf8AkXgB/wCReRhQnxeRqZJKAYAAMAYBAAGfQFcAAnh5AB+RACCiACBQn1AD/////wAAAACRUKgD/////wAAAACReAP/////AAAAAJF5ACCiACBQnwAgUJ8AH5GpkkoDAAAAgAAAAAAwDAMAAAAAAQAAAJ9AVwACeHkAH5GpeAAgeZ8AH5GokgP/////AAAAAJFAVwACeHkAP5EAQKIAQFCfUAT//////////wAAAAAAAAAAkVCoBP//////////AAAAAAAAAACReAT//////////wAAAAAAAAAAkXkAQKIAQFCfAEBQnwA/kamSSgQAAAAAAAAAgAAAAAAAAAAAMBQEAAAAAAAAAAABAAAAAAAAAJ9AVwACeHkAP5GpeABAeZ8AP5GokgT//////////wAAAAAAAAAAkUBXAAJ4eR+RIKIgUJ9QAv//AACRUKgC//8AAJF4Av//AACReSCiIFCfIFCfH5GpkkoCAIAAADAIAgAAAQCfQFcAAnh5H5GpeCB5nx+RqJIC//8AAJFAVwACeHkXkal4GHmfF5GokgH/AJFAVwACeHkXkRiiGFCfUAH/AJFQqAH/AJF4Af8AkXkYohhQnxhQnxeRqZJKAYAAMAYBAAGfQFcAAXgB/wCREFBKECgMShGRUZ5QEaki9EVAVwABeAH/AJEQUEoQKAxKEZFRnlARqSL0RUBXAAF4Av//AACREFBKECgMShGRUZ5QEaki9EVAVwABeAL//wAAkRBQShAoDEoRkVGeUBGpIvRFQFcAAXgD/////wAAAACREFBKECgMShGRUZ5QEaki9EVAVwABeAP/////AAAAAJEQUEoQKAxKEZFRnlARqSL0RUBXAAF4BP//////////AAAAAAAAAACREFBKECgMShGRUZ5QEaki9EVAVwABeAT//////////wAAAAAAAAAAkRBQShAoDEoRkVGeUBGpIvRFQFcAAXhKAgAAAIADAAAAgAAAAAC7Jg4D/////wAAAACRIkcMQlZhbHVlIG91dCBvZiByYW5nZSwgbXVzdCBiZSBiZXR3ZWVuIGludC5NaW5WYWx1ZSBhbmQgaW50Lk1heFZhbHVlLjoQUEoQKAxKEZFRnlARqSL0RUBXAAF4ShAqBUUiCEqdkRAoBAlACECEnDzf")); + public static Neo.SmartContract.NefFile Nef => Neo.IO.Helper.AsSerializable(Convert.FromBase64String(@"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AAAAAAAAkVCoBP//////////AAAAAAAAAACReAT//////////wAAAAAAAAAAkXkAQFCfAD+RqZIE//////////8AAAAAAAAAAJFAVwACeHkfkVAC//8AAJFQqAL//wAAkXgC//8AAJF5IFCfH5GpkkoCAIAAADAIAgAAAQCfQFcAAnh5H5FQAv//AACRUKgC//8AAJF4Av//AACReSBQnx+RqZIC//8AAJFAVwACeHkXkVAB/wCRUKgB/wCReAH/AJF5GFCfF5GpkgH/AJFAVwACeHkXkVAB/wCRUKgB/wCReAH/AJF5GFCfF5GpkkoBgAAwBgEAAZ9AVwACeHkAH5EAIKIAIFCfUAP/////AAAAAJFQqAP/////AAAAAJF4A/////8AAAAAkXkAIKIAIFCfACBQnwAfkamSSgMAAACAAAAAADAMAwAAAAABAAAAn0BXAAJ4eQAfkal4ACB5nwAfkaiSA/////8AAAAAkUBXAAJ4eQA/kQBAogBAUJ9QBP//////////AAAAAAAAAACRUKgE//////////8AAAAAAAAAAJF4BP//////////AAAAAAAAAACReQBAogBAUJ8AQFCfAD+RqZJKBAAAAAAAAACAAAAAAAAAAAAwFAQAAAAAAAAAAAEAAAAAAAAAn0BXAAJ4eQA/kal4AEB5nwA/kaiSBP//////////AAAAAAAAAACRQFcAAnh5H5EgoiBQn1AC//8AAJFQqAL//wAAkXgC//8AAJF5IKIgUJ8gUJ8fkamSSgIAgAAAMAgCAAABAJ9AVwACeHkfkal4IHmfH5GokgL//wAAkUBXAAJ4eReRqXgYeZ8XkaiSAf8AkUBXAAJ4eReRGKIYUJ9QAf8AkVCoAf8AkXgB/wCReRiiGFCfGFCfF5GpkkoBgAAwBgEAAZ9AVwABeAH/AJEQUEoQKAxKEZFRnlARqSL0RUBXAAF4Af8AkRBQShAoDEoRkVGeUBGpIvRFQFcAAXgC//8AAJEQUEoQKAxKEZFRnlARqSL0RUBXAAF4Av//AACREFBKECgMShGRUZ5QEaki9EVAVwABeAP/////AAAAAJEQUEoQKAxKEZFRnlARqSL0RUBXAAF4A/////8AAAAAkRBQShAoDEoRkVGeUBGpIvRFQFcAAXgE//////////8AAAAAAAAAAJEQUEoQKAxKEZFRnlARqSL0RUBXAAF4BP//////////AAAAAAAAAACREFBKECgMShGRUZ5QEaki9EVAVwABeEoCAAAAgAMAAACAAAAAALsmDgP/////AAAAAJEiRwxCVmFsdWUgb3V0IG9mIHJhbmdlLCBtdXN0IGJlIGJldHdlZW4gaW50Lk1pblZhbHVlIGFuZCBpbnQuTWF4VmFsdWUuOhBQShAoDEoRkVGeUBGpIvRFQFcAAXhKECoFRSIISp2RECgECUAIQIplBfI=")); #endregion diff --git a/tests/Neo.Compiler.CSharp.UnitTests/TestingArtifacts/Contract_Math.cs b/tests/Neo.Compiler.CSharp.UnitTests/TestingArtifacts/Contract_Math.cs index 898b9c835..09f9ca01b 100644 --- a/tests/Neo.Compiler.CSharp.UnitTests/TestingArtifacts/Contract_Math.cs +++ b/tests/Neo.Compiler.CSharp.UnitTests/TestingArtifacts/Contract_Math.cs @@ -10,12 +10,12 @@ public abstract class Contract_Math(Neo.SmartContract.Testing.SmartContractIniti { #region Compiled data - public static Neo.SmartContract.Manifest.ContractManifest Manifest => Neo.SmartContract.Manifest.ContractManifest.Parse(@"{""name"":""Contract_Math"",""groups"":[],""features"":{},""supportedstandards"":[],""abi"":{""methods"":[{""name"":""max"",""parameters"":[{""name"":""a"",""type"":""Integer""},{""name"":""b"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":0,""safe"":false},{""name"":""min"",""parameters"":[{""name"":""a"",""type"":""Integer""},{""name"":""b"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":7,""safe"":false},{""name"":""sign"",""parameters"":[{""name"":""a"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":14,""safe"":false},{""name"":""abs"",""parameters"":[{""name"":""a"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":20,""safe"":false},{""name"":""bigMul"",""parameters"":[{""name"":""a"",""type"":""Integer""},{""name"":""b"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":26,""safe"":false},{""name"":""divRemByte"",""parameters"":[{""name"":""left"",""type"":""Integer""},{""name"":""right"",""type"":""Integer""}],""returntype"":""Array"",""offset"":64,""safe"":false},{""name"":""divRemShort"",""parameters"":[{""name"":""left"",""type"":""Integer""},{""name"":""right"",""type"":""Integer""}],""returntype"":""Array"",""offset"":91,""safe"":false},{""name"":""divRemInt"",""parameters"":[{""name"":""left"",""type"":""Integer""},{""name"":""right"",""type"":""Integer""}],""returntype"":""Array"",""offset"":122,""safe"":false},{""name"":""divRemLong"",""parameters"":[{""name"":""left"",""type"":""Integer""},{""name"":""right"",""type"":""Integer""}],""returntype"":""Array"",""offset"":159,""safe"":false},{""name"":""divRemSbyte"",""parameters"":[{""name"":""left"",""type"":""Integer""},{""name"":""right"",""type"":""Integer""}],""returntype"":""Array"",""offset"":208,""safe"":false},{""name"":""divRemUshort"",""parameters"":[{""name"":""left"",""type"":""Integer""},{""name"":""right"",""type"":""Integer""}],""returntype"":""Array"",""offset"":236,""safe"":false},{""name"":""divRemUint"",""parameters"":[{""name"":""left"",""type"":""Integer""},{""name"":""right"",""type"":""Integer""}],""returntype"":""Array"",""offset"":265,""safe"":false},{""name"":""divRemUlong"",""parameters"":[{""name"":""left"",""type"":""Integer""},{""name"":""right"",""type"":""Integer""}],""returntype"":""Array"",""offset"":298,""safe"":false},{""name"":""clampByte"",""parameters"":[{""name"":""value"",""type"":""Integer""},{""name"":""min"",""type"":""Integer""},{""name"":""max"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":339,""safe"":false},{""name"":""clampSByte"",""parameters"":[{""name"":""value"",""type"":""Integer""},{""name"":""min"",""type"":""Integer""},{""name"":""max"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":354,""safe"":false},{""name"":""clampShort"",""parameters"":[{""name"":""value"",""type"":""Integer""},{""name"":""min"",""type"":""Integer""},{""name"":""max"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":369,""safe"":false},{""name"":""clampUShort"",""parameters"":[{""name"":""value"",""type"":""Integer""},{""name"":""min"",""type"":""Integer""},{""name"":""max"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":384,""safe"":false},{""name"":""clampInt"",""parameters"":[{""name"":""value"",""type"":""Integer""},{""name"":""min"",""type"":""Integer""},{""name"":""max"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":399,""safe"":false},{""name"":""clampUInt"",""parameters"":[{""name"":""value"",""type"":""Integer""},{""name"":""min"",""type"":""Integer""},{""name"":""max"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":414,""safe"":false},{""name"":""clampLong"",""parameters"":[{""name"":""value"",""type"":""Integer""},{""name"":""min"",""type"":""Integer""},{""name"":""max"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":429,""safe"":false},{""name"":""clampULong"",""parameters"":[{""name"":""value"",""type"":""Integer""},{""name"":""min"",""type"":""Integer""},{""name"":""max"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":444,""safe"":false}],""events"":[]},""permissions"":[],""trusts"":[],""extra"":{""nef"":{""optimization"":""All""}}}"); + public static Neo.SmartContract.Manifest.ContractManifest Manifest => Neo.SmartContract.Manifest.ContractManifest.Parse(@"{""name"":""Contract_Math"",""groups"":[],""features"":{},""supportedstandards"":[],""abi"":{""methods"":[{""name"":""max"",""parameters"":[{""name"":""a"",""type"":""Integer""},{""name"":""b"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":0,""safe"":false},{""name"":""min"",""parameters"":[{""name"":""a"",""type"":""Integer""},{""name"":""b"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":7,""safe"":false},{""name"":""sign"",""parameters"":[{""name"":""a"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":14,""safe"":false},{""name"":""abs"",""parameters"":[{""name"":""a"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":20,""safe"":false},{""name"":""bigMul"",""parameters"":[{""name"":""a"",""type"":""Integer""},{""name"":""b"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":26,""safe"":false},{""name"":""divRemByte"",""parameters"":[{""name"":""left"",""type"":""Integer""},{""name"":""right"",""type"":""Integer""}],""returntype"":""Array"",""offset"":64,""safe"":false},{""name"":""divRemShort"",""parameters"":[{""name"":""left"",""type"":""Integer""},{""name"":""right"",""type"":""Integer""}],""returntype"":""Array"",""offset"":78,""safe"":false},{""name"":""divRemInt"",""parameters"":[{""name"":""left"",""type"":""Integer""},{""name"":""right"",""type"":""Integer""}],""returntype"":""Array"",""offset"":92,""safe"":false},{""name"":""divRemLong"",""parameters"":[{""name"":""left"",""type"":""Integer""},{""name"":""right"",""type"":""Integer""}],""returntype"":""Array"",""offset"":106,""safe"":false},{""name"":""divRemSbyte"",""parameters"":[{""name"":""left"",""type"":""Integer""},{""name"":""right"",""type"":""Integer""}],""returntype"":""Array"",""offset"":120,""safe"":false},{""name"":""divRemUshort"",""parameters"":[{""name"":""left"",""type"":""Integer""},{""name"":""right"",""type"":""Integer""}],""returntype"":""Array"",""offset"":134,""safe"":false},{""name"":""divRemUint"",""parameters"":[{""name"":""left"",""type"":""Integer""},{""name"":""right"",""type"":""Integer""}],""returntype"":""Array"",""offset"":148,""safe"":false},{""name"":""divRemUlong"",""parameters"":[{""name"":""left"",""type"":""Integer""},{""name"":""right"",""type"":""Integer""}],""returntype"":""Array"",""offset"":162,""safe"":false},{""name"":""clampByte"",""parameters"":[{""name"":""value"",""type"":""Integer""},{""name"":""min"",""type"":""Integer""},{""name"":""max"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":176,""safe"":false},{""name"":""clampSByte"",""parameters"":[{""name"":""value"",""type"":""Integer""},{""name"":""min"",""type"":""Integer""},{""name"":""max"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":191,""safe"":false},{""name"":""clampShort"",""parameters"":[{""name"":""value"",""type"":""Integer""},{""name"":""min"",""type"":""Integer""},{""name"":""max"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":206,""safe"":false},{""name"":""clampUShort"",""parameters"":[{""name"":""value"",""type"":""Integer""},{""name"":""min"",""type"":""Integer""},{""name"":""max"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":221,""safe"":false},{""name"":""clampInt"",""parameters"":[{""name"":""value"",""type"":""Integer""},{""name"":""min"",""type"":""Integer""},{""name"":""max"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":236,""safe"":false},{""name"":""clampUInt"",""parameters"":[{""name"":""value"",""type"":""Integer""},{""name"":""min"",""type"":""Integer""},{""name"":""max"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":251,""safe"":false},{""name"":""clampLong"",""parameters"":[{""name"":""value"",""type"":""Integer""},{""name"":""min"",""type"":""Integer""},{""name"":""max"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":266,""safe"":false},{""name"":""clampULong"",""parameters"":[{""name"":""value"",""type"":""Integer""},{""name"":""min"",""type"":""Integer""},{""name"":""max"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":281,""safe"":false}],""events"":[]},""permissions"":[],""trusts"":[],""extra"":{""nef"":{""optimization"":""All""}}}"); /// /// Optimization: "All" /// - public static Neo.SmartContract.NefFile Nef => Neo.IO.Helper.AsSerializable(Convert.FromBase64String(@"TkVGM1Rlc3RpbmdFbmdpbmUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP3LAVcAAnl4ukBXAAJ5eLlAVwABeJlAVwABeJpAVwACeXigSgMAAAAAAAAAgAQAAAAAAAAAgAAAAAAAAAAAuyQDOkBXAAJ5eEpRTqFKUaBRUJ9KEAEAAbskAzoSwEBXAAJ5eEpRTqFKUaBRUJ9KAQCAAgCAAAC7JAM6EsBAVwACeXhKUU6hSlGgUVCfSgIAAACAAwAAAIAAAAAAuyQDOhLAQFcAAnl4SlFOoUpRoFFQn0oDAAAAAAAAAIAEAAAAAAAAAIAAAAAAAAAAALskAzoSwEBXAAJ5eEpRTqFKUaBRUJ9KAIABgAC7JAM6EsBAVwACeXhKUU6hSlGgUVCfShACAAABALskAzoSwEBXAAJ5eEpRTqFKUaBRUJ9KEAMAAAAAAQAAALskAzoSwEBXAAJ5eEpRTqFKUaBRUJ9KEAQAAAAAAAAAAAEAAAAAAAAAuyQDOhLAQFcAA3h5ektLMgM6U7q5QFcAA3h5ektLMgM6U7q5QFcAA3h5ektLMgM6U7q5QFcAA3h5ektLMgM6U7q5QFcAA3h5ektLMgM6U7q5QFcAA3h5ektLMgM6U7q5QFcAA3h5ektLMgM6U7q5QFcAA3h5ektLMgM6U7q5QNYWGhM=")); + public static Neo.SmartContract.NefFile Nef => Neo.IO.Helper.AsSerializable(Convert.FromBase64String(@"TkVGM1Rlc3RpbmdFbmdpbmUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP0oAVcAAnl4ukBXAAJ5eLlAVwABeJlAVwABeJpAVwACeXigSgMAAAAAAAAAgAQAAAAAAAAAgAAAAAAAAAAAuyQDOkBXAAJ5eEoSTaFTohLAQFcAAnl4ShJNoVOiEsBAVwACeXhKEk2hU6ISwEBXAAJ5eEoSTaFTohLAQFcAAnl4ShJNoVOiEsBAVwACeXhKEk2hU6ISwEBXAAJ5eEoSTaFTohLAQFcAAnl4ShJNoVOiEsBAVwADeHl6S0syAzpTurlAVwADeHl6S0syAzpTurlAVwADeHl6S0syAzpTurlAVwADeHl6S0syAzpTurlAVwADeHl6S0syAzpTurlAVwADeHl6S0syAzpTurlAVwADeHl6S0syAzpTurlAVwADeHl6S0syAzpTurlA6UPMmg==")); #endregion diff --git a/tests/Neo.Compiler.CSharp.UnitTests/UnitTest_Integer.cs b/tests/Neo.Compiler.CSharp.UnitTests/UnitTest_Integer.cs index f6acdfdf3..f1501e4a2 100644 --- a/tests/Neo.Compiler.CSharp.UnitTests/UnitTest_Integer.cs +++ b/tests/Neo.Compiler.CSharp.UnitTests/UnitTest_Integer.cs @@ -15,7 +15,7 @@ public void divRemByte_test() var expected = byte.DivRem(10, 4); Assert.AreEqual(expected.Remainder, (byte)(BigInteger)result[0]); Assert.AreEqual(expected.Quotient, (byte)(BigInteger)result[1]); - AssertGasConsumed(1110150); + AssertGasConsumed(1109280); } [TestMethod] @@ -25,17 +25,26 @@ public void divRemShort_test() var expected = short.DivRem(10, 3); Assert.AreEqual(expected.Remainder, checked((short)(BigInteger)result[0])); Assert.AreEqual(expected.Quotient, checked((short)(BigInteger)result[1])); - AssertGasConsumed(1110150); + AssertGasConsumed(1109280); } [TestMethod] public void divRemInt_test() { - var result = Contract.DivRemInt(10, 3); - var expected = int.DivRem(10, 3); - Assert.AreEqual(expected.Remainder, (int)(BigInteger)result[0]); - Assert.AreEqual(expected.Quotient, (int)(BigInteger)result[1]); - AssertGasConsumed(1110150); + int l = 10, r = 3; + foreach (int lSign in new int[] { -1, 1 }) + foreach (int rSign in new int[] { -1, 1 }) + { + var result = Contract.DivRemInt(l * lSign, r * rSign)!; + var expected = int.DivRem(l * lSign, r * rSign); + Assert.AreEqual(expected.Remainder, (int)(BigInteger)result[0]); + Assert.AreEqual(expected.Quotient, (int)(BigInteger)result[1]); + AssertGasConsumed(1109280); + } + + var overflowResult = Contract.DivRemByte(int.MinValue, -1)!; + Assert.AreEqual(0, (int)(BigInteger)overflowResult[0]); + Assert.AreEqual(-(BigInteger)int.MinValue, (BigInteger)overflowResult[1]); // no exception } [TestMethod] @@ -45,7 +54,7 @@ public void divRemLong_test() var expected = long.DivRem(10, 3); Assert.AreEqual(expected.Remainder, (long)(BigInteger)result[0]); Assert.AreEqual(expected.Quotient, (long)(BigInteger)result[1]); - AssertGasConsumed(1110240); + AssertGasConsumed(1109280); } [TestMethod] @@ -55,7 +64,7 @@ public void divRemSByte_test() var expected = sbyte.DivRem(10, 3); Assert.AreEqual(expected.Remainder, (sbyte)(BigInteger)result[0]); Assert.AreEqual(expected.Quotient, (sbyte)(BigInteger)result[1]); - AssertGasConsumed(1110150); + AssertGasConsumed(1109280); } [TestMethod] @@ -65,7 +74,7 @@ public void divRemUShort_test() var expected = ushort.DivRem(10, 3); Assert.AreEqual(expected.Remainder, (ushort)(BigInteger)result[0]); Assert.AreEqual(expected.Quotient, (ushort)(BigInteger)result[1]); - AssertGasConsumed(1110150); + AssertGasConsumed(1109280); } [TestMethod] @@ -75,7 +84,7 @@ public void divRemUInt_test() var expected = uint.DivRem(10, 3); Assert.AreEqual(expected.Remainder, (uint)(BigInteger)result[0]); Assert.AreEqual(expected.Quotient, (uint)(BigInteger)result[1]); - AssertGasConsumed(1110150); + AssertGasConsumed(1109280); } [TestMethod] @@ -85,14 +94,14 @@ public void divRemULong_test() var expected = ulong.DivRem(10, 3); Assert.AreEqual(expected.Remainder, (ulong)(BigInteger)result[0]); Assert.AreEqual(expected.Quotient, (ulong)(BigInteger)result[1]); - AssertGasConsumed(1110240); + AssertGasConsumed(1109280); } [TestMethod] public void divRemZeroU_test() { Assert.ThrowsException(() => Contract.DivRemUint((uint)10, (uint)0)); - AssertGasConsumed(1047540); + AssertGasConsumed(1047510); } [TestMethod] @@ -102,7 +111,7 @@ public void TestDivRemUlong_Normal() var expected = ulong.DivRem(10, 3); Assert.AreEqual(expected.Remainder, (ulong)(BigInteger)result[0]); Assert.AreEqual(expected.Quotient, (ulong)(BigInteger)result[1]); - AssertGasConsumed(1110240); + AssertGasConsumed(1109280); } [TestMethod] @@ -112,7 +121,7 @@ public void TestDivRemUlong_MaxValue() var expected = ulong.DivRem(ulong.MaxValue, 2); Assert.AreEqual(expected.Remainder, (ulong)(BigInteger)result[0]); Assert.AreEqual(expected.Quotient, (ulong)(BigInteger)result[1]); - AssertGasConsumed(1110330); + AssertGasConsumed(1109370); } [TestMethod] @@ -122,7 +131,7 @@ public void TestDivRemUlong_DivideByOne() var expected = ulong.DivRem(ulong.MaxValue, 1); Assert.AreEqual(expected.Remainder, (ulong)(BigInteger)result[0]); Assert.AreEqual(expected.Quotient, (ulong)(BigInteger)result[1]); - AssertGasConsumed(1110330); + AssertGasConsumed(1109370); } [TestMethod] @@ -132,7 +141,7 @@ public void TestDivRemUlong_DividendSmallerThanDivisor() var expected = ulong.DivRem(3, 10); Assert.AreEqual(expected.Remainder, (ulong)(BigInteger)result[0]); Assert.AreEqual(expected.Quotient, (ulong)(BigInteger)result[1]); - AssertGasConsumed(1110240); + AssertGasConsumed(1109280); } [TestMethod] @@ -142,7 +151,7 @@ public void TestDivRemUlong_DivideByMaxValue() var expected = ulong.DivRem(10, ulong.MaxValue); Assert.AreEqual(expected.Remainder, (ulong)(BigInteger)result[0]); Assert.AreEqual(expected.Quotient, (ulong)(BigInteger)result[1]); - AssertGasConsumed(1110330); + AssertGasConsumed(1109370); } [TestMethod] @@ -166,7 +175,7 @@ public void TestDivRemUlong_MaxValueDividedByMaxValue() var expected = ulong.DivRem(ulong.MaxValue, ulong.MaxValue); Assert.AreEqual(expected.Remainder, (ulong)(BigInteger)result[0]); Assert.AreEqual(expected.Quotient, (ulong)(BigInteger)result[1]); - AssertGasConsumed(1110420); + AssertGasConsumed(1109460); } [TestMethod] @@ -176,7 +185,7 @@ public void TestDivRemUlong_MaxValueMinusOneDividedByMaxValue() var expected = ulong.DivRem(ulong.MaxValue - 1, ulong.MaxValue); Assert.AreEqual(expected.Remainder, (ulong)(BigInteger)result[0]); Assert.AreEqual(expected.Quotient, (ulong)(BigInteger)result[1]); - AssertGasConsumed(1110420); + AssertGasConsumed(1109460); } [TestMethod] @@ -186,7 +195,7 @@ public void TestDivRemUlong_MaxValueDividedByTwo() var expected = ulong.DivRem(ulong.MaxValue, 2UL); Assert.AreEqual(expected.Remainder, (ulong)(BigInteger)result[0]); Assert.AreEqual(expected.Quotient, (ulong)(BigInteger)result[1]); - AssertGasConsumed(1110330); + AssertGasConsumed(1109370); } [TestMethod] @@ -198,7 +207,7 @@ public void TestDivRemUlong_LargeNumbersDivisibleWithoutRemainder() var expected = ulong.DivRem(large1, large2); Assert.AreEqual(expected.Remainder, (ulong)(BigInteger)result[0]); Assert.AreEqual(expected.Quotient, (ulong)(BigInteger)result[1]); - AssertGasConsumed(1110240); + AssertGasConsumed(1109280); } [TestMethod] @@ -210,7 +219,7 @@ public void TestDivRemUlong_ConsecutiveLargeNumbers() var expected = ulong.DivRem(large1, large2); Assert.AreEqual(expected.Remainder, (ulong)(BigInteger)result[0]); Assert.AreEqual(expected.Quotient, (ulong)(BigInteger)result[1]); - AssertGasConsumed(1110420); + AssertGasConsumed(1109460); } [TestMethod] @@ -222,7 +231,7 @@ public void TestDivRemUlong_DividendJustSmallerThanDivisor() var expected = ulong.DivRem(dividend, divisor); Assert.AreEqual(expected.Remainder, (ulong)(BigInteger)result[0]); Assert.AreEqual(expected.Quotient, (ulong)(BigInteger)result[1]); - AssertGasConsumed(1110330); + AssertGasConsumed(1109370); } [TestMethod] @@ -234,7 +243,7 @@ public void TestDivRemUlong_DividendJustLargerThanDivisor() var expected = ulong.DivRem(dividend, divisor); Assert.AreEqual(expected.Remainder, (ulong)(BigInteger)result[0]); Assert.AreEqual(expected.Quotient, (ulong)(BigInteger)result[1]); - AssertGasConsumed(1110420); + AssertGasConsumed(1109460); } [TestMethod] @@ -246,7 +255,7 @@ public void TestDivRemUlong_LargePrimeNumbers() var expected = ulong.DivRem(largePrime1, largePrime2); Assert.AreEqual(expected.Remainder, (ulong)(BigInteger)result[0]); Assert.AreEqual(expected.Quotient, (ulong)(BigInteger)result[1]); - AssertGasConsumed(1110420); + AssertGasConsumed(1109460); } [TestMethod] @@ -271,7 +280,7 @@ public void TestDivRemUlong_AlternatingBits() var expected = ulong.DivRem(alternatingBits, 3); Assert.AreEqual(expected.Remainder, (ulong)(BigInteger)result[0]); Assert.AreEqual(expected.Quotient, (ulong)(BigInteger)result[1]); - AssertGasConsumed(1110330); + AssertGasConsumed(1109370); } [TestMethod] diff --git a/tests/Neo.Compiler.CSharp.UnitTests/UnitTest_Math.cs b/tests/Neo.Compiler.CSharp.UnitTests/UnitTest_Math.cs index f4d8879e8..4f9547df5 100644 --- a/tests/Neo.Compiler.CSharp.UnitTests/UnitTest_Math.cs +++ b/tests/Neo.Compiler.CSharp.UnitTests/UnitTest_Math.cs @@ -67,7 +67,7 @@ public void divRemByte_test() var expected = Math.DivRem((byte)10, (byte)4); Assert.AreEqual(expected.Remainder, checked((byte)(BigInteger)result[0])); Assert.AreEqual(expected.Quotient, checked((byte)(BigInteger)result[1])); - AssertGasConsumed(1110150); + AssertGasConsumed(1109280); } [TestMethod] @@ -77,7 +77,7 @@ public void divRemShort_test() var expected = Math.DivRem((short)10, (short)3); Assert.AreEqual(expected.Remainder, checked((short)(BigInteger)result[0])); Assert.AreEqual(expected.Quotient, checked((short)(BigInteger)result[1])); - AssertGasConsumed(1110150); + AssertGasConsumed(1109280); } [TestMethod] @@ -87,7 +87,7 @@ public void divRemInt_test() var expected = Math.DivRem((int)10, (int)3); Assert.AreEqual(expected.Remainder, checked((int)(BigInteger)result[0])); Assert.AreEqual(expected.Quotient, checked((int)(BigInteger)result[1])); - AssertGasConsumed(1110150); + AssertGasConsumed(1109280); } [TestMethod] @@ -97,7 +97,7 @@ public void divRemLong_test() var expected = Math.DivRem((long)10, (long)3); Assert.AreEqual(expected.Remainder, checked((long)(BigInteger)result[0])); Assert.AreEqual(expected.Quotient, checked((long)(BigInteger)result[1])); - AssertGasConsumed(1110240); + AssertGasConsumed(1109280); } [TestMethod] @@ -107,7 +107,7 @@ public void divRemSByte_test() var expected = Math.DivRem((sbyte)10, (sbyte)3); Assert.AreEqual(expected.Remainder, checked((sbyte)(BigInteger)result[0])); Assert.AreEqual(expected.Quotient, checked((sbyte)(BigInteger)result[1])); - AssertGasConsumed(1110150); + AssertGasConsumed(1109280); } [TestMethod] @@ -117,7 +117,7 @@ public void divRemUShort_test() var expected = Math.DivRem((ushort)10, (ushort)3); Assert.AreEqual(expected.Remainder, checked((ushort)(BigInteger)result[0])); Assert.AreEqual(expected.Quotient, checked((ushort)(BigInteger)result[1])); - AssertGasConsumed(1110150); + AssertGasConsumed(1109280); } [TestMethod] @@ -127,7 +127,7 @@ public void divRemUInt_test() var expected = Math.DivRem((uint)10, (uint)3); Assert.AreEqual(expected.Remainder, checked((uint)(BigInteger)result[0])); Assert.AreEqual(expected.Quotient, checked((uint)(BigInteger)result[1])); - AssertGasConsumed(1110150); + AssertGasConsumed(1109280); } [TestMethod] @@ -137,14 +137,14 @@ public void divRemULong_test() var expected = Math.DivRem((ulong)10, (ulong)3); Assert.AreEqual(expected.Remainder, checked((ulong)(BigInteger)result[0])); Assert.AreEqual(expected.Quotient, checked((ulong)(BigInteger)result[1])); - AssertGasConsumed(1110240); + AssertGasConsumed(1109280); } [TestMethod] public void divRemZeroU_test() { Assert.ThrowsException(() => Contract.DivRemUint((uint)10, (uint)0)); - AssertGasConsumed(1047540); + AssertGasConsumed(1047510); } [TestMethod] @@ -154,7 +154,7 @@ public void TestDivRemUlong_Normal() var expected = Math.DivRem((ulong)10, (ulong)3); Assert.AreEqual(expected.Remainder, checked((ulong)(BigInteger)result[0])); Assert.AreEqual(expected.Quotient, checked((ulong)(BigInteger)result[1])); - AssertGasConsumed(1110240); + AssertGasConsumed(1109280); } [TestMethod] @@ -164,7 +164,7 @@ public void TestDivRemUlong_MaxValue() var expected = Math.DivRem(ulong.MaxValue, (ulong)2); Assert.AreEqual(expected.Remainder, checked((ulong)(BigInteger)result[0])); Assert.AreEqual(expected.Quotient, checked((ulong)(BigInteger)result[1])); - AssertGasConsumed(1110330); + AssertGasConsumed(1109370); } [TestMethod] @@ -174,7 +174,7 @@ public void TestDivRemUlong_DivideByOne() var expected = Math.DivRem(ulong.MaxValue, (ulong)1); Assert.AreEqual(expected.Remainder, checked((ulong)(BigInteger)result[0])); Assert.AreEqual(expected.Quotient, checked((ulong)(BigInteger)result[1])); - AssertGasConsumed(1110330); + AssertGasConsumed(1109370); } [TestMethod] @@ -184,7 +184,7 @@ public void TestDivRemUlong_DividendSmallerThanDivisor() var expected = Math.DivRem((ulong)3, (ulong)10); Assert.AreEqual(expected.Remainder, checked((ulong)(BigInteger)result[0])); Assert.AreEqual(expected.Quotient, checked((ulong)(BigInteger)result[1])); - AssertGasConsumed(1110240); + AssertGasConsumed(1109280); } [TestMethod] @@ -194,7 +194,7 @@ public void TestDivRemUlong_DivideByMaxValue() var expected = Math.DivRem((ulong)10, ulong.MaxValue); Assert.AreEqual(expected.Remainder, checked((ulong)(BigInteger)result[0])); Assert.AreEqual(expected.Quotient, checked((ulong)(BigInteger)result[1])); - AssertGasConsumed(1110330); + AssertGasConsumed(1109370); } [TestMethod] @@ -218,7 +218,7 @@ public void TestDivRemUlong_MaxValueDividedByMaxValue() var expected = Math.DivRem(ulong.MaxValue, ulong.MaxValue); Assert.AreEqual(expected.Remainder, checked((ulong)(BigInteger)result[0])); Assert.AreEqual(expected.Quotient, checked((ulong)(BigInteger)result[1])); - AssertGasConsumed(1110420); + AssertGasConsumed(1109460); } [TestMethod] @@ -228,7 +228,7 @@ public void TestDivRemUlong_MaxValueMinusOneDividedByMaxValue() var expected = Math.DivRem(ulong.MaxValue - 1, ulong.MaxValue); Assert.AreEqual(expected.Remainder, checked((ulong)(BigInteger)result[0])); Assert.AreEqual(expected.Quotient, checked((ulong)(BigInteger)result[1])); - AssertGasConsumed(1110420); + AssertGasConsumed(1109460); } [TestMethod] @@ -238,7 +238,7 @@ public void TestDivRemUlong_MaxValueDividedByTwo() var expected = Math.DivRem(ulong.MaxValue, 2UL); Assert.AreEqual(expected.Remainder, checked((ulong)(BigInteger)result[0])); Assert.AreEqual(expected.Quotient, checked((ulong)(BigInteger)result[1])); - AssertGasConsumed(1110330); + AssertGasConsumed(1109370); } [TestMethod] @@ -250,7 +250,7 @@ public void TestDivRemUlong_LargeNumbersDivisibleWithoutRemainder() var expected = Math.DivRem(large1, large2); Assert.AreEqual(expected.Remainder, checked((ulong)(BigInteger)result[0])); Assert.AreEqual(expected.Quotient, checked((ulong)(BigInteger)result[1])); - AssertGasConsumed(1110240); + AssertGasConsumed(1109280); } [TestMethod] @@ -262,7 +262,7 @@ public void TestDivRemUlong_ConsecutiveLargeNumbers() var expected = Math.DivRem(large1, large2); Assert.AreEqual(expected.Remainder, checked((ulong)(BigInteger)result[0])); Assert.AreEqual(expected.Quotient, checked((ulong)(BigInteger)result[1])); - AssertGasConsumed(1110420); + AssertGasConsumed(1109460); } [TestMethod] @@ -274,7 +274,7 @@ public void TestDivRemUlong_DividendJustSmallerThanDivisor() var expected = Math.DivRem(dividend, divisor); Assert.AreEqual(expected.Remainder, checked((ulong)(BigInteger)result[0])); Assert.AreEqual(expected.Quotient, checked((ulong)(BigInteger)result[1])); - AssertGasConsumed(1110330); + AssertGasConsumed(1109370); } [TestMethod] @@ -286,7 +286,7 @@ public void TestDivRemUlong_DividendJustLargerThanDivisor() var expected = Math.DivRem(dividend, divisor); Assert.AreEqual(expected.Remainder, checked((ulong)(BigInteger)result[0])); Assert.AreEqual(expected.Quotient, checked((ulong)(BigInteger)result[1])); - AssertGasConsumed(1110420); + AssertGasConsumed(1109460); } [TestMethod] @@ -298,7 +298,7 @@ public void TestDivRemUlong_LargePrimeNumbers() var expected = Math.DivRem(largePrime1, largePrime2); Assert.AreEqual(expected.Remainder, checked((ulong)(BigInteger)result[0])); Assert.AreEqual(expected.Quotient, checked((ulong)(BigInteger)result[1])); - AssertGasConsumed(1110420); + AssertGasConsumed(1109460); } [TestMethod] @@ -323,7 +323,7 @@ public void TestDivRemUlong_AlternatingBits() var expected = Math.DivRem(alternatingBits, 3); Assert.AreEqual(expected.Remainder, checked((ulong)(BigInteger)result[0])); Assert.AreEqual(expected.Quotient, checked((ulong)(BigInteger)result[1])); - AssertGasConsumed(1110330); + AssertGasConsumed(1109370); } [TestMethod]