Skip to content

Commit b3630f1

Browse files
committed
fix: rename comptimeSelector to selector for eth.zig v0.3.0
eth.zig v0.3.0 renamed keccak.comptimeSelector -> keccak.selector. Update all ABI files to match.
1 parent eb6ff07 commit b3630f1

5 files changed

Lines changed: 35 additions & 35 deletions

File tree

src/abi/beacon_abi.zig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ pub const index: Function = .{
1010
.{ .name = "", .abi_type = .uint256 },
1111
},
1212
};
13-
pub const index_selector = keccak.comptimeSelector("index()");
13+
pub const index_selector = keccak.selector("index()");
1414

1515
pub const tw_avg: Function = .{
1616
.name = "twAvg",
@@ -22,4 +22,4 @@ pub const tw_avg: Function = .{
2222
.{ .name = "", .abi_type = .uint256 },
2323
},
2424
};
25-
pub const tw_avg_selector = keccak.comptimeSelector("twAvg(uint32)");
25+
pub const tw_avg_selector = keccak.selector("twAvg(uint32)");

src/abi/erc20_abi.zig

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ pub const approve: Function = .{
1414
.{ .name = "", .abi_type = .bool },
1515
},
1616
};
17-
pub const approve_selector = keccak.comptimeSelector("approve(address,uint256)");
17+
pub const approve_selector = keccak.selector("approve(address,uint256)");
1818

1919
pub const balance_of: Function = .{
2020
.name = "balanceOf",
@@ -26,7 +26,7 @@ pub const balance_of: Function = .{
2626
.{ .name = "", .abi_type = .uint256 },
2727
},
2828
};
29-
pub const balance_of_selector = keccak.comptimeSelector("balanceOf(address)");
29+
pub const balance_of_selector = keccak.selector("balanceOf(address)");
3030

3131
pub const allowance: Function = .{
3232
.name = "allowance",
@@ -39,4 +39,4 @@ pub const allowance: Function = .{
3939
.{ .name = "", .abi_type = .uint256 },
4040
},
4141
};
42-
pub const allowance_selector = keccak.comptimeSelector("allowance(address,address)");
42+
pub const allowance_selector = keccak.selector("allowance(address,address)");

src/abi/fees_abi.zig

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ pub const creator_fee: Function = .{
1010
.{ .name = "", .abi_type = .uint24 },
1111
},
1212
};
13-
pub const creator_fee_selector = keccak.comptimeSelector("CREATOR_FEE()");
13+
pub const creator_fee_selector = keccak.selector("CREATOR_FEE()");
1414

1515
pub const insurance_fee: Function = .{
1616
.name = "INSURANCE_FEE",
@@ -20,7 +20,7 @@ pub const insurance_fee: Function = .{
2020
.{ .name = "", .abi_type = .uint24 },
2121
},
2222
};
23-
pub const insurance_fee_selector = keccak.comptimeSelector("INSURANCE_FEE()");
23+
pub const insurance_fee_selector = keccak.selector("INSURANCE_FEE()");
2424

2525
pub const lp_fee: Function = .{
2626
.name = "LP_FEE",
@@ -30,7 +30,7 @@ pub const lp_fee: Function = .{
3030
.{ .name = "", .abi_type = .uint24 },
3131
},
3232
};
33-
pub const lp_fee_selector = keccak.comptimeSelector("LP_FEE()");
33+
pub const lp_fee_selector = keccak.selector("LP_FEE()");
3434

3535
pub const liquidation_fee: Function = .{
3636
.name = "LIQUIDATION_FEE",
@@ -40,4 +40,4 @@ pub const liquidation_fee: Function = .{
4040
.{ .name = "", .abi_type = .uint24 },
4141
},
4242
};
43-
pub const liquidation_fee_selector = keccak.comptimeSelector("LIQUIDATION_FEE()");
43+
pub const liquidation_fee_selector = keccak.selector("LIQUIDATION_FEE()");

src/abi/margin_ratios_abi.zig

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ pub const min_taker_ratio: Function = .{
1010
.{ .name = "", .abi_type = .uint24 },
1111
},
1212
};
13-
pub const min_taker_ratio_selector = keccak.comptimeSelector("MIN_TAKER_RATIO()");
13+
pub const min_taker_ratio_selector = keccak.selector("MIN_TAKER_RATIO()");
1414

