Skip to content

Commit 0370cac

Browse files
authored
Update gas benchmark (#581)
* Fix benchmark typo * Use snapshot instead of test for gas benchmark * Update AABenchmarkArtifacts compilation bytecode
1 parent ef6a072 commit 0370cac

8 files changed

+247
-1111
lines changed

.gas-snapshot

+61-1,007
Large diffs are not rendered by default.

gasreport.txt

+160-78
Large diffs are not rendered by default.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
"build": "yarn clean && yarn compile",
5858
"forge:build": "forge build",
5959
"forge:test": "forge test",
60-
"gas": "forge test --mc Benchmark --gas-report > gasreport.txt",
60+
"gas": "forge snapshot --mc Benchmark --gas-report --diff .gas-snapshot > gasreport.txt",
6161
"forge:snapshot": "forge snapshot --check",
6262
"aabenchmark": "forge test --mc AABenchmarkPrepare && forge test --mc ProfileThirdwebAccount -vvv"
6363
}

src/test/benchmark/DropERC1155Benchmark.t.sol

+5-5
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ contract DropERC1155BenchmarkTest is BaseTest {
3131
DropERC1155 benchmark
3232
//////////////////////////////////////////////////////////////*/
3333

34-
function test_bechmark_dropERC1155_claim() public {
34+
function test_benchmark_dropERC1155_claim() public {
3535
vm.pauseGasMetering();
3636
uint256 _tokenId = 0;
3737
string[] memory inputs = new string[](5);
@@ -81,7 +81,7 @@ contract DropERC1155BenchmarkTest is BaseTest {
8181
drop.claim(receiver, _tokenId, 100, address(erc20), 5, alp, "");
8282
}
8383

84-
function test_bechmark_dropERC1155_setClaimConditions_five_conditions() public {
84+
function test_benchmark_dropERC1155_setClaimConditions_five_conditions() public {
8585
vm.pauseGasMetering();
8686
uint256 _tokenId = 0;
8787
string[] memory inputs = new string[](5);
@@ -145,7 +145,7 @@ contract DropERC1155BenchmarkTest is BaseTest {
145145
drop.lazyMint(100, "ipfs://", emptyEncodedBytes);
146146
}
147147

148-
// function test_bechmark_dropERC1155_setClaimConditions_one_condition() public {
148+
// function test_benchmark_dropERC1155_setClaimConditions_one_condition() public {
149149
// vm.pauseGasMetering();
150150
// uint256 _tokenId = 0;
151151
// string[] memory inputs = new string[](5);
@@ -188,7 +188,7 @@ contract DropERC1155BenchmarkTest is BaseTest {
188188
// drop.setClaimConditions(_tokenId, conditions, false);
189189
// }
190190

191-
// function test_bechmark_dropERC1155_setClaimConditions_two_conditions() public {
191+
// function test_benchmark_dropERC1155_setClaimConditions_two_conditions() public {
192192
// vm.pauseGasMetering();
193193
// uint256 _tokenId = 0;
194194
// string[] memory inputs = new string[](5);
@@ -235,7 +235,7 @@ contract DropERC1155BenchmarkTest is BaseTest {
235235
// drop.setClaimConditions(_tokenId, conditions, false);
236236
// }
237237

238-
// function test_bechmark_dropERC1155_setClaimConditions_three_conditions() public {
238+
// function test_benchmark_dropERC1155_setClaimConditions_three_conditions() public {
239239
// vm.pauseGasMetering();
240240
// uint256 _tokenId = 0;
241241
// string[] memory inputs = new string[](5);

src/test/benchmark/DropERC20Benchmark.t.sol

+5-5
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ contract DropERC20BenchmarkTest is BaseTest {
2626
DropERC20 benchmark
2727
//////////////////////////////////////////////////////////////*/
2828

29-
function test_bechmark_dropERC20_setClaimConditions_five_conditions() public {
29+
function test_benchmark_dropERC20_setClaimConditions_five_conditions() public {
3030
vm.pauseGasMetering();
3131
string[] memory inputs = new string[](5);
3232

@@ -80,7 +80,7 @@ contract DropERC20BenchmarkTest is BaseTest {
8080
drop.setClaimConditions(conditions, false);
8181
}
8282

83-
function test_bechmark_dropERC20_claim() public {
83+
function test_benchmark_dropERC20_claim() public {
8484
vm.pauseGasMetering();
8585
string[] memory inputs = new string[](5);
8686

@@ -127,7 +127,7 @@ contract DropERC20BenchmarkTest is BaseTest {
127127
drop.claim(receiver, 100 ether, address(erc20), 1 ether, alp, "");
128128
}
129129

130-
// function test_bechmark_dropERC20_setClaimConditions_one_condition() public {
130+
// function test_benchmark_dropERC20_setClaimConditions_one_condition() public {
131131
// vm.pauseGasMetering();
132132
// string[] memory inputs = new string[](5);
133133

@@ -167,7 +167,7 @@ contract DropERC20BenchmarkTest is BaseTest {
167167
// drop.setClaimConditions(conditions, false);
168168
// }
169169

170-
// function test_bechmark_dropERC20_setClaimConditions_two_conditions() public {
170+
// function test_benchmark_dropERC20_setClaimConditions_two_conditions() public {
171171
// vm.pauseGasMetering();
172172
// string[] memory inputs = new string[](5);
173173

@@ -211,7 +211,7 @@ contract DropERC20BenchmarkTest is BaseTest {
211211
// drop.setClaimConditions(conditions, false);
212212
// }
213213

214-
// function test_bechmark_dropERC20_setClaimConditions_three_conditions() public {
214+
// function test_benchmark_dropERC20_setClaimConditions_three_conditions() public {
215215
// vm.pauseGasMetering();
216216
// string[] memory inputs = new string[](5);
217217

src/test/benchmark/DropERC721Benchmark.t.sol

+8-8
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ contract DropERC721BenchmarkTest is BaseTest {
2929
DropERC721 benchmark
3030
//////////////////////////////////////////////////////////////*/
3131

32-
function test_bechmark_dropERC721_claim_five_tokens() public {
32+
function test_benchmark_dropERC721_claim_five_tokens() public {
3333
vm.pauseGasMetering();
3434
string[] memory inputs = new string[](5);
3535

@@ -80,7 +80,7 @@ contract DropERC721BenchmarkTest is BaseTest {
8080
drop.claim(receiver, 5, address(erc20), 5, alp, "");
8181
}
8282

83-
function test_bechmark_dropERC721_setClaimConditions_five_conditions() public {
83+
function test_benchmark_dropERC721_setClaimConditions_five_conditions() public {
8484
vm.pauseGasMetering();
8585
string[] memory inputs = new string[](5);
8686

@@ -171,7 +171,7 @@ contract DropERC721BenchmarkTest is BaseTest {
171171
drop.reveal(0, key);
172172
}
173173

174-
// function test_bechmark_dropERC721_claim_one_token() public {
174+
// function test_benchmark_dropERC721_claim_one_token() public {
175175
// vm.pauseGasMetering();
176176
// string[] memory inputs = new string[](5);
177177

@@ -222,7 +222,7 @@ contract DropERC721BenchmarkTest is BaseTest {
222222
// drop.claim(receiver, 1, address(erc20), 5, alp, "");
223223
// }
224224

225-
// function test_bechmark_dropERC721_claim_two_tokens() public {
225+
// function test_benchmark_dropERC721_claim_two_tokens() public {
226226
// vm.pauseGasMetering();
227227
// string[] memory inputs = new string[](5);
228228

@@ -273,7 +273,7 @@ contract DropERC721BenchmarkTest is BaseTest {
273273
// drop.claim(receiver, 2, address(erc20), 5, alp, "");
274274
// }
275275

276-
// function test_bechmark_dropERC721_claim_three_tokens() public {
276+
// function test_benchmark_dropERC721_claim_three_tokens() public {
277277
// vm.pauseGasMetering();
278278
// string[] memory inputs = new string[](5);
279279

@@ -324,7 +324,7 @@ contract DropERC721BenchmarkTest is BaseTest {
324324
// drop.claim(receiver, 3, address(erc20), 5, alp, "");
325325
// }
326326

327-
// function test_bechmark_dropERC721_setClaimConditions_one_condition() public {
327+
// function test_benchmark_dropERC721_setClaimConditions_one_condition() public {
328328
// vm.pauseGasMetering();
329329
// string[] memory inputs = new string[](5);
330330

@@ -364,7 +364,7 @@ contract DropERC721BenchmarkTest is BaseTest {
364364
// drop.setClaimConditions(conditions, false);
365365
// }
366366

367-
// function test_bechmark_dropERC721_setClaimConditions_two_conditions() public {
367+
// function test_benchmark_dropERC721_setClaimConditions_two_conditions() public {
368368
// vm.pauseGasMetering();
369369
// string[] memory inputs = new string[](5);
370370

@@ -408,7 +408,7 @@ contract DropERC721BenchmarkTest is BaseTest {
408408
// drop.setClaimConditions(conditions, false);
409409
// }
410410

411-
// function test_bechmark_dropERC721_setClaimConditions_three_conditions() public {
411+
// function test_benchmark_dropERC721_setClaimConditions_three_conditions() public {
412412
// vm.pauseGasMetering();
413413
// string[] memory inputs = new string[](5);
414414

src/test/benchmark/SignatureDropBenchmark.t.sol

+5-5
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ contract SignatureDropBenchmarkTest is BaseTest {
5555
SignatureDrop benchmark
5656
//////////////////////////////////////////////////////////////*/
5757

58-
function test_bechmark_signatureDrop_claim_five_tokens() public {
58+
function test_benchmark_signatureDrop_claim_five_tokens() public {
5959
vm.pauseGasMetering();
6060
vm.warp(1);
6161

@@ -80,7 +80,7 @@ contract SignatureDropBenchmarkTest is BaseTest {
8080
sigdrop.claim(receiver, 5, address(0), 0, alp, "");
8181
}
8282

83-
function test_bechmark_signatureDrop_setClaimConditions() public {
83+
function test_benchmark_signatureDrop_setClaimConditions() public {
8484
vm.pauseGasMetering();
8585
vm.warp(1);
8686
bytes32[] memory proofs = new bytes32[](0);
@@ -137,7 +137,7 @@ contract SignatureDropBenchmarkTest is BaseTest {
137137
sigdrop.reveal(0, key);
138138
}
139139

140-
// function test_bechmark_signatureDrop_claim_one_token() public {
140+
// function test_benchmark_signatureDrop_claim_one_token() public {
141141
// vm.pauseGasMetering();
142142
// vm.warp(1);
143143

@@ -162,7 +162,7 @@ contract SignatureDropBenchmarkTest is BaseTest {
162162
// sigdrop.claim(receiver, 1, address(0), 0, alp, "");
163163
// }
164164

165-
// function test_bechmark_signatureDrop_claim_two_tokens() public {
165+
// function test_benchmark_signatureDrop_claim_two_tokens() public {
166166
// vm.pauseGasMetering();
167167
// vm.warp(1);
168168

@@ -187,7 +187,7 @@ contract SignatureDropBenchmarkTest is BaseTest {
187187
// sigdrop.claim(receiver, 2, address(0), 0, alp, "");
188188
// }
189189

190-
// function test_bechmark_signatureDrop_claim_three_tokens() public {
190+
// function test_benchmark_signatureDrop_claim_three_tokens() public {
191191
// vm.pauseGasMetering();
192192
// vm.warp(1);
193193

src/test/smart-wallet/utils/AABenchmarkArtifacts.sol

+2-2
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)