@@ -39,9 +39,6 @@ import (
39
39
// contract.
40
40
type PrecompiledContract interface {
41
41
ContractRef
42
- // IsStateful returns true if the precompile contract can execute a state
43
- // transition or if it can access the StateDB.
44
- IsStateful () bool
45
42
// RequiredPrice calculates the contract gas used
46
43
RequiredGas (input []byte ) uint64
47
44
// Run runs the precompiled contract
@@ -306,9 +303,6 @@ func (ecrecover) Address() common.Address {
306
303
return common .BytesToAddress ([]byte {1 })
307
304
}
308
305
309
- // IsStateful returns false.
310
- func (ecrecover ) IsStateful () bool { return false }
311
-
312
306
func (c * ecrecover ) RequiredGas (input []byte ) uint64 {
313
307
return params .EcrecoverGas
314
308
}
@@ -353,9 +347,6 @@ func (sha256hash) Address() common.Address {
353
347
return common .BytesToAddress ([]byte {2 })
354
348
}
355
349
356
- // IsStateful returns false.
357
- func (sha256hash ) IsStateful () bool { return false }
358
-
359
350
// RequiredGas returns the gas required to execute the pre-compiled contract.
360
351
//
361
352
// This method does not require any overflow checking as the input size gas costs
@@ -378,9 +369,6 @@ func (ripemd160hash) Address() common.Address {
378
369
return common .BytesToAddress ([]byte {3 })
379
370
}
380
371
381
- // IsStateful returns false.
382
- func (ripemd160hash ) IsStateful () bool { return false }
383
-
384
372
// RequiredGas returns the gas required to execute the pre-compiled contract.
385
373
//
386
374
// This method does not require any overflow checking as the input size gas costs
@@ -404,9 +392,6 @@ func (dataCopy) Address() common.Address {
404
392
return common .BytesToAddress ([]byte {4 })
405
393
}
406
394
407
- // IsStateful returns false.
408
- func (dataCopy ) IsStateful () bool { return false }
409
-
410
395
// RequiredGas returns the gas required to execute the pre-compiled contract.
411
396
//
412
397
// This method does not require any overflow checking as the input size gas costs
@@ -478,9 +463,6 @@ func (bigModExp) Address() common.Address {
478
463
return common .BytesToAddress ([]byte {5 })
479
464
}
480
465
481
- // IsStateful returns false.
482
- func (bigModExp ) IsStateful () bool { return false }
483
-
484
466
// RequiredGas returns the gas required to execute the pre-compiled contract.
485
467
func (c * bigModExp ) RequiredGas (input []byte ) uint64 {
486
468
var (
@@ -626,9 +608,6 @@ func (bn256AddIstanbul) Address() common.Address {
626
608
return common .BytesToAddress ([]byte {6 })
627
609
}
628
610
629
- // IsStateful returns false.
630
- func (bn256AddIstanbul ) IsStateful () bool { return false }
631
-
632
611
// RequiredGas returns the gas required to execute the pre-compiled contract.
633
612
func (c * bn256AddIstanbul ) RequiredGas (input []byte ) uint64 {
634
613
return params .Bn256AddGasIstanbul
@@ -648,9 +627,6 @@ func (bn256AddByzantium) Address() common.Address {
648
627
return common .BytesToAddress ([]byte {6 })
649
628
}
650
629
651
- // IsStateful returns false.
652
- func (bn256AddByzantium ) IsStateful () bool { return false }
653
-
654
630
// RequiredGas returns the gas required to execute the pre-compiled contract.
655
631
func (c * bn256AddByzantium ) RequiredGas (input []byte ) uint64 {
656
632
return params .Bn256AddGasByzantium
@@ -682,9 +658,6 @@ func (bn256ScalarMulIstanbul) Address() common.Address {
682
658
return common .BytesToAddress ([]byte {7 })
683
659
}
684
660
685
- // IsStateful returns false.
686
- func (bn256ScalarMulIstanbul ) IsStateful () bool { return false }
687
-
688
661
// RequiredGas returns the gas required to execute the pre-compiled contract.
689
662
func (c * bn256ScalarMulIstanbul ) RequiredGas (input []byte ) uint64 {
690
663
return params .Bn256ScalarMulGasIstanbul
@@ -704,9 +677,6 @@ func (bn256ScalarMulByzantium) Address() common.Address {
704
677
return common .BytesToAddress ([]byte {7 })
705
678
}
706
679
707
- // IsStateful returns false.
708
- func (bn256ScalarMulByzantium ) IsStateful () bool { return false }
709
-
710
680
// RequiredGas returns the gas required to execute the pre-compiled contract.
711
681
func (c * bn256ScalarMulByzantium ) RequiredGas (input []byte ) uint64 {
712
682
return params .Bn256ScalarMulGasByzantium
@@ -768,9 +738,6 @@ func (bn256PairingIstanbul) Address() common.Address {
768
738
return common .BytesToAddress ([]byte {8 })
769
739
}
770
740
771
- // IsStateful returns false.
772
- func (bn256PairingIstanbul ) IsStateful () bool { return false }
773
-
774
741
// RequiredGas returns the gas required to execute the pre-compiled contract.
775
742
func (c * bn256PairingIstanbul ) RequiredGas (input []byte ) uint64 {
776
743
return params .Bn256PairingBaseGasIstanbul + uint64 (len (input )/ 192 )* params .Bn256PairingPerPointGasIstanbul
@@ -790,9 +757,6 @@ func (bn256PairingByzantium) Address() common.Address {
790
757
return common .BytesToAddress ([]byte {8 })
791
758
}
792
759
793
- // IsStateful returns false.
794
- func (bn256PairingByzantium ) IsStateful () bool { return false }
795
-
796
760
// RequiredGas returns the gas required to execute the pre-compiled contract.
797
761
func (c * bn256PairingByzantium ) RequiredGas (input []byte ) uint64 {
798
762
return params .Bn256PairingBaseGasByzantium + uint64 (len (input )/ 192 )* params .Bn256PairingPerPointGasByzantium
@@ -810,9 +774,6 @@ func (blake2F) Address() common.Address {
810
774
return common .BytesToAddress ([]byte {9 })
811
775
}
812
776
813
- // IsStateful returns false.
814
- func (blake2F ) IsStateful () bool { return false }
815
-
816
777
func (c * blake2F ) RequiredGas (input []byte ) uint64 {
817
778
// If the input is malformed, we can't calculate the gas, return 0 and let the
818
779
// actual call choke and fault.
@@ -888,9 +849,6 @@ func (bls12381G1Add) Address() common.Address {
888
849
return common .BytesToAddress ([]byte {10 })
889
850
}
890
851
891
- // IsStateful returns false.
892
- func (bls12381G1Add ) IsStateful () bool { return false }
893
-
894
852
// RequiredGas returns the gas required to execute the pre-compiled contract.
895
853
func (c * bls12381G1Add ) RequiredGas (input []byte ) uint64 {
896
854
return params .Bls12381G1AddGas
@@ -935,9 +893,6 @@ func (bls12381G1Mul) Address() common.Address {
935
893
return common .BytesToAddress ([]byte {11 })
936
894
}
937
895
938
- // IsStateful returns false.
939
- func (bls12381G1Mul ) IsStateful () bool { return false }
940
-
941
896
// RequiredGas returns the gas required to execute the pre-compiled contract.
942
897
func (c * bls12381G1Mul ) RequiredGas (input []byte ) uint64 {
943
898
return params .Bls12381G1MulGas
@@ -980,9 +935,6 @@ func (bls12381G1MultiExp) Address() common.Address {
980
935
return common .BytesToAddress ([]byte {12 })
981
936
}
982
937
983
- // IsStateful returns false.
984
- func (bls12381G1MultiExp ) IsStateful () bool { return false }
985
-
986
938
// RequiredGas returns the gas required to execute the pre-compiled contract.
987
939
func (c * bls12381G1MultiExp ) RequiredGas (input []byte ) uint64 {
988
940
// Calculate G1 point, scalar value pair length
@@ -1046,9 +998,6 @@ func (bls12381G2Add) Address() common.Address {
1046
998
return common .BytesToAddress ([]byte {13 })
1047
999
}
1048
1000
1049
- // IsStateful returns false.
1050
- func (bls12381G2Add ) IsStateful () bool { return false }
1051
-
1052
1001
// RequiredGas returns the gas required to execute the pre-compiled contract.
1053
1002
func (c * bls12381G2Add ) RequiredGas (input []byte ) uint64 {
1054
1003
return params .Bls12381G2AddGas
@@ -1093,9 +1042,6 @@ func (bls12381G2Mul) Address() common.Address {
1093
1042
return common .BytesToAddress ([]byte {14 })
1094
1043
}
1095
1044
1096
- // IsStateful returns false.
1097
- func (bls12381G2Mul ) IsStateful () bool { return false }
1098
-
1099
1045
// RequiredGas returns the gas required to execute the pre-compiled contract.
1100
1046
func (c * bls12381G2Mul ) RequiredGas (input []byte ) uint64 {
1101
1047
return params .Bls12381G2MulGas
@@ -1138,9 +1084,6 @@ func (bls12381G2MultiExp) Address() common.Address {
1138
1084
return common .BytesToAddress ([]byte {15 })
1139
1085
}
1140
1086
1141
- // IsStateful returns false.
1142
- func (bls12381G2MultiExp ) IsStateful () bool { return false }
1143
-
1144
1087
// RequiredGas returns the gas required to execute the pre-compiled contract.
1145
1088
func (c * bls12381G2MultiExp ) RequiredGas (input []byte ) uint64 {
1146
1089
// Calculate G2 point, scalar value pair length
@@ -1204,9 +1147,6 @@ func (bls12381Pairing) Address() common.Address {
1204
1147
return common .BytesToAddress ([]byte {16 })
1205
1148
}
1206
1149
1207
- // IsStateful returns false.
1208
- func (bls12381Pairing ) IsStateful () bool { return false }
1209
-
1210
1150
// RequiredGas returns the gas required to execute the pre-compiled contract.
1211
1151
func (c * bls12381Pairing ) RequiredGas (input []byte ) uint64 {
1212
1152
return params .Bls12381PairingBaseGas + uint64 (len (input )/ 384 )* params .Bls12381PairingPerPairGas
@@ -1292,9 +1232,6 @@ func (bls12381MapG1) Address() common.Address {
1292
1232
return common .BytesToAddress ([]byte {17 })
1293
1233
}
1294
1234
1295
- // IsStateful returns false.
1296
- func (bls12381MapG1 ) IsStateful () bool { return false }
1297
-
1298
1235
// RequiredGas returns the gas required to execute the pre-compiled contract.
1299
1236
func (c * bls12381MapG1 ) RequiredGas (input []byte ) uint64 {
1300
1237
return params .Bls12381MapG1Gas
@@ -1336,9 +1273,6 @@ func (bls12381MapG2) Address() common.Address {
1336
1273
return common .BytesToAddress ([]byte {18 })
1337
1274
}
1338
1275
1339
- // IsStateful returns false.
1340
- func (bls12381MapG2 ) IsStateful () bool { return false }
1341
-
1342
1276
// RequiredGas returns the gas required to execute the pre-compiled contract.
1343
1277
func (c * bls12381MapG2 ) RequiredGas (input []byte ) uint64 {
1344
1278
return params .Bls12381MapG2Gas
0 commit comments