1515
pub const max_taker_ratio: Function = .{
1616
.name = "MAX_TAKER_RATIO",
@@ -20,7 +20,7 @@ pub const max_taker_ratio: Function = .{
2020
.{ .name = "", .abi_type = .uint24 },
2121
},
2222
};
23-
pub const max_taker_ratio_selector = keccak.comptimeSelector("MAX_TAKER_RATIO()");
23+
pub const max_taker_ratio_selector = keccak.selector("MAX_TAKER_RATIO()");
2424

2525
pub const liquidation_taker_ratio: Function = .{
2626
.name = "LIQUIDATION_TAKER_RATIO",
@@ -30,7 +30,7 @@ pub const liquidation_taker_ratio: Function = .{
3030
.{ .name = "", .abi_type = .uint24 },
3131
},
3232
};
33-
pub const liquidation_taker_ratio_selector = keccak.comptimeSelector("LIQUIDATION_TAKER_RATIO()");
33+
pub const liquidation_taker_ratio_selector = keccak.selector("LIQUIDATION_TAKER_RATIO()");
3434

3535
pub const min_maker_ratio: Function = .{
3636
.name = "MIN_MAKER_RATIO",
@@ -40,7 +40,7 @@ pub const min_maker_ratio: Function = .{
4040
.{ .name = "", .abi_type = .uint24 },
4141
},
4242
};
43-
pub const min_maker_ratio_selector = keccak.comptimeSelector("MIN_MAKER_RATIO()");
43+
pub const min_maker_ratio_selector = keccak.selector("MIN_MAKER_RATIO()");
4444

4545
pub const max_maker_ratio: Function = .{
4646
.name = "MAX_MAKER_RATIO",
@@ -50,7 +50,7 @@ pub const max_maker_ratio: Function = .{
5050
.{ .name = "", .abi_type = .uint24 },
5151
},
5252
};
53-
pub const max_maker_ratio_selector = keccak.comptimeSelector("MAX_MAKER_RATIO()");
53+
pub const max_maker_ratio_selector = keccak.selector("MAX_MAKER_RATIO()");
5454

5555
pub const liquidation_maker_ratio: Function = .{
5656
.name = "LIQUIDATION_MAKER_RATIO",
@@ -60,4 +60,4 @@ pub const liquidation_maker_ratio: Function = .{
6060
.{ .name = "", .abi_type = .uint24 },
6161
},
6262
};
63-
pub const liquidation_maker_ratio_selector = keccak.comptimeSelector("LIQUIDATION_MAKER_RATIO()");
63+
pub const liquidation_maker_ratio_selector = keccak.selector("LIQUIDATION_MAKER_RATIO()");

src/abi/perp_manager_abi.zig

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ pub const cfgs: Function = .{
2929
.{ .name = "sqrtPriceImpactLimit", .abi_type = .address },
3030
},
3131
};
32-
pub const cfgs_selector = keccak.comptimeSelector("cfgs(bytes32)");
32+
pub const cfgs_selector = keccak.selector("cfgs(bytes32)");
3333

3434
pub const positions: Function = .{
3535
.name = "positions",
@@ -57,7 +57,7 @@ pub const positions: Function = .{
5757
} },
5858
},
5959
};
60-
pub const positions_selector = keccak.comptimeSelector("positions(uint256)");
60+
pub const positions_selector = keccak.selector("positions(uint256)");
6161

6262
pub const quote_close_position: Function = .{
6363
.name = "quoteClosePosition",
@@ -74,7 +74,7 @@ pub const quote_close_position: Function = .{
7474
.{ .name = "notional", .abi_type = .uint256 },
7575
},
7676
};
77-
pub const quote_close_position_selector = keccak.comptimeSelector("quoteClosePosition(uint256)");
77+
pub const quote_close_position_selector = keccak.selector("quoteClosePosition(uint256)");
7878

