Skip to content

Commit 3b04247

Browse files
authored
Merge pull request #1015 from ProjectOpenSea/1.5
Seaport v1.5
2 parents b139397 + 5723c76 commit 3b04247

File tree

167 files changed

+45020
-2112
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

167 files changed

+45020
-2112
lines changed

.gas_reports/bb5d39539354e96cf6e69ad107906a0b6a46ea91.json renamed to .gas_reports/10d78fe57eb635a6d8a85e34236aa29548a1b52f.json

Lines changed: 56 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
{
2-
"commitHash": "bb5d39539354e96cf6e69ad107906a0b6a46ea91",
2+
"commitHash": "10d78fe57eb635a6d8a85e34236aa29548a1b52f",
33
"contractReports": {
44
"Conduit": {
55
"name": "Conduit",
66
"methods": [
77
{
88
"method": "execute",
99
"min": 77435,
10-
"max": 2179914,
11-
"avg": 451436,
10+
"max": 2232387,
11+
"avg": 460181,
1212
"calls": 6
1313
},
1414
{
@@ -21,8 +21,8 @@
2121
{
2222
"method": "executeWithBatch1155",
2323
"min": 97669,
24-
"max": 361418,
25-
"avg": 228749,
24+
"max": 361430,
25+
"avg": 228746,
2626
"calls": 4
2727
},
2828
{
@@ -71,7 +71,7 @@
7171
"method": "updateChannel",
7272
"min": 34454,
7373
"max": 121098,
74-
"avg": 117293,
74+
"avg": 117294,
7575
"calls": 71
7676
}
7777
],
@@ -106,7 +106,7 @@
106106
"method": "registerDigest",
107107
"min": 22239,
108108
"max": 44151,
109-
"avg": 36843,
109+
"avg": 36847,
110110
"calls": 3
111111
},
112112
{
@@ -148,7 +148,7 @@
148148
"method": "cancelOrders",
149149
"min": null,
150150
"max": null,
151-
"avg": 65327,
151+
"avg": 65339,
152152
"calls": 1
153153
}
154154
],
@@ -176,14 +176,14 @@
176176
"method": "assignPauser",
177177
"min": null,
178178
"max": null,
179-
"avg": 47183,
179+
"avg": 47171,
180180
"calls": 1
181181
},
182182
{
183183
"method": "cancelOrders",
184184
"min": null,
185185
"max": null,
186-
"avg": 73870,
186+
"avg": 73894,
187187
"calls": 1
188188
},
189189
{
@@ -195,23 +195,23 @@
195195
},
196196
{
197197
"method": "createZone",
198-
"min": 1154302,
199-
"max": 1154314,
200-
"avg": 1154312,
198+
"min": null,
199+
"max": null,
200+
"avg": 1154314,
201201
"calls": 31
202202
},
203203
{
204204
"method": "executeMatchAdvancedOrders",
205205
"min": null,
206206
"max": null,
207-
"avg": 289151,
207+
"avg": 289127,
208208
"calls": 2
209209
},
210210
{
211211
"method": "executeMatchOrders",
212212
"min": null,
213213
"max": null,
214-
"avg": 282751,
214+
"avg": 282727,
215215
"calls": 2
216216
},
217217
{
@@ -225,7 +225,7 @@
225225
"method": "transferOwnership",
226226
"min": null,
227227
"max": null,
228-
"avg": 47199,
228+
"avg": 47187,
229229
"calls": 2
230230
}
231231
],
@@ -238,8 +238,8 @@
238238
{
239239
"method": "prepare",
240240
"min": 49267,
241-
"max": 2351690,
242-
"avg": 1061771,
241+
"max": 2351702,
242+
"avg": 1061791,
243243
"calls": 26
244244
}
245245
],
@@ -251,37 +251,37 @@
251251
"methods": [
252252
{
253253
"method": "cancel",
254-
"min": 41226,
255-
"max": 58374,
256-
"avg": 54030,
254+
"min": 41250,
255+
"max": 58422,
256+
"avg": 54038,
257257
"calls": 16
258258
},
259259
{
260260
"method": "fulfillAdvancedOrder",
261261
"min": 96288,
262262
"max": 225181,
263-
"avg": 159350,
263+
"avg": 160736,
264264
"calls": 194
265265
},
266266
{
267267
"method": "fulfillAvailableAdvancedOrders",
268268
"min": 149626,
269-
"max": 260680,
270-
"avg": 203090,
269+
"max": 305236,
270+
"avg": 209036,
271271
"calls": 30
272272
},
273273
{
274274
"method": "fulfillAvailableOrders",
275275
"min": 164986,
276276
"max": 215752,
277-
"avg": 201359,
277+
"avg": 201368,
278278
"calls": 21
279279
},
280280
{
281281
"method": "fulfillBasicOrder",
282282
"min": 90639,
283283
"max": 1621627,
284-
"avg": 598705,
284+
"avg": 598707,
285285
"calls": 187
286286
},
287287
{
@@ -295,7 +295,7 @@
295295
"method": "fulfillOrder",
296296
"min": 119409,
297297
"max": 225080,
298-
"avg": 176770,
298+
"avg": 178008,
299299
"calls": 108
300300
},
301301
{
@@ -308,41 +308,41 @@
308308
{
309309
"method": "matchAdvancedOrders",
310310
"min": 179574,
311-
"max": 300473,
312-
"avg": 248933,
313-
"calls": 77
311+
"max": 300485,
312+
"avg": 249389,
313+
"calls": 75
314314
},
315315
{
316316
"method": "matchOrders",
317317
"min": 157522,
318318
"max": 348207,
319-
"avg": 264552,
320-
"calls": 151
319+
"avg": 264801,
320+
"calls": 149
321321
},
322322
{
323323
"method": "validate",
324324
"min": 53201,
325-
"max": 83910,
326-
"avg": 73546,
325+
"max": 83922,
326+
"avg": 73545,
327327
"calls": 29
328328
}
329329
],
330-
"bytecodeSize": 26114,
331-
"deployedBytecodeSize": 24389
330+
"bytecodeSize": 26128,
331+
"deployedBytecodeSize": 24403
332332
},
333333
"SeaportRouter": {
334334
"name": "SeaportRouter",
335335
"methods": [
336336
{
337337
"method": "fulfillAvailableAdvancedOrders",
338-
"min": 183954,
339-
"max": 311883,
340-
"avg": 233586,
338+
"min": 183796,
339+
"max": 311939,
340+
"avg": 233615,
341341
"calls": 6
342342
}
343343
],
344-
"bytecodeSize": 6345,
345-
"deployedBytecodeSize": 6158
344+
"bytecodeSize": 6417,
345+
"deployedBytecodeSize": 6230
346346
},
347347
"TestContractOfferer": {
348348
"name": "TestContractOfferer",
@@ -400,15 +400,15 @@
400400
"method": "mint",
401401
"min": 47235,
402402
"max": 49879,
403-
"avg": 49421,
404-
"calls": 236
403+
"avg": 49474,
404+
"calls": 273
405405
},
406406
{
407407
"method": "setApprovalForAll",
408408
"min": 26102,
409409
"max": 46002,
410-
"avg": 45380,
411-
"calls": 448
410+
"avg": 45468,
411+
"calls": 522
412412
}
413413
],
414414
"bytecodeSize": 4173,
@@ -421,8 +421,8 @@
421421
"method": "approve",
422422
"min": 28881,
423423
"max": 46245,
424-
"avg": 45780,
425-
"calls": 338
424+
"avg": 45749,
425+
"calls": 292
426426
},
427427
{
428428
"method": "blockTransfer",
@@ -433,10 +433,10 @@
433433
},
434434
{
435435
"method": "mint",
436-
"min": 33982,
436+
"min": 33994,
437437
"max": 68458,
438-
"avg": 67466,
439-
"calls": 164
438+
"avg": 67348,
439+
"calls": 141
440440
},
441441
{
442442
"method": "setNoReturnData",
@@ -456,15 +456,15 @@
456456
"method": "mint",
457457
"min": 51492,
458458
"max": 68796,
459-
"avg": 66042,
460-
"calls": 315
459+
"avg": 65926,
460+
"calls": 301
461461
},
462462
{
463463
"method": "setApprovalForAll",
464464
"min": 26195,
465465
"max": 46095,
466-
"avg": 45578,
467-
"calls": 540
466+
"avg": 45550,
467+
"calls": 512
468468
}
469469
],
470470
"bytecodeSize": 5238,
@@ -504,8 +504,8 @@
504504
{
505505
"method": "bulkTransfer",
506506
"min": 77935,
507-
"max": 1492854,
508-
"avg": 664509,
507+
"max": 1438866,
508+
"avg": 632608,
509509
"calls": 3
510510
}
511511
],

