Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduce fee (Step1) #1449

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
354 changes: 177 additions & 177 deletions src/neo/SmartContract/ApplicationEngine.OpCodePrices.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,185 +7,185 @@ partial class ApplicationEngine
{
public static readonly IReadOnlyDictionary<OpCode, long> OpCodePrices = new Dictionary<OpCode, long>
{
[OpCode.PUSHINT8] = 30,
[OpCode.PUSHINT16] = 30,
[OpCode.PUSHINT32] = 30,
[OpCode.PUSHINT64] = 30,
[OpCode.PUSHINT128] = 120,
[OpCode.PUSHINT256] = 120,
[OpCode.PUSHA] = 120,
[OpCode.PUSHNULL] = 30,
[OpCode.PUSHDATA1] = 180,
[OpCode.PUSHDATA2] = 13000,
[OpCode.PUSHDATA4] = 110000,
[OpCode.PUSHM1] = 30,
[OpCode.PUSH0] = 30,
[OpCode.PUSH1] = 30,
[OpCode.PUSH2] = 30,
[OpCode.PUSH3] = 30,
[OpCode.PUSH4] = 30,
[OpCode.PUSH5] = 30,
[OpCode.PUSH6] = 30,
[OpCode.PUSH7] = 30,
[OpCode.PUSH8] = 30,
[OpCode.PUSH9] = 30,
[OpCode.PUSH10] = 30,
[OpCode.PUSH11] = 30,
[OpCode.PUSH12] = 30,
[OpCode.PUSH13] = 30,
[OpCode.PUSH14] = 30,
[OpCode.PUSH15] = 30,
[OpCode.PUSH16] = 30,
[OpCode.NOP] = 30,
[OpCode.JMP] = 70,
[OpCode.JMP_L] = 70,
[OpCode.JMPIF] = 70,
[OpCode.JMPIF_L] = 70,
[OpCode.JMPIFNOT] = 70,
[OpCode.JMPIFNOT_L] = 70,
[OpCode.JMPEQ] = 70,
[OpCode.JMPEQ_L] = 70,
[OpCode.JMPNE] = 70,
[OpCode.JMPNE_L] = 70,
[OpCode.JMPGT] = 70,
[OpCode.JMPGT_L] = 70,
[OpCode.JMPGE] = 70,
[OpCode.JMPGE_L] = 70,
[OpCode.JMPLT] = 70,
[OpCode.JMPLT_L] = 70,
[OpCode.JMPLE] = 70,
[OpCode.JMPLE_L] = 70,
[OpCode.CALL] = 22000,
[OpCode.CALL_L] = 22000,
[OpCode.CALLA] = 22000,
[OpCode.THROW] = 30,
[OpCode.THROWIF] = 30,
[OpCode.THROWIFNOT] = 30,
[OpCode.PUSHINT8] = 3,
[OpCode.PUSHINT16] = 3,
[OpCode.PUSHINT32] = 3,
[OpCode.PUSHINT64] = 3,
[OpCode.PUSHINT128] = 12,
[OpCode.PUSHINT256] = 12,
[OpCode.PUSHA] = 12,
[OpCode.PUSHNULL] = 3,
[OpCode.PUSHDATA1] = 18,
[OpCode.PUSHDATA2] = 130,
[OpCode.PUSHDATA4] = 1100,
[OpCode.PUSHM1] = 3,
[OpCode.PUSH0] = 3,
[OpCode.PUSH1] = 3,
[OpCode.PUSH2] = 3,
[OpCode.PUSH3] = 3,
[OpCode.PUSH4] = 3,
[OpCode.PUSH5] = 3,
[OpCode.PUSH6] = 3,
[OpCode.PUSH7] = 3,
[OpCode.PUSH8] = 3,
[OpCode.PUSH9] = 3,
[OpCode.PUSH10] = 3,
[OpCode.PUSH11] = 3,
[OpCode.PUSH12] = 3,
[OpCode.PUSH13] = 3,
[OpCode.PUSH14] = 3,
[OpCode.PUSH15] = 3,
[OpCode.PUSH16] = 3,
[OpCode.NOP] = 3,
[OpCode.JMP] = 7,
[OpCode.JMP_L] = 7,
[OpCode.JMPIF] = 7,
[OpCode.JMPIF_L] = 7,
[OpCode.JMPIFNOT] = 7,
[OpCode.JMPIFNOT_L] = 7,
[OpCode.JMPEQ] = 7,
[OpCode.JMPEQ_L] = 7,
[OpCode.JMPNE] = 7,
[OpCode.JMPNE_L] = 7,
[OpCode.JMPGT] = 7,
[OpCode.JMPGT_L] = 7,
[OpCode.JMPGE] = 7,
[OpCode.JMPGE_L] = 7,
[OpCode.JMPLT] = 7,
[OpCode.JMPLT_L] = 7,
[OpCode.JMPLE] = 7,
[OpCode.JMPLE_L] = 7,
[OpCode.CALL] = 220,
[OpCode.CALL_L] = 220,
[OpCode.CALLA] = 220,
[OpCode.THROW] = 3,
bettybao1209 marked this conversation as resolved.
Show resolved Hide resolved
[OpCode.THROWIF] = 3,
[OpCode.THROWIFNOT] = 3,
[OpCode.RET] = 0,
[OpCode.SYSCALL] = 0,
[OpCode.DEPTH] = 60,
[OpCode.DROP] = 60,
[OpCode.NIP] = 60,
[OpCode.XDROP] = 400,
[OpCode.CLEAR] = 400,
[OpCode.DUP] = 60,
[OpCode.OVER] = 60,
[OpCode.PICK] = 60,
[OpCode.TUCK] = 60,
[OpCode.SWAP] = 60,
[OpCode.ROT] = 60,
[OpCode.ROLL] = 400,
[OpCode.REVERSE3] = 60,
[OpCode.REVERSE4] = 60,
[OpCode.REVERSEN] = 400,
[OpCode.INITSSLOT] = 400,
[OpCode.INITSLOT] = 800,
[OpCode.LDSFLD0] = 60,
[OpCode.LDSFLD1] = 60,
[OpCode.LDSFLD2] = 60,
[OpCode.LDSFLD3] = 60,
[OpCode.LDSFLD4] = 60,
[OpCode.LDSFLD5] = 60,
[OpCode.LDSFLD6] = 60,
[OpCode.LDSFLD] = 60,
[OpCode.STSFLD0] = 60,
[OpCode.STSFLD1] = 60,
[OpCode.STSFLD2] = 60,
[OpCode.STSFLD3] = 60,
[OpCode.STSFLD4] = 60,
[OpCode.STSFLD5] = 60,
[OpCode.STSFLD6] = 60,
[OpCode.STSFLD] = 60,
[OpCode.LDLOC0] = 60,
[OpCode.LDLOC1] = 60,
[OpCode.LDLOC2] = 60,
[OpCode.LDLOC3] = 60,
[OpCode.LDLOC4] = 60,
[OpCode.LDLOC5] = 60,
[OpCode.LDLOC6] = 60,
[OpCode.LDLOC] = 60,
[OpCode.STLOC0] = 60,
[OpCode.STLOC1] = 60,
[OpCode.STLOC2] = 60,
[OpCode.STLOC3] = 60,
[OpCode.STLOC4] = 60,
[OpCode.STLOC5] = 60,
[OpCode.STLOC6] = 60,
[OpCode.STLOC] = 60,
[OpCode.LDARG0] = 60,
[OpCode.LDARG1] = 60,
[OpCode.LDARG2] = 60,
[OpCode.LDARG3] = 60,
[OpCode.LDARG4] = 60,
[OpCode.LDARG5] = 60,
[OpCode.LDARG6] = 60,
[OpCode.LDARG] = 60,
[OpCode.STARG0] = 60,
[OpCode.STARG1] = 60,
[OpCode.STARG2] = 60,
[OpCode.STARG3] = 60,
[OpCode.STARG4] = 60,
[OpCode.STARG5] = 60,
[OpCode.STARG6] = 60,
[OpCode.STARG] = 60,
[OpCode.NEWBUFFER] = 80000,
[OpCode.MEMCPY] = 80000,
[OpCode.CAT] = 80000,
[OpCode.SUBSTR] = 80000,
[OpCode.LEFT] = 80000,
[OpCode.RIGHT] = 80000,
[OpCode.INVERT] = 100,
[OpCode.AND] = 200,
[OpCode.OR] = 200,
[OpCode.XOR] = 200,
[OpCode.EQUAL] = 200,
[OpCode.NOTEQUAL] = 200,
[OpCode.SIGN] = 100,
[OpCode.ABS] = 100,
[OpCode.NEGATE] = 100,
[OpCode.INC] = 100,
[OpCode.DEC] = 100,
[OpCode.ADD] = 200,
[OpCode.SUB] = 200,
[OpCode.MUL] = 300,
[OpCode.DIV] = 300,
[OpCode.MOD] = 300,
[OpCode.SHL] = 300,
[OpCode.SHR] = 300,
[OpCode.NOT] = 100,
[OpCode.BOOLAND] = 200,
[OpCode.BOOLOR] = 200,
[OpCode.NZ] = 100,
[OpCode.NUMEQUAL] = 200,
[OpCode.NUMNOTEQUAL] = 200,
[OpCode.LT] = 200,
[OpCode.LE] = 200,
[OpCode.GT] = 200,
[OpCode.GE] = 200,
[OpCode.MIN] = 200,
[OpCode.MAX] = 200,
[OpCode.WITHIN] = 200,
[OpCode.PACK] = 7000,
[OpCode.UNPACK] = 7000,
[OpCode.NEWARRAY0] = 400,
[OpCode.NEWARRAY] = 15000,
[OpCode.NEWARRAY_T] = 15000,
[OpCode.NEWSTRUCT0] = 400,
[OpCode.NEWSTRUCT] = 15000,
[OpCode.NEWMAP] = 200,
[OpCode.SIZE] = 150,
[OpCode.HASKEY] = 270000,
[OpCode.KEYS] = 500,
[OpCode.VALUES] = 7000,
[OpCode.PICKITEM] = 270000,
[OpCode.APPEND] = 15000,
[OpCode.SETITEM] = 270000,
[OpCode.REVERSEITEMS] = 500,
[OpCode.REMOVE] = 500,
[OpCode.CLEARITEMS] = 400,
[OpCode.ISNULL] = 60,
[OpCode.ISTYPE] = 60,
[OpCode.CONVERT] = 80000,
[OpCode.DEPTH] = 6,
[OpCode.DROP] = 6,
[OpCode.NIP] = 6,
[OpCode.XDROP] = 40,
[OpCode.CLEAR] = 40,
[OpCode.DUP] = 6,
[OpCode.OVER] = 6,
[OpCode.PICK] = 6,
[OpCode.TUCK] = 6,
[OpCode.SWAP] = 6,
[OpCode.ROT] = 6,
[OpCode.ROLL] = 40,
[OpCode.REVERSE3] = 6,
[OpCode.REVERSE4] = 6,
[OpCode.REVERSEN] = 40,
[OpCode.INITSSLOT] = 40,
[OpCode.INITSLOT] = 80,
[OpCode.LDSFLD0] = 6,
[OpCode.LDSFLD1] = 6,
[OpCode.LDSFLD2] = 6,
[OpCode.LDSFLD3] = 6,
[OpCode.LDSFLD4] = 6,
[OpCode.LDSFLD5] = 6,
[OpCode.LDSFLD6] = 6,
[OpCode.LDSFLD] = 6,
[OpCode.STSFLD0] = 6,
[OpCode.STSFLD1] = 6,
[OpCode.STSFLD2] = 6,
[OpCode.STSFLD3] = 6,
[OpCode.STSFLD4] = 6,
[OpCode.STSFLD5] = 6,
[OpCode.STSFLD6] = 6,
[OpCode.STSFLD] = 6,
[OpCode.LDLOC0] = 6,
[OpCode.LDLOC1] = 6,
[OpCode.LDLOC2] = 6,
[OpCode.LDLOC3] = 6,
[OpCode.LDLOC4] = 6,
[OpCode.LDLOC5] = 6,
[OpCode.LDLOC6] = 6,
[OpCode.LDLOC] = 6,
[OpCode.STLOC0] = 6,
[OpCode.STLOC1] = 6,
[OpCode.STLOC2] = 6,
[OpCode.STLOC3] = 6,
[OpCode.STLOC4] = 6,
[OpCode.STLOC5] = 6,
[OpCode.STLOC6] = 6,
[OpCode.STLOC] = 6,
[OpCode.LDARG0] = 6,
[OpCode.LDARG1] = 6,
[OpCode.LDARG2] = 6,
[OpCode.LDARG3] = 6,
[OpCode.LDARG4] = 6,
[OpCode.LDARG5] = 6,
[OpCode.LDARG6] = 6,
[OpCode.LDARG] = 6,
[OpCode.STARG0] = 6,
[OpCode.STARG1] = 6,
[OpCode.STARG2] = 6,
[OpCode.STARG3] = 6,
[OpCode.STARG4] = 6,
[OpCode.STARG5] = 6,
[OpCode.STARG6] = 6,
[OpCode.STARG] = 6,
[OpCode.NEWBUFFER] = 800,
[OpCode.MEMCPY] = 800,
[OpCode.CAT] = 800,
[OpCode.SUBSTR] = 800,
[OpCode.LEFT] = 800,
[OpCode.RIGHT] = 800,
[OpCode.INVERT] = 10,
[OpCode.AND] = 20,
[OpCode.OR] = 20,
[OpCode.XOR] = 20,
[OpCode.EQUAL] = 20,
[OpCode.NOTEQUAL] = 20,
[OpCode.SIGN] = 10,
[OpCode.ABS] = 10,
[OpCode.NEGATE] = 10,
[OpCode.INC] = 10,
[OpCode.DEC] = 10,
[OpCode.ADD] = 20,
[OpCode.SUB] = 20,
[OpCode.MUL] = 30,
[OpCode.DIV] = 30,
[OpCode.MOD] = 30,
[OpCode.SHL] = 30,
[OpCode.SHR] = 30,
[OpCode.NOT] = 10,
[OpCode.BOOLAND] = 20,
[OpCode.BOOLOR] = 20,
[OpCode.NZ] = 10,
[OpCode.NUMEQUAL] = 20,
[OpCode.NUMNOTEQUAL] = 20,
[OpCode.LT] = 20,
[OpCode.LE] = 20,
[OpCode.GT] = 20,
[OpCode.GE] = 20,
[OpCode.MIN] = 20,
[OpCode.MAX] = 20,
[OpCode.WITHIN] = 20,
[OpCode.PACK] = 70,
[OpCode.UNPACK] = 70,
[OpCode.NEWARRAY0] = 40,
[OpCode.NEWARRAY] = 150,
[OpCode.NEWARRAY_T] = 150,
[OpCode.NEWSTRUCT0] = 40,
[OpCode.NEWSTRUCT] = 150,
[OpCode.NEWMAP] = 20,
[OpCode.SIZE] = 15,
[OpCode.HASKEY] = 2700,
[OpCode.KEYS] = 50,
[OpCode.VALUES] = 70,
[OpCode.PICKITEM] = 2700,
[OpCode.APPEND] = 150,
[OpCode.SETITEM] = 2700,
[OpCode.REVERSEITEMS] = 50,
[OpCode.REMOVE] = 50,
[OpCode.CLEARITEMS] = 40,
[OpCode.ISNULL] = 6,
[OpCode.ISTYPE] = 6,
[OpCode.CONVERT] = 800,
};
}
}
4 changes: 2 additions & 2 deletions src/neo/SmartContract/InteropService.Binary.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ partial class InteropService
{
public static class Binary
{
public static readonly InteropDescriptor Serialize = Register("System.Binary.Serialize", Binary_Serialize, 0_00100000, TriggerType.All, CallFlags.None);
public static readonly InteropDescriptor Deserialize = Register("System.Binary.Deserialize", Binary_Deserialize, 0_00500000, TriggerType.All, CallFlags.None);
public static readonly InteropDescriptor Serialize = Register("System.Binary.Serialize", Binary_Serialize, 0_00001000, TriggerType.All, CallFlags.None);
public static readonly InteropDescriptor Deserialize = Register("System.Binary.Deserialize", Binary_Deserialize, 0_00005000, TriggerType.All, CallFlags.None);

private static bool Binary_Serialize(ApplicationEngine engine)
{
Expand Down
12 changes: 6 additions & 6 deletions src/neo/SmartContract/InteropService.Blockchain.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ partial class InteropService
{
public static class Blockchain
{
public static readonly InteropDescriptor GetHeight = Register("System.Blockchain.GetHeight", Blockchain_GetHeight, 0_00000400, TriggerType.Application, CallFlags.None);
public static readonly InteropDescriptor GetBlock = Register("System.Blockchain.GetBlock", Blockchain_GetBlock, 0_02500000, TriggerType.Application, CallFlags.None);
public static readonly InteropDescriptor GetTransaction = Register("System.Blockchain.GetTransaction", Blockchain_GetTransaction, 0_01000000, TriggerType.Application, CallFlags.None);
public static readonly InteropDescriptor GetTransactionHeight = Register("System.Blockchain.GetTransactionHeight", Blockchain_GetTransactionHeight, 0_01000000, TriggerType.Application, CallFlags.None);
public static readonly InteropDescriptor GetTransactionFromBlock = Register("System.Blockchain.GetTransactionFromBlock", Blockchain_GetTransactionFromBlock, 0_01000000, TriggerType.Application, CallFlags.None);
public static readonly InteropDescriptor GetContract = Register("System.Blockchain.GetContract", Blockchain_GetContract, 0_01000000, TriggerType.Application, CallFlags.None);
public static readonly InteropDescriptor GetHeight = Register("System.Blockchain.GetHeight", Blockchain_GetHeight, 0_00000040, TriggerType.Application, CallFlags.None);
public static readonly InteropDescriptor GetBlock = Register("System.Blockchain.GetBlock", Blockchain_GetBlock, 0_00025000, TriggerType.Application, CallFlags.None);
public static readonly InteropDescriptor GetTransaction = Register("System.Blockchain.GetTransaction", Blockchain_GetTransaction, 0_00010000, TriggerType.Application, CallFlags.None);
public static readonly InteropDescriptor GetTransactionHeight = Register("System.Blockchain.GetTransactionHeight", Blockchain_GetTransactionHeight, 0_00010000, TriggerType.Application, CallFlags.None);
public static readonly InteropDescriptor GetTransactionFromBlock = Register("System.Blockchain.GetTransactionFromBlock", Blockchain_GetTransactionFromBlock, 0_00010000, TriggerType.Application, CallFlags.None);
public static readonly InteropDescriptor GetContract = Register("System.Blockchain.GetContract", Blockchain_GetContract, 0_00010000, TriggerType.Application, CallFlags.None);

private static bool Blockchain_GetHeight(ApplicationEngine engine)
{
Expand Down
Loading