7979
pub const time_weighted_avg_sqrt_price_x96: Function = .{
8080
.name = "timeWeightedAvgSqrtPriceX96",
@@ -87,7 +87,7 @@ pub const time_weighted_avg_sqrt_price_x96: Function = .{
8787
.{ .name = "", .abi_type = .uint256 },
8888
},
8989
};
90-
pub const time_weighted_avg_sqrt_price_x96_selector = keccak.comptimeSelector("timeWeightedAvgSqrtPriceX96(bytes32,uint32)");
90+
pub const time_weighted_avg_sqrt_price_x96_selector = keccak.selector("timeWeightedAvgSqrtPriceX96(bytes32,uint32)");
9191

9292
pub const protocol_fee: Function = .{
9393
.name = "protocolFee",
@@ -97,7 +97,7 @@ pub const protocol_fee: Function = .{
9797
.{ .name = "", .abi_type = .uint24 },
9898
},
9999
};
100-
pub const protocol_fee_selector = keccak.comptimeSelector("protocolFee()");
100+
pub const protocol_fee_selector = keccak.selector("protocolFee()");
101101

102102
// -- Write functions --
103103

@@ -117,7 +117,7 @@ pub const create_perp: Function = .{
117117
.{ .name = "", .abi_type = .bytes32 },
118118
},
119119
};
120-
pub const create_perp_selector = keccak.comptimeSelector("createPerp((address,address,address,address,address))");
120+
pub const create_perp_selector = keccak.selector("createPerp((address,address,address,address,address))");
121121

122122
pub const open_taker_pos: Function = .{
123123
.name = "openTakerPos",
@@ -136,7 +136,7 @@ pub const open_taker_pos: Function = .{
136136
.{ .name = "", .abi_type = .uint256 },
137137
},
138138
};
139-
pub const open_taker_pos_selector = keccak.comptimeSelector("openTakerPos(bytes32,(address,bool,uint128,uint24,uint128))");
139+
pub const open_taker_pos_selector = keccak.selector("openTakerPos(bytes32,(address,bool,uint128,uint24,uint128))");
140140

141141
pub const open_maker_pos: Function = .{
142142
.name = "openMakerPos",
@@ -157,7 +157,7 @@ pub const open_maker_pos: Function = .{
157157
.{ .name = "", .abi_type = .uint256 },
158158
},
159159
};
160-
pub const open_maker_pos_selector = keccak.comptimeSelector("openMakerPos(bytes32,(address,uint128,uint120,int24,int24,uint128,uint128))");
160+
pub const open_maker_pos_selector = keccak.selector("openMakerPos(bytes32,(address,uint128,uint120,int24,int24,uint128,uint128))");
161161

162162
pub const close_position: Function = .{
163163
.name = "closePosition",
@@ -172,7 +172,7 @@ pub const close_position: Function = .{
172172
},
173173
.outputs = &.{},
174174
};
175-
pub const close_position_selector = keccak.comptimeSelector("closePosition((uint256,uint128,uint128,uint128))");
175+
pub const close_position_selector = keccak.selector("closePosition((uint256,uint128,uint128,uint128))");
176176

177177
pub const adjust_notional: Function = .{
178178
.name = "adjustNotional",
@@ -186,7 +186,7 @@ pub const adjust_notional: Function = .{
186186
},
187187
.outputs = &.{},
188188
};
189-
pub const adjust_notional_selector = keccak.comptimeSelector("adjustNotional((uint256,int256,uint128))");
189+
pub const adjust_notional_selector = keccak.selector("adjustNotional((uint256,int256,uint128))");
190190

191191
pub const adjust_margin: Function = .{
192192
.name = "adjustMargin",
@@ -199,7 +199,7 @@ pub const adjust_margin: Function = .{
199199
},
200200
.outputs = &.{},
201201
};
202-
pub const adjust_margin_selector = keccak.comptimeSelector("adjustMargin((uint256,int256))");
202+
pub const adjust_margin_selector = keccak.selector("adjustMargin((uint256,int256))");
203203

204204
pub const funding_per_second_x96: Function = .{
205205
.name = "fundingPerSecondX96",
@@ -211,7 +211,7 @@ pub const funding_per_second_x96: Function = .{
211211
.{ .name = "", .abi_type = .int256 },
212212
},
213213
};
214-
pub const funding_per_second_x96_selector = keccak.comptimeSelector("fundingPerSecondX96(bytes32)");
214+
pub const funding_per_second_x96_selector = keccak.selector("fundingPerSecondX96(bytes32)");
215215