.gitignore

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,10 @@ html
3434
lcov.info
3535

3636
test/utils/eip712/gen.sol
37-
.gas_reports/*.md
37+
.gas_reports/*.md
38+
39+
# fuzz metrics
40+
metrics.txt
41+
*-metrics.txt
42+
43+
fuzz_debug.json

.gitmodules

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
1-
[submodule "lib/forge-std"]
2-
path = lib/forge-std
3-
url = https://github.com/foundry-rs/forge-std
4-
[submodule "lib/ds-test"]
5-
path = lib/ds-test
6-
url = https://github.com/dapphub/ds-test
71
[submodule "lib/murky"]
82
path = lib/murky
93
url = https://github.com/dmfxyz/murky
@@ -13,3 +7,17 @@
137
[submodule "lib/solmate"]
148
path = lib/solmate
159
url = https://github.com/transmissions11/solmate
10+
[submodule "lib/forge-std"]
11+
path = lib/forge-std
12+
url = https://github.com/foundry-rs/forge-std
13+
branch = v1.5.0
14+
[submodule "lib/solady"]
15+
path = lib/solady
16+
url = https://github.com/vectorized/solady
17+
branch = v0.0.84
18+
[submodule "lib/solarray"]
19+
path = lib/solarray
20+
url = https://github.com/emo-eth/solarray
21+
[submodule "lib/ds-test"]
22+
path = lib/ds-test
23+
url = https://github.com/dapphub/ds-test

README.md

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,15 @@ yarn profile
387387

388388
### Foundry Tests
389389

390-
Seaport also includes a suite of fuzzing tests written in solidity with Foundry.
390+
Seaport also includes a suite of fuzzing tests written in Solidity with Foundry.
391+
392+
Before running these tests, you will need to compile an optimized build by running:
393+
394+
```bash
395+
FOUNDRY_PROFILE=optimized forge build
396+
```
397+
398+
This should create an `optimized-out/` directory in your project root.
391399

392400
To run tests with full traces and debugging with source, create an `.env` file with the following line:
393401

@@ -397,7 +405,7 @@ FOUNDRY_PROFILE=debug
397405

398406
You may then run tests with `forge test`, optionally specifying a level of verbosity (anywhere from one to five `v`'s, eg, `-vvv`)
399407

400-
This will compile tests and contracts without `via-ir` enabled, which is must faster, but will not exactly match the deployed bytecode.
408+
This will compile tests and contracts without `via-ir` enabled, which is much faster, but will not exactly match the deployed bytecode.
401409

402410
To run tests against the actual bytecode intended to be deployed on networks, you will need to pre-compile the contracts, and remove the `FOUNDRY_PROFILE` variable from your `.env` file. **Note** that informative error traces may not be available, and the Forge debugger will not show the accompanying source code.
403411

@@ -410,10 +418,12 @@ To run Forge coverage tests and open the generated coverage report locally:
410418

411419
```bash
412420
brew install lcov
413-
SEAPORT_COVERAGE=true forge coverage --report summary --report lcov && genhtml lcov.info -o html --branch
421+
SEAPORT_COVERAGE=true forge coverage --report summary --report lcov && lcov -o lcov.info --remove lcov.info --rc lcov_branch_coverage=1 --rc lcov_function_coverage=1 "test/*" "script/*" && genhtml lcov.info -o html --branch
414422
open html/index.html
415423
```
416424

425+
When working on the test suite based around `FuzzEngine.sol`, using `FOUNDRY_PROFILE=moat_debug` will cut compile times roughly in half.
426+
417427
**Note** that Forge does not yet ignore specific filepaths when running coverage tests.
418428

419429
For information on Foundry, including installation and testing, see the [Foundry Book](https://book.getfoundry.sh/).

contracts/Seaport.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { Consideration } from "./lib/Consideration.sol";
55

66
/**
77
* @title Seaport
8-
* @custom:version 1.4
8+
* @custom:version 1.5
99
* @author 0age (0age.eth)
1010
* @custom:coauthor d1ll0n (d1ll0n.eth)
1111
* @custom:coauthor transmissions11 (t11s.eth)

0 commit comments

Comments
 (0)