@@ -960,6 +960,130 @@ def test_extcodehash(vm_class, address, expected):
960
960
19200 ,
961
961
1 ,
962
962
),
963
+ # London reduces refund by changing SSTORE_CLEARS_SCHEDULE
964
+ # Test cases from: https://eips.ethereum.org/EIPS/eip-3529
965
+ # Note: test cases assume the storage slot is already warm,
966
+ # the difference being a one-time cost of 2100 gas.
967
+ # so gas_used becomes gas_used from EIP-3529 test case + 2100
968
+ (
969
+ LondonVM ,
970
+ "0x60006000556000600055" ,
971
+ 212 + 2100 ,
972
+ 0 ,
973
+ 0 ,
974
+ ),
975
+ (
976
+ LondonVM ,
977
+ "0x60006000556001600055" ,
978
+ 20112 + 2100 ,
979
+ 0 ,
980
+ 0 ,
981
+ ),
982
+ (
983
+ LondonVM ,
984
+ "0x60016000556000600055" ,
985
+ 20112 + 2100 ,
986
+ 19900 ,
987
+ 0 ,
988
+ ),
989
+ (
990
+ LondonVM ,
991
+ "0x60016000556002600055" ,
992
+ 20112 + 2100 ,
993
+ 0 ,
994
+ 0 ,
995
+ ),
996
+ (
997
+ LondonVM ,
998
+ "0x60016000556001600055" ,
999
+ 20112 + 2100 ,
1000
+ 0 ,
1001
+ 0 ,
1002
+ ),
1003
+ (
1004
+ LondonVM ,
1005
+ "0x60006000556000600055" ,
1006
+ 3012 + 2100 ,
1007
+ 4800 ,
1008
+ 1 ,
1009
+ ),
1010
+ (
1011
+ LondonVM ,
1012
+ "0x60006000556001600055" ,
1013
+ 3012 + 2100 ,
1014
+ 2800 ,
1015
+ 1 ,
1016
+ ),
1017
+ (
1018
+ LondonVM ,
1019
+ "0x60006000556002600055" ,
1020
+ 3012 + 2100 ,
1021
+ 0 ,
1022
+ 1 ,
1023
+ ),
1024
+ (
1025
+ LondonVM ,
1026
+ "0x60026000556000600055" ,
1027
+ 3012 + 2100 ,
1028
+ 4800 ,
1029
+ 1 ,
1030
+ ),
1031
+ (
1032
+ LondonVM ,
1033
+ "0x60026000556003600055" ,
1034
+ 3012 + 2100 ,
1035
+ 0 ,
1036
+ 1 ,
1037
+ ),
1038
+ (
1039
+ LondonVM ,
1040
+ "0x60026000556001600055" ,
1041
+ 3012 + 2100 ,
1042
+ 2800 ,
1043
+ 1 ,
1044
+ ),
1045
+ (
1046
+ LondonVM ,
1047
+ "0x60026000556002600055" ,
1048
+ 3012 + 2100 ,
1049
+ 0 ,
1050
+ 1 ,
1051
+ ),
1052
+ (
1053
+ LondonVM ,
1054
+ "0x60016000556000600055" ,
1055
+ 3012 + 2100 ,
1056
+ 4800 ,
1057
+ 1 ,
1058
+ ),
1059
+ (
1060
+ LondonVM ,
1061
+ "0x60016000556002600055" ,
1062
+ 3012 + 2100 ,
1063
+ 0 ,
1064
+ 1 ,
1065
+ ),
1066
+ (
1067
+ LondonVM ,
1068
+ "0x60016000556001600055" ,
1069
+ 212 + 2100 ,
1070
+ 0 ,
1071
+ 1 ,
1072
+ ),
1073
+ (
1074
+ LondonVM ,
1075
+ "0x600160005560006000556001600055" ,
1076
+ 40118 + 2100 ,
1077
+ 19900 ,
1078
+ 0 ,
1079
+ ),
1080
+ (
1081
+ LondonVM ,
1082
+ "0x600060005560016000556000600055" ,
1083
+ 5918 + 2100 ,
1084
+ 7600 ,
1085
+ 1 ,
1086
+ ),
963
1087
)
964
1088
)
965
1089
def test_sstore (vm_class , code , gas_used , refund , original ):
0 commit comments