216216
pub const util_fee_per_sec_x96: Function = .{
217217
.name = "utilFeePerSecX96",
@@ -223,7 +223,7 @@ pub const util_fee_per_sec_x96: Function = .{
223223
.{ .name = "", .abi_type = .uint256 },
224224
},
225225
};
226-
pub const util_fee_per_sec_x96_selector = keccak.comptimeSelector("utilFeePerSecX96(bytes32)");
226+
pub const util_fee_per_sec_x96_selector = keccak.selector("utilFeePerSecX96(bytes32)");
227227

228228
pub const insurance: Function = .{
229229
.name = "insurance",
@@ -235,7 +235,7 @@ pub const insurance: Function = .{
235235
.{ .name = "", .abi_type = .uint128 },
236236
},
237237
};
238-
pub const insurance_selector = keccak.comptimeSelector("insurance(bytes32)");
238+
pub const insurance_selector = keccak.selector("insurance(bytes32)");
239239

240240
pub const taker_open_interest: Function = .{
241241
.name = "takerOpenInterest",
@@ -248,7 +248,7 @@ pub const taker_open_interest: Function = .{
248248
.{ .name = "shortOI", .abi_type = .uint128 },
249249
},
250250
};
251-
pub const taker_open_interest_selector = keccak.comptimeSelector("takerOpenInterest(bytes32)");
251+
pub const taker_open_interest_selector = keccak.selector("takerOpenInterest(bytes32)");
252252

253253
pub const quote_open_taker_position: Function = .{
254254
.name = "quoteOpenTakerPosition",
@@ -269,7 +269,7 @@ pub const quote_open_taker_position: Function = .{
269269
.{ .name = "funding", .abi_type = .int256 },
270270
},
271271
};
272-
pub const quote_open_taker_position_selector = keccak.comptimeSelector("quoteOpenTakerPosition(bytes32,(address,bool,uint128,uint24,uint128))");
272+
pub const quote_open_taker_position_selector = keccak.selector("quoteOpenTakerPosition(bytes32,(address,bool,uint128,uint24,uint128))");
273273

274274
pub const quote_open_maker_position: Function = .{
275275
.name = "quoteOpenMakerPosition",
@@ -292,7 +292,7 @@ pub const quote_open_maker_position: Function = .{
292292
.{ .name = "funding", .abi_type = .int256 },
293293
},
294294
};
295-
pub const quote_open_maker_position_selector = keccak.comptimeSelector("quoteOpenMakerPosition(bytes32,(address,uint128,uint120,int24,int24,uint128,uint128))");
295+
pub const quote_open_maker_position_selector = keccak.selector("quoteOpenMakerPosition(bytes32,(address,uint128,uint120,int24,int24,uint128,uint128))");
296296

297297
// -- Events --
298298

@@ -349,7 +349,7 @@ pub const register_module: Function = .{
349349
},
350350
.outputs = &.{},
351351
};
352-
pub const register_module_selector = keccak.comptimeSelector("registerModule(uint8,address)");
352+
pub const register_module_selector = keccak.selector("registerModule(uint8,address)");
353353

354354
pub const is_module_registered: Function = .{
355355
.name = "isModuleRegistered",
@@ -362,7 +362,7 @@ pub const is_module_registered: Function = .{
362362
.{ .name = "", .abi_type = .bool },
363363
},
364364
};
365-
pub const is_module_registered_selector = keccak.comptimeSelector("isModuleRegistered(uint8,address)");
365+
pub const is_module_registered_selector = keccak.selector("isModuleRegistered(uint8,address)");
366366

367367
// -- Quote swap --
368368

@@ -382,4 +382,4 @@ pub const quote_swap: Function = .{
382382
.{ .name = "usdDelta", .abi_type = .int256 },
383383
},
384384
};
385-
pub const quote_swap_selector = keccak.comptimeSelector("quoteSwap(bytes32,bool,bool,uint256,uint160)");
385+
pub const quote_swap_selector = keccak.selector("quoteSwap(bytes32,bool,bool,uint256,uint160)");

0 commit comments

Comments
 (0)