@invisi-labs/sdk 1.1.1 → 1.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -57,6 +57,7 @@ function walletBalances(state) {
57
57
  }
58
58
 
59
59
  // src/session/operation-protocol.ts
60
+ import { creditPeriods } from "@invisi-labs/core";
60
61
  import {
61
62
  WitnessBuilder,
62
63
  buildCancelCreditCalldata,
@@ -212,6 +213,7 @@ async function witnessFor(protocol, plan, authorization) {
212
213
  }
213
214
  if (credit.draw) {
214
215
  return builder.drawCredit({
216
+ timestamp: plan.preparedAt.timestamp,
215
217
  params: credit.draw,
216
218
  deliveries: credit.deliveries,
217
219
  inputs: credit.inputs,
@@ -342,12 +344,836 @@ function operationExpired(plan, now) {
342
344
  const credit = plan.credit;
343
345
  if (credit?.topUp && now >= credit.topUp.previousExpiry) return true;
344
346
  if (credit?.creation && now >= credit.creation.expiry) return true;
345
- if (credit?.draw && credit.draw.expiries.some((expiry) => now >= expiry)) return true;
347
+ if (credit?.draw) {
348
+ if (credit.draw.expiries.some((expiry) => now >= expiry)) return true;
349
+ const prepared = creditPeriods(plan.preparedAt.timestamp), current2 = creditPeriods(now);
350
+ if (prepared.currentDay !== current2.currentDay || prepared.currentMonth !== current2.currentMonth)
351
+ return true;
352
+ }
346
353
  return false;
347
354
  }
348
355
 
349
356
  // src/data/gas-benchmarks.json
350
357
  var gas_benchmarks_default = [
358
+ {
359
+ formatVersion: 1,
360
+ id: "protocol-42f2546-621cbef5f84a-prague-credit-real",
361
+ deployment: {
362
+ chainId: "31337",
363
+ protocolAddress: "0xEeD9be753bccbCB21463C49f0c56cC0E48bEcf3c",
364
+ runtimeCodeHash: "0x80228a2080d224b4481fc5df24fe8ce080d4536c663b13ec7829ecf0ef46abbd",
365
+ tokenAddress: "0x99bbA657f2BbC93c02D617f8bA121cB8Fc104Acf"
366
+ },
367
+ source: {
368
+ protocolCommit: "42f2546b62312e4c11e21b8e6b2ff6f72187d6a6",
369
+ measuredAt: "2026-10-29T10:56:24.758Z",
370
+ chain: "Anvil 31337",
371
+ hardfork: "prague",
372
+ token: "MockERC20",
373
+ verifier: "real",
374
+ fingerprints: {
375
+ protocolSourceSha256: "621cbef5f84a133ca96674a2dba39b21b5f9fbc022977d4d2ab296d9d6e685e0",
376
+ dirtyDiffSha256: "eb2c41cca3802a47196181648397ec6f47fb2ba0efa8aa3800508d8d255fae3f",
377
+ compiledArtifactsSha256: "c0e658d74fe49caeebf5ef9deadc1751d9e48add690f7e9ab478de7a00dab7e4",
378
+ creditManifestSha256: "da819378af60471905cc902a43e464b58159e0c75bd46fb804ea9d34d8aa7ef6",
379
+ userManifestSha256: "067b6c50e4bc4d9c19dd29f25352db88d189a5f49aed0ed603daa70760e699df",
380
+ sdkSourceSha256: "37e1f82a447db741f46e1490b866ddf85718eab42c33d369cf5f5d2ec3a25c78"
381
+ },
382
+ toolchain: {
383
+ solidity: "0.8.38",
384
+ barretenberg: "6.0.0",
385
+ noir: "1.0.0-rc.6",
386
+ evmVersion: "prague",
387
+ optimizerRuns: 200,
388
+ anvil: "anvil Version: 1.8.6"
389
+ },
390
+ blockGasLimit: "500000000",
391
+ runtimeContracts: {
392
+ transact_user_slots14_direct_Verifier: {
393
+ address: "0x5FbDB2315678afecb367f032d93F642f64180aa3",
394
+ runtimeCodeHash: "0xedab185b2b9fc7d98660db2cdc99fe30b9d1341dfe568172a1626e322d208f7e"
395
+ },
396
+ "transact_user_slots14-adapter": {
397
+ address: "0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512",
398
+ runtimeCodeHash: "0xe222cd9c142bc2b13e083e6fe66ea76c0e1e9a194715bfa57082b625c55d867f"
399
+ },
400
+ transact_user_slots56_direct_Verifier: {
401
+ address: "0x9fE46736679d2D9a65F0992F2272dE9f3c7fa6e0",
402
+ runtimeCodeHash: "0x8913eb7060f38234aca199c4a1007892f68e703de48b588c436b24faaeb23a53"
403
+ },
404
+ "transact_user_slots56-adapter": {
405
+ address: "0xCf7Ed3AccA5a467e9e704C703E8D87F634fB0Fc9",
406
+ runtimeCodeHash: "0x97c416d190da0b9b8111a5ee17367e8a702ba7884019bf724155ae629a783477"
407
+ },
408
+ transact_user_slots112_direct_Verifier: {
409
+ address: "0xDc64a140Aa3E981100a9becA4E685f962f0cF6C9",
410
+ runtimeCodeHash: "0x501a4791ff0c0a96465ab5e0d42d0ce763bbbb7fd8aebe21929de4d460e1b42c"
411
+ },
412
+ "transact_user_slots112-adapter": {
413
+ address: "0x5FC8d32690cc91D4c39d9d3abcBD16989F875707",
414
+ runtimeCodeHash: "0xf22ed8ea34a4011650a41c1b9f664b5259ea5a8d66a82d706dab9611a38c109f"
415
+ },
416
+ transact_user_slots168_direct_Verifier: {
417
+ address: "0x0165878A594ca255338adfa4d48449f69242Eb8F",
418
+ runtimeCodeHash: "0xc22acdfa6f3e278ae46d194a1c50b905e4815fd7b61e39edb52334570670fdce"
419
+ },
420
+ "transact_user_slots168-adapter": {
421
+ address: "0xa513E6E4b8f2a923D98304ec87F64353C4D5C853",
422
+ runtimeCodeHash: "0x05a318f54d93440a501b6fc6be88e4e76e89d72f1be8333553cb4a61f4f9a0d7"
423
+ },
424
+ transact_aggregate_14_4_Verifier: {
425
+ address: "0x2279B7A0a67DB372996a5FaB50D91eAA73d2eBe6",
426
+ runtimeCodeHash: "0x7a6f2bafe4c61a72a99a195e188f2f4a32900c0cc63cc132e33881d8199fd446"
427
+ },
428
+ "transact_aggregate_14_4-adapter": {
429
+ address: "0x8A791620dd6260079BF849Dc5567aDC3F2FdC318",
430
+ runtimeCodeHash: "0x15877da9940d5b8dd4868ffa92ded3b93d6092c3963ba9e18b50f1ea15d89898"
431
+ },
432
+ transact_aggregate_14_8_Verifier: {
433
+ address: "0x610178dA211FEF7D417bC0e6FeD39F05609AD788",
434
+ runtimeCodeHash: "0x5667d16b39973813a499375f6885a3082d7bfcd6e3c0f3548d7de3131cd285f3"
435
+ },
436
+ "transact_aggregate_14_8-adapter": {
437
+ address: "0xB7f8BC63BbcaD18155201308C8f3540b07f84F5e",
438
+ runtimeCodeHash: "0x9d1a93c78edf7e81b4b6da10ab209b3fb009ed8355594f670559a67842d88cfc"
439
+ },
440
+ transact_aggregate_14_12_Verifier: {
441
+ address: "0xA51c1fc2f0D1a1b8494Ed1FE312d7C3a78Ed91C0",
442
+ runtimeCodeHash: "0xa4e67840a47182d4011d577981c2477bb4ab2bc36845bb136375f19f12c0800b"
443
+ },
444
+ "transact_aggregate_14_12-adapter": {
445
+ address: "0x0DCd1Bf9A1b36cE34237eEaFef220932846BCD82",
446
+ runtimeCodeHash: "0x96a6e170aafc0af9d46232ba00206d950bba85e65962d43501bafb6d7f9fe61d"
447
+ },
448
+ create_credit_direct_Verifier: {
449
+ address: "0x9A676e781A523b5d0C0e43731313A708CB607508",
450
+ runtimeCodeHash: "0xbdc6450bf9ba01001082f345b8bd21006a4f75274f32d026cf6e14270e6d56e6"
451
+ },
452
+ "create_credit-adapter": {
453
+ address: "0x0B306BF915C4d645ff596e518fAf3F9669b97016",
454
+ runtimeCodeHash: "0x3a95a22b32aef18ce053a7110056bbfbf13bb0b07932a49765ebb136528a4707"
455
+ },
456
+ credit_draw_slots1_direct_Verifier: {
457
+ address: "0x959922bE3CAee4b8Cd9a407cc3ac1C251C2007B1",
458
+ runtimeCodeHash: "0x47be80e72c3a22ea044638f6004de8c3a0264d5a0d17189c01153cdabfd7bab6"
459
+ },
460
+ "credit_draw_slots1-adapter": {
461
+ address: "0x9A9f2CCfdE556A7E9Ff0848998Aa4a0CFD8863AE",
462
+ runtimeCodeHash: "0x28f25aeb97659fb9253ae67f2ff284789710bc59e1ed077ffc7a07b800cbfcc1"
463
+ },
464
+ credit_draw_slots12_direct_Verifier: {
465
+ address: "0x68B1D87F95878fE05B998F19b66F4baba5De1aed",
466
+ runtimeCodeHash: "0x244d9ba22f5c736c2a5c42c466701e2a8ba7ae8108665133541026ea45d56e04"
467
+ },
468
+ "credit_draw_slots12-adapter": {
469
+ address: "0x3Aa5ebB10DC797CAC828524e59A333d0A371443c",
470
+ runtimeCodeHash: "0x60d48a35279d318a0621e5f59b293f44074463b8002ce180b7e6a31b995ac195"
471
+ },
472
+ credit_draw_slots50_direct_Verifier: {
473
+ address: "0xc6e7DF5E7b4f2A278906862b61205850344D4e7d",
474
+ runtimeCodeHash: "0x2ad5eb64bcfae34ef04111dd8f9c1ffc5fc8aa6c1ad3a65d8da78233f3390660"
475
+ },
476
+ "credit_draw_slots50-adapter": {
477
+ address: "0x59b670e9fA9D0A427751Af201D676719a970857b",
478
+ runtimeCodeHash: "0x468966de20e5c71cf7b6f3cda7fa7a76b5d80dc5ddf82119f441ea6a7c6c1e70"
479
+ },
480
+ credit_draw_slots120_direct_Verifier: {
481
+ address: "0x4ed7c70F96B99c776995fB64377f0d4aB3B0e1C1",
482
+ runtimeCodeHash: "0x523b6d211618bbd33d708f8198b9f3daafc10e2fa7a6a857db5795ed748a24e4"
483
+ },
484
+ "credit_draw_slots120-adapter": {
485
+ address: "0x322813Fd9A801c5507c9de605d63CEA4f2CE6c44",
486
+ runtimeCodeHash: "0xa91d585ce6037e703efb914205bf193881fde4f470d2fc63b615699b56175239"
487
+ },
488
+ credit_cancel_direct_Verifier: {
489
+ address: "0xa85233C63b9Ee964Add6F2cffe00Fd84eb32338f",
490
+ runtimeCodeHash: "0x182e86861a73f712071e40a6b8497b80c58c383eaa799182e7a50e39196399fd"
491
+ },
492
+ "credit_cancel-adapter": {
493
+ address: "0x4A679253410272dd5232B3Ff7cF5dbB88f295319",
494
+ runtimeCodeHash: "0xea1f0f22445eed5a92c8d6990219059b7e241ad66c55a6d9ddef22a94a0f015f"
495
+ },
496
+ credit_top_up_direct_Verifier: {
497
+ address: "0x7a2088a1bFc9d81c55368AE168C2C02570cB814F",
498
+ runtimeCodeHash: "0xeeb42a2b6377ab305b713d1caf4ca96edb302c6d1e1007239e5c70091819c266"
499
+ },
500
+ "credit_top_up-adapter": {
501
+ address: "0x09635F643e140090A9A8Dcd712eD6285858ceBef",
502
+ runtimeCodeHash: "0xbcf35a1d0e6c16dd01b09f944889aa5917d358d986fe399a0343d06bbdedaa61"
503
+ },
504
+ PrivateTransferVerifierRegistry: {
505
+ address: "0xc5a5C42992dECbae36851359345FE25997F5C42d",
506
+ runtimeCodeHash: "0x678684af147cb42c872184b6e22c8439748139ae0c5885032941ab8832fcb142"
507
+ },
508
+ CrossTreeVerifierRegistry: {
509
+ address: "0x67d269191c92Caf3cD7723F116c85e6E9bf55933",
510
+ runtimeCodeHash: "0xa5ee16fc7ed9f982450e42a48365a93bfca784fa884adcb8695b557e921cb93b"
511
+ },
512
+ DualVerifierRouter: {
513
+ address: "0xE6E340D132b5f46d1e472DebcD681B2aBc16e57E",
514
+ runtimeCodeHash: "0xcc094ed6f1bcc9270c597f62b817e4fc0a54770f373320133c2836e5b07ef2cc"
515
+ },
516
+ AtomicBatchOutputLib: {
517
+ address: "0xc3e53F4d16Ae77Db1c982e75a937B9f60FE63690",
518
+ runtimeCodeHash: "0x7c138c13e40b3ad0fee3b319d6c1580a21855cb5ecdda92571d530509d9b7316"
519
+ },
520
+ FundingLib: {
521
+ address: "0x84eA74d481Ee0A5332c457a4d796187F6Ba67fEB",
522
+ runtimeCodeHash: "0x898d13d6ec4123df85f21ee0f98678dcd9f9b9a60134f88e35c1ef1aaa0a45f9"
523
+ },
524
+ PrivateTransferLib: {
525
+ address: "0x9E545E3C0baAB3E08CdfD552C960A1050f373042",
526
+ runtimeCodeHash: "0xfb18f2dd0a39af1b99ae35c25e2746cb5bc85c205e041db5f440671d84c82e5e"
527
+ },
528
+ CrossTreeTransferLib: {
529
+ address: "0xa82fF9aFd8f496c3d6ac40E2a0F282E47488CFc9",
530
+ runtimeCodeHash: "0x7b33a08f2feb9da462b951c95482cb2909796a85c0fde7cc9a6b65ff8b7ff253"
531
+ },
532
+ AggregateTransferLib: {
533
+ address: "0x1613beB3B2C4f22Ee086B2b38C1476A3cE7f78E8",
534
+ runtimeCodeHash: "0xb3b4bd3a428f5c35712a57180f07b2249774d399ca87d4494929148ea26c5b99"
535
+ },
536
+ CreateCreditLib: {
537
+ address: "0x851356ae760d987E095750cCeb3bC6014560891C",
538
+ runtimeCodeHash: "0xe37a4b7c129c4fba5615d25ed8b7e898e64a306c68f7e599ade911db98fe881c"
539
+ },
540
+ CreditLifecycleLib: {
541
+ address: "0xf5059a5D33d5853360D16C683c16e67980206f36",
542
+ runtimeCodeHash: "0xf87a2227680efa7070071516587793e2e847c172b83261b8983c826f8a8c79bb"
543
+ },
544
+ ShieldLib: {
545
+ address: "0x95401dc811bb5740090279Ba06cfA8fcF6113778",
546
+ runtimeCodeHash: "0x371e57d8d324e44445a4ec30303b89a8bc98bbdbd03aeaa80faf0f821a65451d"
547
+ },
548
+ InvisiFactory: {
549
+ address: "0x998abeb3E57409262aE5b751f60747921B33613E",
550
+ runtimeCodeHash: "0xc56e5a0b71f4a1f63576a6663efb62b17c0d7520b6885a8d3483a356e12edf9b"
551
+ },
552
+ InvisiAddressRegistry: {
553
+ address: "0x70e0bA845a1A0F2DA3359C97E0285013525FFC49",
554
+ runtimeCodeHash: "0x007da3f4e888366ba0eed52cd511c4a369359291387ad19ca37e89eb395fce30"
555
+ },
556
+ InvisiProtocol: {
557
+ address: "0xEeD9be753bccbCB21463C49f0c56cC0E48bEcf3c",
558
+ runtimeCodeHash: "0x80228a2080d224b4481fc5df24fe8ce080d4536c663b13ec7829ecf0ef46abbd"
559
+ },
560
+ MockERC20: {
561
+ address: "0x99bbA657f2BbC93c02D617f8bA121cB8Fc104Acf",
562
+ runtimeCodeHash: "0xf7f676b5c54f6e94f82f0de65a0117468a0d915e8a79d150e74f76bd6d7f708b"
563
+ }
564
+ },
565
+ assumptions: [
566
+ "normal CREATE/Factory deployment and fresh registry; EIP170/EIP3860 unchanged; no code/storage injection",
567
+ "Solidity0.8.38 optimizer200 Prague; pinned BB6.0.0 real verifiers; every native proof independently verified",
568
+ "one physical source tree and 123 existing leaves shared by every sample; top-up has two authenticated source groups; no rollover or screener",
569
+ "funding/approvals/121 genuine Credit seeds/usage-seed draw/payout reset excluded from business gas",
570
+ "each round restores identical token balances, exact caller allowance100, note cursor, nullifiers and baseline; spender payout starts zero",
571
+ "complete receipt.gasUsed is measured, including verifier/calldata/logging/output insertion; memo0",
572
+ "Prague local block gas limit500000000; measured transactions may be unmineable under lower network transaction/block limits",
573
+ "observed three-sample ranges are neither a confidence interval nor a recommended transaction gas limit"
574
+ ]
575
+ },
576
+ measurements: [
577
+ {
578
+ id: "create-credit-caller-0x0",
579
+ shape: {
580
+ kind: "create-credit",
581
+ target: "evm",
582
+ capacity: 10,
583
+ noteInputs: 0,
584
+ noteOutputs: 0,
585
+ sourceTrees: 0,
586
+ creditInputs: 0,
587
+ creditOutputs: 1,
588
+ creditRemainders: 0,
589
+ funding: "caller",
590
+ permit: false,
591
+ deliveryBytes: 1132
592
+ },
593
+ circuit: {
594
+ circuitName: "create_credit",
595
+ target: "evm",
596
+ artifactSha256: "3ed6cfdee4f5fd840f023580f76c208768777fea79737f2511377e5c55be0230",
597
+ vkSha256: "56f663c6053be0d158a271022d200c732597efd3a2e0be48fe94549d0b1795e0"
598
+ },
599
+ samples: [
600
+ {
601
+ gasUsed: "1574696",
602
+ transactionHash: "0x76112c532a1b5f24ad84fb83f91789ba4acd15ed9473ec9a0267cd5fe605448d",
603
+ blockNumber: "172",
604
+ blockHash: "0x0d91421e94947132a19f38ffdd76932c2d85add201de3d9189325ed3568125a7",
605
+ calldataBytes: 11780
606
+ },
607
+ {
608
+ gasUsed: "1574576",
609
+ transactionHash: "0x545f72d9d207329bfc69ef0d1e96470c614924d5e463d974cc001712bf619fd8",
610
+ blockNumber: "172",
611
+ blockHash: "0x2053f97a2b2f3cf66e14da0ab9c1d7bd462d2d4f3ef2b13021aefcddedb71cf8",
612
+ calldataBytes: 11780
613
+ },
614
+ {
615
+ gasUsed: "1574612",
616
+ transactionHash: "0x880ec0c666068d0756fba39947dc5b211aeebb31f41bd1e1e54856b090f65d34",
617
+ blockNumber: "172",
618
+ blockHash: "0xbb86ed21379a917e9688a3c90364ae8fbe1ba633ac068360e0a82bf4d3113b6d",
619
+ calldataBytes: 11780
620
+ }
621
+ ]
622
+ },
623
+ {
624
+ id: "create-credit-1x1",
625
+ shape: {
626
+ kind: "create-credit",
627
+ target: "evm",
628
+ capacity: 10,
629
+ noteInputs: 1,
630
+ noteOutputs: 1,
631
+ sourceTrees: 1,
632
+ creditInputs: 0,
633
+ creditOutputs: 1,
634
+ creditRemainders: 0,
635
+ funding: "none",
636
+ permit: false,
637
+ deliveryBytes: 1360
638
+ },
639
+ circuit: {
640
+ circuitName: "create_credit",
641
+ target: "evm",
642
+ artifactSha256: "3ed6cfdee4f5fd840f023580f76c208768777fea79737f2511377e5c55be0230",
643
+ vkSha256: "56f663c6053be0d158a271022d200c732597efd3a2e0be48fe94549d0b1795e0"
644
+ },
645
+ samples: [
646
+ {
647
+ gasUsed: "1671641",
648
+ transactionHash: "0x24ca3f03681aeb188b48989d5eaf7dd264a8c32e828acd34ff1b44be74f17ea6",
649
+ blockNumber: "172",
650
+ blockHash: "0xcdac07aa5d3ec187874dc1fc9be65503235289c7036ebe455feaf5161db42bb5",
651
+ calldataBytes: 12132
652
+ },
653
+ {
654
+ gasUsed: "1671509",
655
+ transactionHash: "0x31a7f69ab02effa5fdd2e02bd02fb7e715a54786813261113fd7c07a0d3ef549",
656
+ blockNumber: "172",
657
+ blockHash: "0xc78ca874aa22cc6b8ea19e12a2806ba448a0f844345450d3fedc9841ea71c3a8",
658
+ calldataBytes: 12132
659
+ },
660
+ {
661
+ gasUsed: "1671485",
662
+ transactionHash: "0xc5a30116885dcac8b3631c15847544cfeb91c46bde44c3765ac0ce42e3259157",
663
+ blockNumber: "172",
664
+ blockHash: "0x4a2c90ff972da4d37408567062779762efbb5790d4784d03842ee2c926c8c894",
665
+ calldataBytes: 12132
666
+ }
667
+ ]
668
+ },
669
+ {
670
+ id: "draw-credit-1-partial",
671
+ shape: {
672
+ kind: "draw-credit",
673
+ target: "evm",
674
+ capacity: 1,
675
+ noteInputs: 0,
676
+ noteOutputs: 0,
677
+ sourceTrees: 1,
678
+ creditInputs: 1,
679
+ creditOutputs: 1,
680
+ creditRemainders: 1,
681
+ funding: "none",
682
+ permit: false,
683
+ deliveryBytes: 1132
684
+ },
685
+ circuit: {
686
+ circuitName: "credit_draw_slots1",
687
+ target: "evm",
688
+ artifactSha256: "4542b227e0552b45c302f1dace21cadeba4962c96244e021472f1f7531cff8d1",
689
+ vkSha256: "43c051a2bedf9454c12e70b10156361e414944823ba23e80662c16c7ced0a2ce"
690
+ },
691
+ samples: [
692
+ {
693
+ gasUsed: "1588303",
694
+ transactionHash: "0x85c5180692470aa952aa13eb29ca0404d4f5b5192cb31475f90d03d78864895e",
695
+ blockNumber: "172",
696
+ blockHash: "0xfe4876c0a2ebf05385a46562bca693b6df80da731fd9651117593916015dc38c",
697
+ calldataBytes: 11588
698
+ },
699
+ {
700
+ gasUsed: "1588303",
701
+ transactionHash: "0x61684313840623187ca1205b4b07b43a08038448524ee1a028c7e14050032682",
702
+ blockNumber: "172",
703
+ blockHash: "0x9726d31c10e6516e38e3f63c84fc4b9a8a161486d35e0d8d07e6829261a88fe7",
704
+ calldataBytes: 11588
705
+ },
706
+ {
707
+ gasUsed: "1588255",
708
+ transactionHash: "0x0aa052fb8e356cc81dd73bcdae72f760937cd2e56bd4a3e8eb5878208b4f7596",
709
+ blockNumber: "172",
710
+ blockHash: "0x2c958cfba0627e18cd5cb47001b278628c305071929596e3335d770b92c1dc16",
711
+ calldataBytes: 11588
712
+ }
713
+ ]
714
+ },
715
+ {
716
+ id: "draw-credit-1-full",
717
+ shape: {
718
+ kind: "draw-credit",
719
+ target: "evm",
720
+ capacity: 1,
721
+ noteInputs: 0,
722
+ noteOutputs: 0,
723
+ sourceTrees: 1,
724
+ creditInputs: 1,
725
+ creditOutputs: 0,
726
+ creditRemainders: 0,
727
+ funding: "none",
728
+ permit: false,
729
+ deliveryBytes: 0
730
+ },
731
+ circuit: {
732
+ circuitName: "credit_draw_slots1",
733
+ target: "evm",
734
+ artifactSha256: "4542b227e0552b45c302f1dace21cadeba4962c96244e021472f1f7531cff8d1",
735
+ vkSha256: "43c051a2bedf9454c12e70b10156361e414944823ba23e80662c16c7ced0a2ce"
736
+ },
737
+ samples: [
738
+ {
739
+ gasUsed: "1042812",
740
+ transactionHash: "0xb5d55729d975abdc92ca44c0b72e44a0d5841da8b23dc11b5bd31f46d88a341a",
741
+ blockNumber: "172",
742
+ blockHash: "0x8a6ddbe2f1630e1956485cac7984fb9cdc4fbb26b10522e158b38e2970ee4f3b",
743
+ calldataBytes: 10372
744
+ },
745
+ {
746
+ gasUsed: "1042824",
747
+ transactionHash: "0xf64f3186fbf94fcbd9fb12426c714b4a8425599e1a7e5677866fae3d6873b7ae",
748
+ blockNumber: "172",
749
+ blockHash: "0xd630c44d8ce96234ec836dd2178caac2a6d0bc2df5cf37df1534eb8896be48d3",
750
+ calldataBytes: 10372
751
+ },
752
+ {
753
+ gasUsed: "1042884",
754
+ transactionHash: "0xdf634e809b87603a62292ef046fa5e84715561fa76ef121c768303dd779568f1",
755
+ blockNumber: "172",
756
+ blockHash: "0x09cad4a799360bdf825c3ad70fe374b7fe2df802f8ee37ccb7f26ffc49aa2a3a",
757
+ calldataBytes: 10372
758
+ }
759
+ ]
760
+ },
761
+ {
762
+ id: "draw-credit-12-partial",
763
+ shape: {
764
+ kind: "draw-credit",
765
+ target: "evm",
766
+ capacity: 12,
767
+ noteInputs: 0,
768
+ noteOutputs: 0,
769
+ sourceTrees: 1,
770
+ creditInputs: 12,
771
+ creditOutputs: 12,
772
+ creditRemainders: 12,
773
+ funding: "none",
774
+ permit: false,
775
+ deliveryBytes: 13584
776
+ },
777
+ circuit: {
778
+ circuitName: "credit_draw_slots12",
779
+ target: "evm",
780
+ artifactSha256: "dd72b0867fc3be7cd90de263bd2d0892075cb18eb4f6dd671b13111710f10369",
781
+ vkSha256: "5e31d771e6294993736078596d9c69f21fe7595eda50e3cce6d7406b65cf1443"
782
+ },
783
+ samples: [
784
+ {
785
+ gasUsed: "3102895",
786
+ transactionHash: "0x699ba81f296f4af397a8dfaf96adf14d00d0f7dd69c0b09608641fc9b99fc28f",
787
+ blockNumber: "172",
788
+ blockHash: "0x8d318f563f5563fa5c213617481089f75aab3a6e9d14818db107ac20a8c20ffb",
789
+ calldataBytes: 30276
790
+ },
791
+ {
792
+ gasUsed: "3102871",
793
+ transactionHash: "0xddfc1c6c505f6c54f4d9aabc96a02eb6b606182e8ad708a578eacd274d885dee",
794
+ blockNumber: "172",
795
+ blockHash: "0xcc7738fe329a608241615dc43b7d16e075eb62be202ea8aaf4ae27a5278bf438",
796
+ calldataBytes: 30276
797
+ },
798
+ {
799
+ gasUsed: "3103171",
800
+ transactionHash: "0x6efab6408d927e1877f1f6c33ecd285a128382f7d1dfe6e123927b035781c8aa",
801
+ blockNumber: "172",
802
+ blockHash: "0xcb4588df9ecdca0d353ccbd226e1d5d07f21e6dc93875e41cdd5f64568859f4d",
803
+ calldataBytes: 30276
804
+ }
805
+ ]
806
+ },
807
+ {
808
+ id: "draw-credit-12-full",
809
+ shape: {
810
+ kind: "draw-credit",
811
+ target: "evm",
812
+ capacity: 12,
813
+ noteInputs: 0,
814
+ noteOutputs: 0,
815
+ sourceTrees: 1,
816
+ creditInputs: 12,
817
+ creditOutputs: 0,
818
+ creditRemainders: 0,
819
+ funding: "none",
820
+ permit: false,
821
+ deliveryBytes: 0
822
+ },
823
+ circuit: {
824
+ circuitName: "credit_draw_slots12",
825
+ target: "evm",
826
+ artifactSha256: "dd72b0867fc3be7cd90de263bd2d0892075cb18eb4f6dd671b13111710f10369",
827
+ vkSha256: "5e31d771e6294993736078596d9c69f21fe7595eda50e3cce6d7406b65cf1443"
828
+ },
829
+ samples: [
830
+ {
831
+ gasUsed: "1536675",
832
+ transactionHash: "0xc0d3eef8e6b0e90984d776a5e41bcdce1e0ca0bc6dc3a71616e4768e80c01546",
833
+ blockNumber: "172",
834
+ blockHash: "0x22dfac3d8e9913a6a1f2ff84faaece4ed59bfe1cb74e06a60131ff28cc6c2f9d",
835
+ calldataBytes: 15684
836
+ },
837
+ {
838
+ gasUsed: "1536675",
839
+ transactionHash: "0x9879d86a1eaa550a6a6afaeeb0f5f07745d5dcd9caa07b660d7fb512911dc67e",
840
+ blockNumber: "172",
841
+ blockHash: "0xf88ba9f1b7a0c627338a61bbabe1c650bdfcd7fa1c56433d6853f492135b753d",
842
+ calldataBytes: 15684
843
+ },
844
+ {
845
+ gasUsed: "1536711",
846
+ transactionHash: "0xbd8f75a021a8ce8dc1900bd2d84d723acc6a64018844050a5aa2f8712cf7fd6b",
847
+ blockNumber: "172",
848
+ blockHash: "0xa55b539c2ea4e10ce9a9ee8e6de9cf1daa97263b51f32cfef8342c100b663b0f",
849
+ calldataBytes: 15684
850
+ }
851
+ ]
852
+ },
853
+ {
854
+ id: "draw-credit-50-partial",
855
+ shape: {
856
+ kind: "draw-credit",
857
+ target: "evm",
858
+ capacity: 50,
859
+ noteInputs: 0,
860
+ noteOutputs: 0,
861
+ sourceTrees: 1,
862
+ creditInputs: 50,
863
+ creditOutputs: 50,
864
+ creditRemainders: 50,
865
+ funding: "none",
866
+ permit: false,
867
+ deliveryBytes: 56600
868
+ },
869
+ circuit: {
870
+ circuitName: "credit_draw_slots50",
871
+ target: "evm",
872
+ artifactSha256: "09c7469866748b4c0c4bbf2b040844771948a170999f6dc7a38fe5c0ecda4054",
873
+ vkSha256: "7b613225b6f32a077011d4196c356e836d22dcd116efe687fde53144fbd8db9f"
874
+ },
875
+ samples: [
876
+ {
877
+ gasUsed: "8015473",
878
+ transactionHash: "0x5dcc0fa08abaf5212424ac6f3e2f3bb8a0bd333f90ef6e421f8d3fe370ca1acf",
879
+ blockNumber: "172",
880
+ blockHash: "0x3197c523dece3492226c5021f974e7c02db2e686265943d03a5550c6cb96a12e",
881
+ calldataBytes: 94276
882
+ },
883
+ {
884
+ gasUsed: "8015449",
885
+ transactionHash: "0x6a55f88551a45b3e118cde0607cfff1ef0b6ab15ad9472e838412d9ce714b42a",
886
+ blockNumber: "172",
887
+ blockHash: "0xea82c8962d45db8361bd67ed326806f21c511bd51550adc453d0c3e5cab3a7ae",
888
+ calldataBytes: 94276
889
+ },
890
+ {
891
+ gasUsed: "8015149",
892
+ transactionHash: "0x2cc8d474a92abe91f8025109a70cf1f9f081dbec43aa4a475ab9f33222cfc76b",
893
+ blockNumber: "172",
894
+ blockHash: "0x4398f419da699ccca33867852d4975b5c461a40bb01cd5241a0e6dcacaeb78b3",
895
+ calldataBytes: 94276
896
+ }
897
+ ]
898
+ },
899
+ {
900
+ id: "draw-credit-50-full",
901
+ shape: {
902
+ kind: "draw-credit",
903
+ target: "evm",
904
+ capacity: 50,
905
+ noteInputs: 0,
906
+ noteOutputs: 0,
907
+ sourceTrees: 1,
908
+ creditInputs: 50,
909
+ creditOutputs: 0,
910
+ creditRemainders: 0,
911
+ funding: "none",
912
+ permit: false,
913
+ deliveryBytes: 0
914
+ },
915
+ circuit: {
916
+ circuitName: "credit_draw_slots50",
917
+ target: "evm",
918
+ artifactSha256: "09c7469866748b4c0c4bbf2b040844771948a170999f6dc7a38fe5c0ecda4054",
919
+ vkSha256: "7b613225b6f32a077011d4196c356e836d22dcd116efe687fde53144fbd8db9f"
920
+ },
921
+ samples: [
922
+ {
923
+ gasUsed: "3216708",
924
+ transactionHash: "0x16933368d26ea1d7fbe69027c700671df832ad308944eeff42e7c2da40297b06",
925
+ blockNumber: "172",
926
+ blockHash: "0x0739a6f4188b8bdeae7bd5460960086d04adfea993d07d65b2b3630ad01b8cab",
927
+ calldataBytes: 33476
928
+ },
929
+ {
930
+ gasUsed: "3216840",
931
+ transactionHash: "0x45dc15a62b1661f54e167cf13b9693770370c926a8a7af959da7354e9bb4aa6e",
932
+ blockNumber: "172",
933
+ blockHash: "0xf2e294db9af3b11814fed1dec358b8370ea28a99189211f883c9b0012349d677",
934
+ calldataBytes: 33476
935
+ },
936
+ {
937
+ gasUsed: "3216744",
938
+ transactionHash: "0x2c827753026ea421497534a01bcc2adaca866a7612f570dad3fcf18c660f8590",
939
+ blockNumber: "172",
940
+ blockHash: "0x3ccd465528ff22e6d1955670220df3565899a16dd683f71c83c9810f2df420b4",
941
+ calldataBytes: 33476
942
+ }
943
+ ]
944
+ },
945
+ {
946
+ id: "draw-credit-120-partial",
947
+ shape: {
948
+ kind: "draw-credit",
949
+ target: "evm",
950
+ capacity: 120,
951
+ noteInputs: 0,
952
+ noteOutputs: 0,
953
+ sourceTrees: 1,
954
+ creditInputs: 120,
955
+ creditOutputs: 120,
956
+ creditRemainders: 120,
957
+ funding: "none",
958
+ permit: false,
959
+ deliveryBytes: 135840
960
+ },
961
+ circuit: {
962
+ circuitName: "credit_draw_slots120",
963
+ target: "evm",
964
+ artifactSha256: "6ccd0366a669c50fd5da875c3eae194fe8aa4c36d35a5f9ebfd64636ea599b48",
965
+ vkSha256: "d715848afc5c1ecdfcef5ed5026865abef5040a3bc232fd65330a5ffee8475fb"
966
+ },
967
+ samples: [
968
+ {
969
+ gasUsed: "17458512",
970
+ transactionHash: "0x84dd6bda5f3172a53e899051fd226dc5869edb796bd513a33e7f224bed13f4ae",
971
+ blockNumber: "172",
972
+ blockHash: "0xfca82de1e112b92319185d8c3f0115e0aa339d0247ea65970eb0d37ba958b08e",
973
+ calldataBytes: 211140
974
+ },
975
+ {
976
+ gasUsed: "17458224",
977
+ transactionHash: "0xae26838942cf8b5499d43cb5e74681ae87aec77890a8eabddd692ff83830e013",
978
+ blockNumber: "172",
979
+ blockHash: "0x3e513447e0cfdbb682a95b7a719b0d300ec46b0ee22b518eaae7fb082f6436e7",
980
+ calldataBytes: 211140
981
+ },
982
+ {
983
+ gasUsed: "17458524",
984
+ transactionHash: "0xeaa07e77fe958f4317e71b07ddb876482ae9c5172fd6d6cefaacc551dbbda7d5",
985
+ blockNumber: "172",
986
+ blockHash: "0x12b34c1fd2e15480276052842157c2a6355acdd43d7bd01ae7511c3f39e0ecfc",
987
+ calldataBytes: 211140
988
+ }
989
+ ]
990
+ },
991
+ {
992
+ id: "draw-credit-120-full",
993
+ shape: {
994
+ kind: "draw-credit",
995
+ target: "evm",
996
+ capacity: 120,
997
+ noteInputs: 0,
998
+ noteOutputs: 0,
999
+ sourceTrees: 1,
1000
+ creditInputs: 120,
1001
+ creditOutputs: 0,
1002
+ creditRemainders: 0,
1003
+ funding: "none",
1004
+ permit: false,
1005
+ deliveryBytes: 0
1006
+ },
1007
+ circuit: {
1008
+ circuitName: "credit_draw_slots120",
1009
+ target: "evm",
1010
+ artifactSha256: "6ccd0366a669c50fd5da875c3eae194fe8aa4c36d35a5f9ebfd64636ea599b48",
1011
+ vkSha256: "d715848afc5c1ecdfcef5ed5026865abef5040a3bc232fd65330a5ffee8475fb"
1012
+ },
1013
+ samples: [
1014
+ {
1015
+ gasUsed: "6289576",
1016
+ transactionHash: "0xbf11743f7edc5ed5ff334efc5e35634f45e48e4940d33ddd9c87d8fe444dafc5",
1017
+ blockNumber: "172",
1018
+ blockHash: "0x774de17971107b73cab2cd20f26b60665f55a37b0cc1147166babf16743e34d5",
1019
+ calldataBytes: 65220
1020
+ },
1021
+ {
1022
+ gasUsed: "6289768",
1023
+ transactionHash: "0x651bb13e0645ee8a08657db627f1072f5e964ddaff44f70f829440ed68488dea",
1024
+ blockNumber: "172",
1025
+ blockHash: "0xa9795828565fb0ce65bda295073106b8bbdc110bb8317d269839d3db3e312d5b",
1026
+ calldataBytes: 65220
1027
+ },
1028
+ {
1029
+ gasUsed: "6289720",
1030
+ transactionHash: "0x2a859d381cb4b50830971b1ffc9789b11569fc96147e130dae6fecd141f5ceb0",
1031
+ blockNumber: "172",
1032
+ blockHash: "0x7d990830157bfeff8e5cbe580e9effe97faa7676c9957ce32891b76c83961430",
1033
+ calldataBytes: 65220
1034
+ }
1035
+ ]
1036
+ },
1037
+ {
1038
+ id: "top-up-credit-1x1-unchanged-limits",
1039
+ shape: {
1040
+ kind: "top-up-credit",
1041
+ target: "evm",
1042
+ capacity: 10,
1043
+ noteInputs: 1,
1044
+ noteOutputs: 1,
1045
+ sourceTrees: 2,
1046
+ creditInputs: 1,
1047
+ creditOutputs: 1,
1048
+ creditRemainders: 0,
1049
+ funding: "none",
1050
+ permit: false,
1051
+ deliveryBytes: 1360
1052
+ },
1053
+ circuit: {
1054
+ circuitName: "credit_top_up",
1055
+ target: "evm",
1056
+ artifactSha256: "2ffebd5753ec1b0c050204d4f97498765fe61ea01a793a9b2466c2f97536345c",
1057
+ vkSha256: "40b02a9d2e7eb7b49daaac4b7760328537b7982fd5a225cc065bb74cd5ef44b3"
1058
+ },
1059
+ samples: [
1060
+ {
1061
+ gasUsed: "1711282",
1062
+ transactionHash: "0x74d45084bb07bacabbced09ee6ef69d8632a22a4493be783c326c47e929ba0ed",
1063
+ blockNumber: "172",
1064
+ blockHash: "0x3503643f7081b52ae20d4754a0e9b11f52034ae48059f5b5298546c2570fa091",
1065
+ calldataBytes: 12292
1066
+ },
1067
+ {
1068
+ gasUsed: "1711282",
1069
+ transactionHash: "0x4b5e2432d5571f6b56507b3ab995a8120560ba608959ff100f03b87873e72be6",
1070
+ blockNumber: "172",
1071
+ blockHash: "0xca15dc309371a5aa9c7bc5bf1d65c5b325c71528ce7856ba68a118114124fccc",
1072
+ calldataBytes: 12292
1073
+ },
1074
+ {
1075
+ gasUsed: "1711390",
1076
+ transactionHash: "0x304f3740b64c80dcc5c894fb30af59080d96a11e08371096ae695cbc46ef2c8b",
1077
+ blockNumber: "172",
1078
+ blockHash: "0x9671ed76d6b8e49a36ba229d3609289fcf70756f31277ac5fc0e3f08cd52304f",
1079
+ calldataBytes: 12292
1080
+ }
1081
+ ]
1082
+ },
1083
+ {
1084
+ id: "top-up-credit-1x1-changed-limits",
1085
+ shape: {
1086
+ kind: "top-up-credit",
1087
+ target: "evm",
1088
+ capacity: 10,
1089
+ noteInputs: 1,
1090
+ noteOutputs: 1,
1091
+ sourceTrees: 2,
1092
+ creditInputs: 1,
1093
+ creditOutputs: 1,
1094
+ creditRemainders: 0,
1095
+ funding: "none",
1096
+ permit: false,
1097
+ deliveryBytes: 1360
1098
+ },
1099
+ circuit: {
1100
+ circuitName: "credit_top_up",
1101
+ target: "evm",
1102
+ artifactSha256: "2ffebd5753ec1b0c050204d4f97498765fe61ea01a793a9b2466c2f97536345c",
1103
+ vkSha256: "40b02a9d2e7eb7b49daaac4b7760328537b7982fd5a225cc065bb74cd5ef44b3"
1104
+ },
1105
+ samples: [
1106
+ {
1107
+ gasUsed: "1711318",
1108
+ transactionHash: "0x65284df534b42631f8a592fb2a6efc16361a4cc122f1a8dd41418e7b950f48f1",
1109
+ blockNumber: "172",
1110
+ blockHash: "0xf198242a1edf5b133961568c9165648c829729e7bfbbf57a1e148551c971b87c",
1111
+ calldataBytes: 12292
1112
+ },
1113
+ {
1114
+ gasUsed: "1711438",
1115
+ transactionHash: "0xcee89a81e598974798365c4ebada806fb51196ee602334b0fffdbb25da0afe25",
1116
+ blockNumber: "172",
1117
+ blockHash: "0xb506a6fb54cc2f91b803211ed955aac0203fba93e2428f8f52ec0d413c90af09",
1118
+ calldataBytes: 12292
1119
+ },
1120
+ {
1121
+ gasUsed: "1711342",
1122
+ transactionHash: "0x957de5c79f365c9b0510b9e125a662317494aad50cb446edceef6f678d561cc7",
1123
+ blockNumber: "172",
1124
+ blockHash: "0xb1d5cffd6d6db58ade9d5e16d48b060b9ab2152415966dc809e7e70785472ab8",
1125
+ calldataBytes: 12292
1126
+ }
1127
+ ]
1128
+ },
1129
+ {
1130
+ id: "cancel-credit-1",
1131
+ shape: {
1132
+ kind: "cancel-credit",
1133
+ target: "evm",
1134
+ capacity: 1,
1135
+ noteInputs: 0,
1136
+ noteOutputs: 0,
1137
+ sourceTrees: 1,
1138
+ creditInputs: 1,
1139
+ creditOutputs: 0,
1140
+ creditRemainders: 0,
1141
+ funding: "none",
1142
+ permit: false,
1143
+ deliveryBytes: 0
1144
+ },
1145
+ circuit: {
1146
+ circuitName: "credit_cancel",
1147
+ target: "evm",
1148
+ artifactSha256: "b4459c2cf756d096e37291cf4d7cd129866b6d420b6d03c928f383b057112ccb",
1149
+ vkSha256: "fc8ad196ef15f3328afcc8f01d867a3ebefd15451c2813948442fab1923b73b2"
1150
+ },
1151
+ samples: [
1152
+ {
1153
+ gasUsed: "985543",
1154
+ transactionHash: "0x29ca63fbefcc5e92dbc86f67d6280993e567a5dd02ff3defd7f3251ce711865e",
1155
+ blockNumber: "172",
1156
+ blockHash: "0xecd7808fe9f7467af917069bd7a82ab0324e3cbab8dcad622b089d6e3eee9a58",
1157
+ calldataBytes: 9540
1158
+ },
1159
+ {
1160
+ gasUsed: "985795",
1161
+ transactionHash: "0xaf8bca0769330f89b647363f99b752dbbe6fdbb8b1aae912224f6a3a59f40faa",
1162
+ blockNumber: "172",
1163
+ blockHash: "0x58e1358e02f189d57628fa7c504b87fb000fe60eb9f0a0c3c0e58dae876e64da",
1164
+ calldataBytes: 9540
1165
+ },
1166
+ {
1167
+ gasUsed: "985711",
1168
+ transactionHash: "0x2c911fd5a422f6f72f2a00b16872b7e46e182d39b8f5bfa9e3b2bf99d3155da7",
1169
+ blockNumber: "172",
1170
+ blockHash: "0x9da571cbe63f52232261ee1527d5ed97a9e90e374b4fcda97d04feb25114d18e",
1171
+ calldataBytes: 9540
1172
+ }
1173
+ ]
1174
+ }
1175
+ ]
1176
+ },
351
1177
  {
352
1178
  formatVersion: 1,
353
1179
  id: "protocol-92ef274-osaka-real",
@@ -772,190 +1598,6 @@ var gas_benchmarks_default = [
772
1598
  calldataBytes: 10116
773
1599
  }
774
1600
  ]
775
- },
776
- {
777
- id: "create-credit-1x1",
778
- shape: {
779
- kind: "create-credit",
780
- target: "evm",
781
- capacity: 10,
782
- noteInputs: 1,
783
- noteOutputs: 1,
784
- sourceTrees: 1,
785
- creditInputs: 0,
786
- creditOutputs: 1,
787
- creditRemainders: 0,
788
- funding: "none",
789
- permit: false,
790
- deliveryBytes: 1162
791
- },
792
- circuit: {
793
- circuitName: "create_credit",
794
- target: "evm",
795
- artifactSha256: "ab97cd5a036851a9748a5cfd8e6f9834e23090c8e95db4531aabfc37d3abb353",
796
- vkSha256: "fac0e65b768a28750323cca851990598af936611125b6cfa3f5c16b04c7d084f"
797
- },
798
- samples: [
799
- {
800
- gasUsed: "1627325",
801
- transactionHash: "0x7763d93a5b1e8797b5f4af2e1e5b1bb029a8b0f9f7b90bcc04f581947d826803",
802
- blockNumber: "49",
803
- blockHash: "0x93e51ae5e99c68dc642693d478e444330d8e26255ff5bb9aafc4a3f4e70d3a45",
804
- calldataBytes: 11940
805
- },
806
- {
807
- gasUsed: "1627385",
808
- transactionHash: "0xe246d59cafa2a26dddf21c8385dd843be4d4596388ebe23e936df84e7f906635",
809
- blockNumber: "49",
810
- blockHash: "0x3c24b2d6ed2a998562d34b49e0517515742a9b39d59aec38a9ac6b22be1b694b",
811
- calldataBytes: 11940
812
- },
813
- {
814
- gasUsed: "1627157",
815
- transactionHash: "0x2f7ed0b75435cc6a820d0cd90fd82d362f74787057413722b6eb3c6e37db87d3",
816
- blockNumber: "49",
817
- blockHash: "0x0a0301670b46017da772800c68bb941245ac1941c79fde9c85717632154e15ee",
818
- calldataBytes: 11940
819
- }
820
- ]
821
- },
822
- {
823
- id: "draw-credit-1-partial",
824
- shape: {
825
- kind: "draw-credit",
826
- target: "evm",
827
- capacity: 1,
828
- noteInputs: 0,
829
- noteOutputs: 0,
830
- sourceTrees: 1,
831
- creditInputs: 1,
832
- creditOutputs: 1,
833
- creditRemainders: 1,
834
- funding: "none",
835
- permit: false,
836
- deliveryBytes: 936
837
- },
838
- circuit: {
839
- circuitName: "credit_draw_slots1",
840
- target: "evm",
841
- artifactSha256: "f5e458790948f37a61a833fad52cf2cc3b26a59515d271de32e0caaa4e229eb5",
842
- vkSha256: "613699a440f50a0937e4c57e5152b5fdea42c31b10157d6b93226fef313df553"
843
- },
844
- samples: [
845
- {
846
- gasUsed: "1581294",
847
- transactionHash: "0xd438e22b0fa07a657279f182537e4996f1936f0881d5b7d637845f8ca2808aab",
848
- blockNumber: "49",
849
- blockHash: "0x9e384a3054530b1ff237a639bca1a559afb2b73b30e21c262aac85ebf480fc9b",
850
- calldataBytes: 11396
851
- },
852
- {
853
- gasUsed: "1581402",
854
- transactionHash: "0xa70ac3e7284b6e98f8591a6ba88e4ddfb23ecbd05343641d0532f34920e10b56",
855
- blockNumber: "49",
856
- blockHash: "0x37c5eb34ce96a841e96c36103a7ab65c1a3e08603dc9843efb0c0752c069f1d4",
857
- calldataBytes: 11396
858
- },
859
- {
860
- gasUsed: "1581174",
861
- transactionHash: "0xd062494979d0bc0e284ccb070f87b48f3e8e5befb6001f15a006dd2a4a72ca24",
862
- blockNumber: "49",
863
- blockHash: "0x12840d920f14163b2d29491f28cee616e1bb9fd9514a4debe10ae35256345fc1",
864
- calldataBytes: 11396
865
- }
866
- ]
867
- },
868
- {
869
- id: "top-up-credit-1x1",
870
- shape: {
871
- kind: "top-up-credit",
872
- target: "evm",
873
- capacity: 10,
874
- noteInputs: 1,
875
- noteOutputs: 1,
876
- sourceTrees: 2,
877
- creditInputs: 1,
878
- creditOutputs: 1,
879
- creditRemainders: 0,
880
- funding: "none",
881
- permit: false,
882
- deliveryBytes: 1162
883
- },
884
- circuit: {
885
- circuitName: "credit_top_up",
886
- target: "evm",
887
- artifactSha256: "ee9dbcf8be6f6c09478190996e90b1d39d4a10a00245950f69fc1d2c329c6e9b",
888
- vkSha256: "0c369fec0469b60baebb3be650bad42f3ccae6f0ff139cce6ad9a3f451ed7513"
889
- },
890
- samples: [
891
- {
892
- gasUsed: "1666948",
893
- transactionHash: "0x1403da01167962a4349d2655ea217bfcfc1a2390138bea0279792c44b4381dd2",
894
- blockNumber: "49",
895
- blockHash: "0xcb554ffcdb4afe5f6458e5d23ffbdd1fdbef9c23f982343065772c0b3e3dd633",
896
- calldataBytes: 12100
897
- },
898
- {
899
- gasUsed: "1666900",
900
- transactionHash: "0x3b5e54f29e3f888a443526cf23ab9255b3f0c7adf1d0d127c16b85f4c6a324d9",
901
- blockNumber: "49",
902
- blockHash: "0xeb304df6bdd24b249cac3197b543b0eaa6381ed75ad812dff248f914864105ed",
903
- calldataBytes: 12100
904
- },
905
- {
906
- gasUsed: "1666780",
907
- transactionHash: "0x81c5ef25268a719275cb3b80618c2af291e1f7b3f91d7e82cc26bc894a8c332a",
908
- blockNumber: "49",
909
- blockHash: "0xfa42070d6349fc8d559b8bd4ad0ee6b79089107540c4472b9e492b8f5a6bd3e4",
910
- calldataBytes: 12100
911
- }
912
- ]
913
- },
914
- {
915
- id: "cancel-credit-1",
916
- shape: {
917
- kind: "cancel-credit",
918
- target: "evm",
919
- capacity: 1,
920
- noteInputs: 0,
921
- noteOutputs: 0,
922
- sourceTrees: 1,
923
- creditInputs: 1,
924
- creditOutputs: 0,
925
- creditRemainders: 0,
926
- funding: "none",
927
- permit: false,
928
- deliveryBytes: 0
929
- },
930
- circuit: {
931
- circuitName: "credit_cancel",
932
- target: "evm",
933
- artifactSha256: "d332453a2b8c2c544747ac8d5f01912c9757f48d986226fd6a9b0e24d8321474",
934
- vkSha256: "1f8a3c20cb081d6a90962556da3124919cc4e5675e59ad31562af39299da02fb"
935
- },
936
- samples: [
937
- {
938
- gasUsed: "998146",
939
- transactionHash: "0x97bc72692d241e2c344b912804f9939061db5ef59cf4bb23922d93812e382160",
940
- blockNumber: "49",
941
- blockHash: "0x2e09df4df84a1c25961386febe8404531bb5da274836d50cc15a26c91b433a98",
942
- calldataBytes: 9540
943
- },
944
- {
945
- gasUsed: "998134",
946
- transactionHash: "0x26c5067b12c2bc4b694070784e6b19d4855efa6e77c2422f0c6b1567f061570a",
947
- blockNumber: "49",
948
- blockHash: "0xdd3f20520c09e001374cab58387e52c82446db053539e30dad28b0de679a333c",
949
- calldataBytes: 9540
950
- },
951
- {
952
- gasUsed: "998230",
953
- transactionHash: "0x5dc09445a405150da1445c22f50d6dd10d8d428a6a3f41ee90db7d3574657e31",
954
- blockNumber: "49",
955
- blockHash: "0x5c8f8223a50d2c8d48188a2db28ffa33c1b150a2fb465e99db4430949db3664b",
956
- calldataBytes: 9540
957
- }
958
- ]
959
1601
  }
960
1602
  ]
961
1603
  }
@@ -984,6 +1626,29 @@ function copyGasBenchmarks(profiles) {
984
1626
  for (const p of copy) {
985
1627
  if (p.formatVersion !== 1 || !p.id || !decimal.test(p.deployment.chainId) || !address.test(p.deployment.protocolAddress) || !address.test(p.deployment.tokenAddress) || !p.deployment.runtimeCodeHash || !word.test(p.deployment.runtimeCodeHash) || p.source.verifier !== "real" || !/^[0-9a-f]{40}$/i.test(p.source.protocolCommit) || !p.source.measuredAt || !Array.isArray(p.source.assumptions) || !p.source.assumptions.every((assumption) => typeof assumption === "string") || !p.measurements.length)
986
1628
  throw new Error("invalid gas benchmark profile");
1629
+ if (p.source.fingerprints && ![
1630
+ "protocolSourceSha256",
1631
+ "dirtyDiffSha256",
1632
+ "compiledArtifactsSha256",
1633
+ "creditManifestSha256",
1634
+ "userManifestSha256",
1635
+ "sdkSourceSha256"
1636
+ ].every((key) => {
1637
+ const v = p.source.fingerprints[key];
1638
+ return typeof v === "string" && /^[a-f0-9]{64}$/i.test(v);
1639
+ }))
1640
+ throw new Error("invalid benchmark source fingerprint");
1641
+ if (p.source.blockGasLimit !== void 0 && (!decimal.test(p.source.blockGasLimit) || BigInt(p.source.blockGasLimit) <= 0n))
1642
+ throw new Error("invalid benchmark block gas limit");
1643
+ if (p.source.runtimeContracts && !Object.values(p.source.runtimeContracts).every(
1644
+ (v) => address.test(v.address) && word.test(v.runtimeCodeHash)
1645
+ ))
1646
+ throw new Error("invalid benchmark runtime identity");
1647
+ if (p.source.toolchain && (!["solidity", "barretenberg", "noir", "evmVersion", "anvil"].every((key) => {
1648
+ const v = p.source.toolchain[key];
1649
+ return typeof v === "string" && v.length > 0;
1650
+ }) || !Number.isSafeInteger(p.source.toolchain.optimizerRuns) || p.source.toolchain.optimizerRuns < 0))
1651
+ throw new Error("invalid benchmark toolchain");
987
1652
  for (const m of p.measurements) {
988
1653
  if (!m.id || !m.samples.length || !["none", "caller", "signature"].includes(m.shape.funding) || typeof m.shape.permit !== "boolean")
989
1654
  throw new Error("invalid gas benchmark measurement");
@@ -1063,11 +1728,20 @@ function estimateBenchmarkGas(plan, protocol, profiles) {
1063
1728
  );
1064
1729
  if (!request.deployment.runtimeCodeHash || !candidates.length)
1065
1730
  return { ...base, available: false, reason: "deployment-not-covered" };
1066
- for (const profile of candidates) {
1067
- const measurement = profile.measurements.find(
1731
+ const exact = candidates.flatMap(
1732
+ (profile) => profile.measurements.filter(
1068
1733
  (m) => shapeKeys.every((key) => m.shape[key] === request.shape[key]) && sameCircuit(m.circuit, request.circuit)
1069
- );
1070
- if (!measurement) continue;
1734
+ ).map((measurement) => ({ profile, measurement }))
1735
+ );
1736
+ const mean = (measurement) => {
1737
+ const count = BigInt(measurement.samples.length);
1738
+ return (measurement.samples.reduce((sum, s) => sum + BigInt(s.gasUsed), 0n) + count - 1n) / count;
1739
+ };
1740
+ exact.sort(
1741
+ (a, b) => mean(a.measurement) > mean(b.measurement) ? -1 : mean(a.measurement) < mean(b.measurement) ? 1 : a.measurement.id.localeCompare(b.measurement.id)
1742
+ );
1743
+ if (exact.length) {
1744
+ const { profile, measurement } = exact[0];
1071
1745
  const gas = measurement.samples.map((sample) => BigInt(sample.gasUsed));
1072
1746
  const count = BigInt(gas.length);
1073
1747
  return {
@@ -1097,14 +1771,20 @@ function estimateShapeGas(request, profiles = defaultProfiles) {
1097
1771
  const matching = measurements.filter(
1098
1772
  (measurement) => measurement.shape.kind === request.shape.kind && measurement.shape.target === request.shape.target && sameCircuit(measurement.circuit, request.circuit)
1099
1773
  );
1100
- const exact = matching.find(
1774
+ const exact = matching.filter(
1101
1775
  (measurement) => shapeKeys.every((key) => measurement.shape[key] === request.shape[key])
1102
1776
  );
1103
- if (exact) {
1104
- const gas = exact.samples.map((sample) => BigInt(sample.gasUsed));
1105
- const count = BigInt(gas.length);
1106
- return { gasUnits: (gas.reduce((sum, value) => sum + value, 0n) + count - 1n) / count };
1777
+ if (exact.length) {
1778
+ const means = exact.map((m) => {
1779
+ const count = BigInt(m.samples.length);
1780
+ return (m.samples.reduce((sum, s) => sum + BigInt(s.gasUsed), 0n) + count - 1n) / count;
1781
+ });
1782
+ return { gasUnits: means.reduce((max, v) => v > max ? v : max) };
1107
1783
  }
1784
+ if (["create-credit", "draw-credit", "top-up-credit", "cancel-credit"].includes(
1785
+ request.shape.kind
1786
+ ) && !matching.length)
1787
+ throw new Error("No current Credit gas reference for this artifact and verification key");
1108
1788
  const candidates = matching.length ? matching : measurements.filter(
1109
1789
  (measurement) => measurement.shape.kind === request.shape.kind && measurement.shape.target === request.shape.target
1110
1790
  );
@@ -1119,7 +1799,22 @@ function estimateShapeGas(request, profiles = defaultProfiles) {
1119
1799
  "deliveryBytes",
1120
1800
  ...!matching.length ? ["capacity"] : []
1121
1801
  ];
1122
- const estimates = candidates.map((measurement) => {
1802
+ const groups = /* @__PURE__ */ new Map();
1803
+ for (const candidate of candidates) {
1804
+ const key = JSON.stringify([
1805
+ shapeKeys.map((k) => candidate.shape[k]),
1806
+ candidate.circuit?.circuitName,
1807
+ candidate.circuit?.target,
1808
+ candidate.circuit?.artifactSha256.toLowerCase(),
1809
+ candidate.circuit?.vkSha256.toLowerCase()
1810
+ ]);
1811
+ const previous = groups.get(key);
1812
+ groups.set(
1813
+ key,
1814
+ previous ? { ...candidate, samples: [...previous.samples, ...candidate.samples] } : candidate
1815
+ );
1816
+ }
1817
+ const estimates = [...groups.values()].map((measurement) => {
1123
1818
  let numerator = 1n;
1124
1819
  let denominator = 1n;
1125
1820
  for (const key of dimensions) {
@@ -1362,25 +2057,27 @@ function extractDeliveryCandidates(logs, context, confirmedThrough) {
1362
2057
  const tokens = array(a.tokens);
1363
2058
  const cs = array(a.commitments), tree = integer(a.treeId), start = index(a.startLeafIndex), packed = a.packedDeliveries;
1364
2059
  check(
1365
- typeof packed === "string" && /^0x(?:[0-9a-fA-F]{2})*$/.test(packed) && packed.length === 2 + 452 * cs.length,
2060
+ typeof packed === "string" && /^0x(?:[0-9a-fA-F]{2})*$/.test(packed),
1366
2061
  "invalid packed deliveries"
1367
2062
  );
1368
2063
  check(tokens.length === cs.length, "batch token count mismatch");
2064
+ check(start + cs.length <= 65536, "batch exceeds tree capacity");
2065
+ let offset = 2;
1369
2066
  cs.forEach((c, i) => {
1370
- const segment = packed.slice(2 + 452 * i, 2 + 452 * (i + 1));
1371
- add(
1372
- log,
1373
- tree,
1374
- start + i,
1375
- c,
1376
- "funds",
1377
- {
1378
- ciphertext: `0x${segment.slice(0, 316)}`,
1379
- clue: `0x${segment.slice(316)}`
1380
- },
1381
- tokens[i]
2067
+ check(offset + 4 <= packed.length, "truncated delivery length prefix");
2068
+ const length = Number.parseInt(packed.slice(offset, offset + 4), 16);
2069
+ offset += 4;
2070
+ check(
2071
+ length >= 160 && length <= 416 && offset + length * 2 + 136 <= packed.length,
2072
+ "invalid packed delivery length"
1382
2073
  );
2074
+ const ciphertext = `0x${packed.slice(offset, offset + length * 2)}`;
2075
+ offset += length * 2;
2076
+ const clue = `0x${packed.slice(offset, offset + 136)}`;
2077
+ offset += 136;
2078
+ add(log, tree, start + i, c, "funds", { ciphertext, clue }, tokens[i]);
1383
2079
  });
2080
+ check(offset === packed.length, "trailing packed delivery bytes");
1384
2081
  } else if (log.eventName === "CreditCreated") creation(log, a, a);
1385
2082
  else if (log.eventName === "CreditToppedUp")
1386
2083
  creation(log, a, object(object(a.params).creation));
@@ -1895,7 +2592,8 @@ async function creditLeaf(state) {
1895
2592
  n.amount,
1896
2593
  n.nonce,
1897
2594
  n.expiry,
1898
- await computeCreditSharedKeyHash(n.creditSharedKey)
2595
+ await computeCreditSharedKeyHash(n.creditSharedKey),
2596
+ n
1899
2597
  );
1900
2598
  }
1901
2599
 
@@ -2775,6 +3473,7 @@ import {
2775
3473
  // src/session/prepare-common.ts
2776
3474
  import { getAddress, hexlify } from "ethers";
2777
3475
  import {
3476
+ encodeMemo,
2778
3477
  MissingCapabilityError as MissingCapabilityError2,
2779
3478
  ReceivingAddress as ReceivingAddress2,
2780
3479
  computeNoteCommitment,
@@ -2840,7 +3539,15 @@ var Preparation = class {
2840
3539
  throw new Error("canonical wallet checkpoint changed; resync required");
2841
3540
  }
2842
3541
  }
2843
- return { context: { ...options.protocol.context, now: block.timestamp }, block, deadline };
3542
+ return {
3543
+ context: {
3544
+ ...options.protocol.context,
3545
+ now: block.timestamp,
3546
+ timestamp: block.timestamp
3547
+ },
3548
+ block,
3549
+ deadline
3550
+ };
2844
3551
  }
2845
3552
  async assertBlock(frame) {
2846
3553
  if ((await this.runtime.reader.getBlock(frame.block.number)).hash !== frame.block.hash) {
@@ -2884,6 +3591,7 @@ var Preparation = class {
2884
3591
  const recipient = await ReceivingAddress2.parse(payment.to).resolve(
2885
3592
  this.runtime.options.addressResolver
2886
3593
  );
3594
+ const memo = encodeMemo(payment.memo);
2887
3595
  const nonce = generateNonce();
2888
3596
  const identity = await computeNoteIdentity(BigInt(recipient.walletIdentity), nonce);
2889
3597
  const keys = recipient.getReceivingKeys();
@@ -2893,6 +3601,7 @@ var Preparation = class {
2893
3601
  tokenAddress: BigInt(context.tokenAddress),
2894
3602
  walletIdentity: recipient.walletIdentity,
2895
3603
  amount: payment.amount,
3604
+ ...memo.length === 0 ? {} : { memo },
2896
3605
  nonce
2897
3606
  };
2898
3607
  const commitment = await computeNoteCommitment(
@@ -3025,6 +3734,8 @@ function storedCandidates(inputs) {
3025
3734
  import { getAddress as getAddress2, hexlify as hexlify2, toBeHex } from "ethers";
3026
3735
  import {
3027
3736
  FIELD_MODULUS as FIELD_MODULUS3,
3737
+ normalizeCreditPolicy,
3738
+ applyCreditDrawUsage,
3028
3739
  ReceivingAddress as ReceivingAddress3,
3029
3740
  computeCreditNullifier as computeCreditNullifier2,
3030
3741
  computeCreditRecoveryPad,
@@ -3146,7 +3857,13 @@ var CreditPreparation = class {
3146
3857
  spenderWalletIdentity: spender.walletIdentity,
3147
3858
  ownerPayout: BigInt(ownerPayout),
3148
3859
  spenderPayout: BigInt(spenderPayout),
3860
+ ...normalizeCreditPolicy({
3861
+ singleLimit: options.singleLimit ?? 0n,
3862
+ dailyLimit: options.dailyLimit ?? 0n,
3863
+ monthlyLimit: options.monthlyLimit ?? 0n
3864
+ }),
3149
3865
  amount: options.amount,
3866
+ ...options.memo === void 0 ? {} : { memo: options.memo },
3150
3867
  expiry,
3151
3868
  nonce: generateNonce2(),
3152
3869
  creditSharedKey: generateCreditSharedKey()
@@ -3238,7 +3955,19 @@ var CreditPreparation = class {
3238
3955
  }
3239
3956
  const amount = positiveAmount(old.note.amount + options.additionalAmount, 126);
3240
3957
  const output = await this.seal(
3241
- { ...old, note: { ...old.note, amount, expiry, nonce: generateNonce2() } },
3958
+ {
3959
+ ...old,
3960
+ note: {
3961
+ ...old.note,
3962
+ singleLimit: options.singleLimit ?? old.note.singleLimit ?? 0n,
3963
+ dailyLimit: options.dailyLimit ?? old.note.dailyLimit ?? 0n,
3964
+ monthlyLimit: options.monthlyLimit ?? old.note.monthlyLimit ?? 0n,
3965
+ amount,
3966
+ expiry,
3967
+ nonce: generateNonce2(),
3968
+ ...options.memo === void 0 ? {} : { memo: options.memo }
3969
+ }
3970
+ },
3242
3971
  frame
3243
3972
  );
3244
3973
  return this.creation(
@@ -3284,6 +4013,7 @@ var CreditPreparation = class {
3284
4013
  }
3285
4014
  sources.set(member.source.treeId, member.source.merkleRoot);
3286
4015
  amounts.push(amount);
4016
+ const usage = applyCreditDrawUsage(n, amount, frame.block.timestamp);
3287
4017
  const remaining = n.amount - amount;
3288
4018
  if (remaining === 0n) {
3289
4019
  remainders.push(word2(0n));
@@ -3303,7 +4033,9 @@ var CreditPreparation = class {
3303
4033
  ...state,
3304
4034
  note: {
3305
4035
  ...n,
4036
+ ...usage,
3306
4037
  amount: remaining,
4038
+ ...options.credits[i].memo === void 0 ? {} : { memo: options.credits[i].memo },
3307
4039
  nonce: await deriveRemainderNonce(...args)
3308
4040
  }
3309
4041
  },
@@ -3637,6 +4369,7 @@ import { NullifierCapability } from "@invisi-labs/core";
3637
4369
 
3638
4370
  // src/session/inventory.ts
3639
4371
  import {
4372
+ encodeMemo as encodeMemo2,
3640
4373
  computeCreditCommitment as computeCreditCommitment2,
3641
4374
  computeCreditNullifier as computeCreditNullifier3,
3642
4375
  computeCreditSharedKeyHash as computeCreditSharedKeyHash2,
@@ -3706,7 +4439,8 @@ var InventoryProcessor = class {
3706
4439
  n.amount,
3707
4440
  n.nonce,
3708
4441
  n.expiry,
3709
- await computeCreditSharedKeyHash2(n.creditSharedKey)
4442
+ await computeCreditSharedKeyHash2(n.creditSharedKey),
4443
+ n
3710
4444
  )
3711
4445
  );
3712
4446
  }
@@ -3753,6 +4487,9 @@ var InventoryProcessor = class {
3753
4487
  };
3754
4488
  for (const event of logs) {
3755
4489
  if (event.eventName === "CreditDraw") {
4490
+ const block = await this.#options.reader.getBlock(event.blockNumber);
4491
+ if (block.hash !== event.blockHash)
4492
+ throw new CanonicalConflict("draw block changed during Credit recovery");
3756
4493
  const args = event.args;
3757
4494
  const params = args.params;
3758
4495
  const indices = args.remainderLeafIndices;
@@ -3770,6 +4507,7 @@ var InventoryProcessor = class {
3770
4507
  context,
3771
4508
  previous.state.note,
3772
4509
  {
4510
+ timestamp: block.timestamp,
3773
4511
  creditNullifier: nullifier,
3774
4512
  remainderCommitment: params.remainderCommitments[index2],
3775
4513
  recoveryAmount: BigInt(params.recoveryAmounts[index2])
@@ -3778,6 +4516,10 @@ var InventoryProcessor = class {
3778
4516
  if (!remainder) {
3779
4517
  continue;
3780
4518
  }
4519
+ const child = foundByKey.get(
4520
+ params.remainderCommitments[index2] + ":" + previous.role
4521
+ );
4522
+ const memo = child?.state.note.memo;
3781
4523
  const record = {
3782
4524
  commitment: params.remainderCommitments[index2],
3783
4525
  treeId: BigInt(args.outputTreeId),
@@ -3786,7 +4528,13 @@ var InventoryProcessor = class {
3786
4528
  blockHash: event.blockHash,
3787
4529
  transactionHash: event.transactionHash,
3788
4530
  role: previous.role,
3789
- state: { ...clone(previous.state), note: remainder },
4531
+ state: {
4532
+ ...clone(previous.state),
4533
+ note: {
4534
+ ...remainder,
4535
+ ...memo === void 0 ? {} : { memo: encodeMemo2(memo) }
4536
+ }
4537
+ },
3790
4538
  receivingKeySource: { kind: "draw", commitment: previous.commitment },
3791
4539
  spent: "unknown"
3792
4540
  };
@@ -4327,4 +5075,4 @@ export {
4327
5075
  WalletSession,
4328
5076
  MemoryWalletStore
4329
5077
  };
4330
- //# sourceMappingURL=chunk-7TFLU2Z6.js.map
5078
+ //# sourceMappingURL=chunk-FSQYZO66.js.map