44public class EnergyCost {
55
66 private static EnergyCost instance = null ;
7- /* backwards compatibility, remove eventually */
8- private final int STEP = 1 ;
9- /* backwards compatibility, remove eventually */
10- private final int SSTORE = 300 ;
11- private final int ZEROSTEP = 0 ;
12- private final int QUICKSTEP = 2 ;
13- private final int FASTESTSTEP = 3 ;
14- private final int FASTSTEP = 5 ;
15- private final int MIDSTEP = 8 ;
16- private final int SLOWSTEP = 10 ;
17- private final int EXTSTEP = 20 ;
18- private final int GENESISENERGYLIMIT = 1000000 ;
19- private final int MINENERGYLIMIT = 125000 ;
207 private final int BALANCE = 20 ;
218 private final int SHA3 = 30 ;
229 private final int SHA3_WORD = 6 ;
@@ -28,33 +15,18 @@ public class EnergyCost {
2815 private final int RESET_SSTORE = 5000 ;
2916 private final int REFUND_SSTORE = 15000 ;
3017 private final int CREATE = 32000 ;
31- private final int JUMPDEST = 1 ;
32- private final int CREATE_DATA_BYTE = 5 ;
3318 private final int CALL = 40 ;
3419 private final int STIPEND_CALL = 2300 ;
35- private final int VT_CALL = 9000 ; //value transfer call
36- private final int NEW_ACCT_CALL = 25000 ; //new account call
20+ private final int VT_CALL = 9000 ; // value transfer call
21+ private final int NEW_ACCT_CALL = 25000 ; // new account call
3722 private final int MEMORY = 3 ;
38- private final int SUICIDE_REFUND = 24000 ;
39- private final int QUAD_COEFF_DIV = 512 ;
4023 private final int CREATE_DATA = 200 ;
41- private final int TX_NO_ZERO_DATA = 68 ;
42- private final int TX_ZERO_DATA = 4 ;
43- private final int TRANSACTION = 21000 ;
44- private final int TRANSACTION_CREATE_CONTRACT = 53000 ;
4524 private final int LOG_ENERGY = 375 ;
4625 private final int LOG_DATA_ENERGY = 8 ;
4726 private final int LOG_TOPIC_ENERGY = 375 ;
4827 private final int COPY_ENERGY = 3 ;
4928 private final int EXP_ENERGY = 10 ;
5029 private final int EXP_BYTE_ENERGY = 10 ;
51- private final int IDENTITY = 15 ;
52- private final int IDENTITY_WORD = 3 ;
53- private final int RIPEMD160 = 600 ;
54- private final int RIPEMD160_WORD = 120 ;
55- private final int SHA256 = 60 ;
56- private final int SHA256_WORD = 12 ;
57- private final int EC_RECOVER = 3000 ;
5830 private final int EXT_CODE_SIZE = 20 ;
5931 private final int EXT_CODE_COPY = 20 ;
6032 private final int EXT_CODE_HASH = 400 ;
@@ -73,235 +45,131 @@ public static EnergyCost getInstance() {
7345 return instance ;
7446 }
7547
76- public int getSTEP () {
77- return STEP ;
78- }
79-
80- public int getSSTORE () {
81- return SSTORE ;
82- }
83-
84- public int getZEROSTEP () {
85- return ZEROSTEP ;
86- }
87-
88- public int getQUICKSTEP () {
89- return QUICKSTEP ;
90- }
91-
92- public int getFASTESTSTEP () {
93- return FASTESTSTEP ;
94- }
95-
96- public int getFASTSTEP () {
97- return FASTSTEP ;
98- }
99-
100- public int getMIDSTEP () {
101- return MIDSTEP ;
102- }
103-
104- public int getSLOWSTEP () {
105- return SLOWSTEP ;
106- }
107-
108- public int getEXTSTEP () {
109- return EXTSTEP ;
110- }
111-
112- public int getGENESISENERGYLIMIT () {
113- return GENESISENERGYLIMIT ;
114- }
115-
116- public int getMINENERGYLIMIT () {
117- return MINENERGYLIMIT ;
118- }
119-
120- public int getBALANCE () {
48+ public int getBalance () {
12149 return BALANCE ;
12250 }
12351
124- public int getSHA3 () {
52+ public int getSha3 () {
12553 return SHA3 ;
12654 }
12755
128- public int getSHA3_WORD () {
56+ public int getSha3Word () {
12957 return SHA3_WORD ;
13058 }
13159
132- public int getSLOAD () {
60+ public int getSLoad () {
13361 return SLOAD ;
13462 }
13563
136- public int getSTOP () {
64+ public int getStop () {
13765 return STOP ;
13866 }
13967
140- public int getSUICIDE () {
68+ public int getSuicide () {
14169 return SUICIDE ;
14270 }
14371
144- public int getCLEAR_SSTORE () {
72+ public int getClearSStore () {
14573 return CLEAR_SSTORE ;
14674 }
14775
148- public int getSET_SSTORE () {
76+ public int getSetSStore () {
14977 return SET_SSTORE ;
15078 }
15179
152- public int getRESET_SSTORE () {
80+ public int getResetSStore () {
15381 return RESET_SSTORE ;
15482 }
15583
156- public int getREFUND_SSTORE () {
84+ public int getRefundSStore () {
15785 return REFUND_SSTORE ;
15886 }
15987
160- public int getCREATE () {
88+ public int getCreate () {
16189 return CREATE ;
16290 }
16391
164- public int getJUMPDEST () {
165- return JUMPDEST ;
166- }
167-
168- public int getCREATE_DATA_BYTE () {
169- return CREATE_DATA_BYTE ;
170- }
171-
172- public int getCALL () {
92+ public int getCall () {
17393 return CALL ;
17494 }
17595
176- public int getSTIPEND_CALL () {
96+ public int getStipendCall () {
17797 return STIPEND_CALL ;
17898 }
17999
180- public int getVT_CALL () {
100+ public int getVtCall () {
181101 return VT_CALL ;
182102 }
183103
184- public int getNEW_ACCT_CALL () {
104+ public int getNewAcctCall () {
185105 return NEW_ACCT_CALL ;
186106 }
187107
188- public int getNEW_ACCT_SUICIDE () {
108+ public int getNewAcctSuicide () {
189109 return NEW_ACCT_SUICIDE ;
190110 }
191111
192- public int getMEMORY () {
112+ public int getMemory () {
193113 return MEMORY ;
194114 }
195115
196- public int getSUICIDE_REFUND () {
197- return SUICIDE_REFUND ;
198- }
199-
200- public int getQUAD_COEFF_DIV () {
201- return QUAD_COEFF_DIV ;
202- }
203-
204116 public int getCREATE_DATA () {
205117 return CREATE_DATA ;
206118 }
207119
208- public int getTX_NO_ZERO_DATA () {
209- return TX_NO_ZERO_DATA ;
210- }
211-
212- public int getTX_ZERO_DATA () {
213- return TX_ZERO_DATA ;
214- }
215-
216- public int getTRANSACTION () {
217- return TRANSACTION ;
218- }
219-
220- public int getTRANSACTION_CREATE_CONTRACT () {
221- return TRANSACTION_CREATE_CONTRACT ;
222- }
223-
224- public int getLOG_ENERGY () {
120+ public int getLogEnergy () {
225121 return LOG_ENERGY ;
226122 }
227123
228- public int getLOG_DATA_ENERGY () {
124+ public int getLogDataEnergy () {
229125 return LOG_DATA_ENERGY ;
230126 }
231127
232- public int getLOG_TOPIC_ENERGY () {
128+ public int getLogTopicEnergy () {
233129 return LOG_TOPIC_ENERGY ;
234130 }
235131
236- public int getCOPY_ENERGY () {
132+ public int getCopyEnergy () {
237133 return COPY_ENERGY ;
238134 }
239135
240- public int getEXP_ENERGY () {
136+ public int getExpEnergy () {
241137 return EXP_ENERGY ;
242138 }
243139
244- public int getEXP_BYTE_ENERGY () {
140+ public int getExpByteEnergy () {
245141 return EXP_BYTE_ENERGY ;
246142 }
247143
248- public int getIDENTITY () {
249- return IDENTITY ;
250- }
251-
252- public int getIDENTITY_WORD () {
253- return IDENTITY_WORD ;
254- }
255-
256- public int getRIPEMD160 () {
257- return RIPEMD160 ;
258- }
259-
260- public int getRIPEMD160_WORD () {
261- return RIPEMD160_WORD ;
262- }
263-
264- public int getSHA256 () {
265- return SHA256 ;
266- }
267-
268- public int getSHA256_WORD () {
269- return SHA256_WORD ;
270- }
271-
272- public int getEC_RECOVER () {
273- return EC_RECOVER ;
274- }
275-
276- public int getEXT_CODE_SIZE () {
144+ public int getExtCodeSize () {
277145 return EXT_CODE_SIZE ;
278146 }
279147
280- public int getEXT_CODE_COPY () {
148+ public int getExtCodeCopy () {
281149 return EXT_CODE_COPY ;
282150 }
283151
284- public int getEXT_CODE_HASH () {
152+ public int getExtCodeHash () {
285153 return EXT_CODE_HASH ;
286154 }
287155
288- public int getFREEZE () {
156+ public int getFreeze () {
289157 return FREEZE ;
290158 }
291159
292- public int getUNFREEZE () {
160+ public int getUnfreeze () {
293161 return UNFREEZE ;
294162 }
295163
296- public int getFREEZE_EXPIRE_TIME () {
164+ public int getFreezeExpireTime () {
297165 return FREEZE_EXPIRE_TIME ;
298166 }
299167
300- public int getVOTE_WITNESS () {
168+ public int getVoteWitness () {
301169 return VOTE_WITNESS ;
302170 }
303171
304- public int getWITHDRAW_REWARD () {
172+ public int getWithdrawReward () {
305173 return WITHDRAW_REWARD ;
306174 }
307175}
0 commit comments