@superfluid-finance/ethereum-contracts 1.2.3-dev.3df6de8.0 → 1.2.3-dev.4eebafa.0

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.
Files changed (118) hide show
  1. package/build/contracts/AccessControl.json +1 -1
  2. package/build/contracts/AccessControlEnumerable.json +1 -1
  3. package/build/contracts/Address.json +1 -1
  4. package/build/contracts/AgreementBase.json +10 -10
  5. package/build/contracts/AgreementLibrary.json +4 -4
  6. package/build/contracts/BaseRelayRecipient.json +1 -1
  7. package/build/contracts/BatchLiquidator.json +1385 -1242
  8. package/build/contracts/BatchOperation.json +1 -1
  9. package/build/contracts/CFAv1Library.json +3437 -3625
  10. package/build/contracts/CallUtils.json +1 -1
  11. package/build/contracts/ClosingOnUpdateFlowTestApp.json +4440 -4451
  12. package/build/contracts/ConstantFlowAgreementV1.json +5204 -5204
  13. package/build/contracts/Context.json +1 -1
  14. package/build/contracts/ContextDefinitions.json +1 -1
  15. package/build/contracts/Create2.json +1 -1
  16. package/build/contracts/CustomSuperTokenBase.json +2 -2
  17. package/build/contracts/ERC165.json +1 -1
  18. package/build/contracts/ERC1820Implementer.json +79 -79
  19. package/build/contracts/ERC1820RegistryCompiled.json +1 -1
  20. package/build/contracts/ERC20.json +1008 -1008
  21. package/build/contracts/ERC20Burnable.json +1 -1
  22. package/build/contracts/ERC20Pausable.json +1 -1
  23. package/build/contracts/ERC20PresetMinterPauser.json +1816 -1816
  24. package/build/contracts/ERC20WithTokenInfo.json +1 -1
  25. package/build/contracts/ERC777Helper.json +1 -1
  26. package/build/contracts/ERC777RecipientDrainingGas.json +1874 -1874
  27. package/build/contracts/ERC777RecipientReverting.json +1896 -1896
  28. package/build/contracts/EnumerableSet.json +1 -1
  29. package/build/contracts/EventsEmitter.json +414 -0
  30. package/build/contracts/ExclusiveInflowTestApp.json +4468 -4479
  31. package/build/contracts/FixedSizeData.json +405 -405
  32. package/build/contracts/FlowExchangeTestApp.json +4578 -4589
  33. package/build/contracts/FlowOperatorDefinitions.json +1 -1
  34. package/build/contracts/FullUpgradableSuperTokenProxy.json +319 -319
  35. package/build/contracts/IAccessControl.json +1 -1
  36. package/build/contracts/IAccessControlEnumerable.json +1 -1
  37. package/build/contracts/IConstantFlowAgreementV1.json +2 -2
  38. package/build/contracts/IDAv1Library.json +3227 -3403
  39. package/build/contracts/IERC165.json +1 -1
  40. package/build/contracts/IERC1820Implementer.json +1 -1
  41. package/build/contracts/IERC1820Registry.json +1 -1
  42. package/build/contracts/IERC20.json +1 -1
  43. package/build/contracts/IERC20Metadata.json +1 -1
  44. package/build/contracts/IERC777.json +1 -1
  45. package/build/contracts/IERC777Recipient.json +1 -1
  46. package/build/contracts/IERC777Sender.json +1 -1
  47. package/build/contracts/IInstantDistributionAgreementV1.json +2 -2
  48. package/build/contracts/IMaticBridgedNativeSuperToken.json +6 -6
  49. package/build/contracts/IMaticBridgedNativeSuperTokenCustom.json +2 -2
  50. package/build/contracts/IMultiSigWallet.json +1 -1
  51. package/build/contracts/IPureSuperToken.json +6 -6
  52. package/build/contracts/IPureSuperTokenCustom.json +2 -2
  53. package/build/contracts/IRelayRecipient.json +1 -1
  54. package/build/contracts/IResolver.json +1 -1
  55. package/build/contracts/ISETH.json +6 -6
  56. package/build/contracts/ISETHCustom.json +2 -2
  57. package/build/contracts/ISuperAgreement.json +2 -2
  58. package/build/contracts/ISuperApp.json +2 -2
  59. package/build/contracts/ISuperToken.json +6 -6
  60. package/build/contracts/ISuperTokenFactory.json +2 -2
  61. package/build/contracts/ISuperfluid.json +2 -2
  62. package/build/contracts/ISuperfluidGovernance.json +2 -2
  63. package/build/contracts/ISuperfluidToken.json +122 -122
  64. package/build/contracts/ITOGAv1.json +2689 -2739
  65. package/build/contracts/ITOGAv2.json +2689 -2739
  66. package/build/contracts/Initializable.json +1 -1
  67. package/build/contracts/InstantDistributionAgreementV1.json +5387 -5387
  68. package/build/contracts/MaticBridgedNativeSuperTokenProxy.json +971 -971
  69. package/build/contracts/NonClosableOutflowTestApp.json +4343 -4354
  70. package/build/contracts/Ownable.json +1 -1
  71. package/build/contracts/Pausable.json +1 -1
  72. package/build/contracts/Proxy.json +1 -1
  73. package/build/contracts/PureSuperToken.json +694 -694
  74. package/build/contracts/Resolver.json +1058 -1058
  75. package/build/contracts/SETHProxy.json +661 -661
  76. package/build/contracts/SafeCast.json +1 -1
  77. package/build/contracts/SafeERC20.json +1 -1
  78. package/build/contracts/SafeMath.json +1 -1
  79. package/build/contracts/SelfDeletingFlowTestApp.json +4440 -4451
  80. package/build/contracts/SlotsBitmapLibrary.json +1757 -1757
  81. package/build/contracts/Strings.json +1 -1
  82. package/build/contracts/SuperAppBase.json +2 -2
  83. package/build/contracts/SuperAppDefinitions.json +1 -1
  84. package/build/contracts/SuperToken.json +9757 -9515
  85. package/build/contracts/SuperTokenFactory.json +2074 -2074
  86. package/build/contracts/SuperTokenFactoryBase.json +989 -989
  87. package/build/contracts/SuperTokenFactoryHelper.json +1095 -1095
  88. package/build/contracts/SuperUpgrader.json +2495 -2495
  89. package/build/contracts/Superfluid.json +12978 -12978
  90. package/build/contracts/SuperfluidFrameworkDeployer.json +2042 -2042
  91. package/build/contracts/SuperfluidGovernanceBase.json +9 -9
  92. package/build/contracts/SuperfluidGovernanceConfigs.json +1 -1
  93. package/build/contracts/SuperfluidGovernanceII.json +2022 -2022
  94. package/build/contracts/SuperfluidGovernanceIIProxy.json +227 -227
  95. package/build/contracts/SuperfluidLoader.json +752 -752
  96. package/build/contracts/SuperfluidToken.json +3476 -2953
  97. package/build/contracts/TOGA.json +4681 -4731
  98. package/build/contracts/TestGovernance.json +2402 -2402
  99. package/build/contracts/TestToken.json +1267 -1267
  100. package/build/contracts/TokenCustodian.json +903 -903
  101. package/build/contracts/TokenInfo.json +1 -1
  102. package/build/contracts/UUPSProxiable.json +233 -233
  103. package/build/contracts/UUPSProxy.json +257 -257
  104. package/build/contracts/UUPSUtils.json +85 -85
  105. package/build/contracts-sizes.txt +6 -6
  106. package/contracts/apps/CFAv1Library.sol +147 -111
  107. package/contracts/apps/IDAv1Library.sol +133 -101
  108. package/contracts/interfaces/superfluid/ISuperfluidToken.sol +8 -8
  109. package/contracts/libs/EventsEmitter.sol +16 -0
  110. package/contracts/mocks/CFAAppMocks.sol +52 -36
  111. package/contracts/mocks/CustomSuperTokenMock.sol +11 -4
  112. package/contracts/mocks/IDASuperAppTester.sol +24 -18
  113. package/contracts/mocks/MultiFlowTesterApp.sol +33 -24
  114. package/contracts/mocks/SuperAppMocks.sol +54 -40
  115. package/contracts/superfluid/SuperfluidToken.sol +33 -31
  116. package/contracts/utils/BatchLiquidator.sol +15 -11
  117. package/contracts/utils/TOGA.sol +40 -30
  118. package/package.json +2 -2
@@ -186,11 +186,13 @@ library IDAv1Library {
186
186
  ) internal {
187
187
  idaLibrary.host.callAgreement(
188
188
  idaLibrary.ida,
189
- abi.encodeWithSelector(
190
- idaLibrary.ida.createIndex.selector,
191
- token,
192
- indexId,
193
- new bytes(0) // ctx placeholder
189
+ abi.encodeCall(
190
+ idaLibrary.ida.createIndex,
191
+ (
192
+ token,
193
+ indexId,
194
+ new bytes(0) // ctx placeholder
195
+ )
194
196
  ),
195
197
  userData
196
198
  );
@@ -225,11 +227,13 @@ library IDAv1Library {
225
227
  ) internal returns (bytes memory newCtx) {
226
228
  (newCtx, ) = idaLibrary.host.callAgreementWithContext(
227
229
  idaLibrary.ida,
228
- abi.encodeWithSelector(
229
- idaLibrary.ida.createIndex.selector,
230
- token,
231
- indexId,
232
- new bytes(0) // ctx placeholder
230
+ abi.encodeCall(
231
+ idaLibrary.ida.createIndex,
232
+ (
233
+ token,
234
+ indexId,
235
+ new bytes(0) // ctx placeholder
236
+ )
233
237
  ),
234
238
  userData,
235
239
  ctx
@@ -268,12 +272,14 @@ library IDAv1Library {
268
272
  ) internal {
269
273
  idaLibrary.host.callAgreement(
270
274
  idaLibrary.ida,
271
- abi.encodeWithSelector(
272
- idaLibrary.ida.updateIndex.selector,
273
- token,
274
- indexId,
275
- indexValue,
276
- new bytes(0) // ctx placeholder
275
+ abi.encodeCall(
276
+ idaLibrary.ida.updateIndex,
277
+ (
278
+ token,
279
+ indexId,
280
+ indexValue,
281
+ new bytes(0) // ctx placeholder
282
+ )
277
283
  ),
278
284
  userData
279
285
  );
@@ -321,12 +327,14 @@ library IDAv1Library {
321
327
  ) internal returns (bytes memory newCtx) {
322
328
  (newCtx, ) = idaLibrary.host.callAgreementWithContext(
323
329
  idaLibrary.ida,
324
- abi.encodeWithSelector(
325
- idaLibrary.ida.updateIndex.selector,
326
- token,
327
- indexId,
328
- indexValue,
329
- new bytes(0) // ctx placeholder
330
+ abi.encodeCall(
331
+ idaLibrary.ida.updateIndex,
332
+ (
333
+ token,
334
+ indexId,
335
+ indexValue,
336
+ new bytes(0) // ctx placeholder
337
+ )
330
338
  ),
331
339
  userData,
332
340
  ctx
@@ -365,12 +373,14 @@ library IDAv1Library {
365
373
  ) internal {
366
374
  idaLibrary.host.callAgreement(
367
375
  idaLibrary.ida,
368
- abi.encodeWithSelector(
369
- idaLibrary.ida.distribute.selector,
370
- token,
371
- indexId,
372
- amount,
373
- new bytes(0) // ctx placeholder
376
+ abi.encodeCall(
377
+ idaLibrary.ida.distribute,
378
+ (
379
+ token,
380
+ indexId,
381
+ amount,
382
+ new bytes(0) // ctx placeholder
383
+ )
374
384
  ),
375
385
  userData
376
386
  );
@@ -411,13 +421,15 @@ library IDAv1Library {
411
421
  bytes memory userData
412
422
  ) internal returns (bytes memory newCtx) {
413
423
  (newCtx, ) = idaLibrary.host.callAgreementWithContext(
414
- idaLibrary.ida,
415
- abi.encodeWithSelector(
416
- idaLibrary.ida.distribute.selector,
417
- token,
418
- indexId,
419
- amount,
420
- new bytes(0) // ctx placeholder
424
+ idaLibrary.ida,
425
+ abi.encodeCall(
426
+ idaLibrary.ida.distribute,
427
+ (
428
+ token,
429
+ indexId,
430
+ amount,
431
+ new bytes(0) // ctx placeholder
432
+ )
421
433
  ),
422
434
  userData,
423
435
  ctx
@@ -462,12 +474,14 @@ library IDAv1Library {
462
474
  ) internal {
463
475
  idaLibrary.host.callAgreement(
464
476
  idaLibrary.ida,
465
- abi.encodeWithSelector(
466
- idaLibrary.ida.approveSubscription.selector,
467
- token,
468
- publisher,
469
- indexId,
470
- new bytes(0) // ctx placeholder
477
+ abi.encodeCall(
478
+ idaLibrary.ida.approveSubscription,
479
+ (
480
+ token,
481
+ publisher,
482
+ indexId,
483
+ new bytes(0) // ctx placeholder
484
+ )
471
485
  ),
472
486
  userData
473
487
  );
@@ -517,12 +531,14 @@ library IDAv1Library {
517
531
  ) internal returns (bytes memory newCtx) {
518
532
  (newCtx, ) = idaLibrary.host.callAgreementWithContext(
519
533
  idaLibrary.ida,
520
- abi.encodeWithSelector(
521
- idaLibrary.ida.approveSubscription.selector,
522
- token,
523
- publisher,
524
- indexId,
525
- new bytes(0) // ctx placeholder
534
+ abi.encodeCall(
535
+ idaLibrary.ida.approveSubscription,
536
+ (
537
+ token,
538
+ publisher,
539
+ indexId,
540
+ new bytes(0) // ctx placeholder
541
+ )
526
542
  ),
527
543
  userData,
528
544
  ctx
@@ -558,12 +574,14 @@ library IDAv1Library {
558
574
  ) internal {
559
575
  idaLibrary.host.callAgreement(
560
576
  idaLibrary.ida,
561
- abi.encodeWithSelector(
562
- idaLibrary.ida.revokeSubscription.selector,
563
- token,
564
- publisher,
565
- indexId,
566
- new bytes(0) // ctx placeholder
577
+ abi.encodeCall(
578
+ idaLibrary.ida.revokeSubscription,
579
+ (
580
+ token,
581
+ publisher,
582
+ indexId,
583
+ new bytes(0) // ctx placeholder
584
+ )
567
585
  ),
568
586
  userData
569
587
  );
@@ -610,12 +628,14 @@ library IDAv1Library {
610
628
  ) internal returns (bytes memory newCtx) {
611
629
  (newCtx, ) = idaLibrary.host.callAgreementWithContext(
612
630
  idaLibrary.ida,
613
- abi.encodeWithSelector(
614
- idaLibrary.ida.revokeSubscription.selector,
615
- token,
616
- publisher,
617
- indexId,
618
- new bytes(0) // ctx placeholder
631
+ abi.encodeCall(
632
+ idaLibrary.ida.revokeSubscription,
633
+ (
634
+ token,
635
+ publisher,
636
+ indexId,
637
+ new bytes(0) // ctx placeholder
638
+ )
619
639
  ),
620
640
  userData,
621
641
  ctx
@@ -657,13 +677,15 @@ library IDAv1Library {
657
677
  ) internal {
658
678
  idaLibrary.host.callAgreement(
659
679
  idaLibrary.ida,
660
- abi.encodeWithSelector(
661
- idaLibrary.ida.updateSubscription.selector,
662
- token,
663
- indexId,
664
- subscriber,
665
- units,
666
- new bytes(0) // ctx placeholder
680
+ abi.encodeCall(
681
+ idaLibrary.ida.updateSubscription,
682
+ (
683
+ token,
684
+ indexId,
685
+ subscriber,
686
+ units,
687
+ new bytes(0) // ctx placeholder
688
+ )
667
689
  ),
668
690
  userData
669
691
  );
@@ -716,13 +738,15 @@ library IDAv1Library {
716
738
  ) internal returns (bytes memory newCtx) {
717
739
  (newCtx, ) = idaLibrary.host.callAgreementWithContext(
718
740
  idaLibrary.ida,
719
- abi.encodeWithSelector(
720
- idaLibrary.ida.updateSubscription.selector,
721
- token,
722
- indexId,
723
- subscriber,
724
- units,
725
- new bytes(0) // ctx placeholder
741
+ abi.encodeCall(
742
+ idaLibrary.ida.updateSubscription,
743
+ (
744
+ token,
745
+ indexId,
746
+ subscriber,
747
+ units,
748
+ new bytes(0) // ctx placeholder
749
+ )
726
750
  ),
727
751
  userData,
728
752
  ctx
@@ -763,13 +787,15 @@ library IDAv1Library {
763
787
  ) internal {
764
788
  idaLibrary.host.callAgreement(
765
789
  idaLibrary.ida,
766
- abi.encodeWithSelector(
767
- idaLibrary.ida.deleteSubscription.selector,
768
- token,
769
- publisher,
770
- indexId,
771
- subscriber,
772
- new bytes(0) // ctx placeholder
790
+ abi.encodeCall(
791
+ idaLibrary.ida.deleteSubscription,
792
+ (
793
+ token,
794
+ publisher,
795
+ indexId,
796
+ subscriber,
797
+ new bytes(0) // ctx placeholder
798
+ )
773
799
  ),
774
800
  userData
775
801
  );
@@ -821,13 +847,15 @@ library IDAv1Library {
821
847
  ) internal returns (bytes memory newCtx) {
822
848
  (newCtx, ) = idaLibrary.host.callAgreementWithContext(
823
849
  idaLibrary.ida,
824
- abi.encodeWithSelector(
825
- idaLibrary.ida.deleteSubscription.selector,
826
- token,
827
- publisher,
828
- indexId,
829
- subscriber,
830
- new bytes(0) // ctx placeholder
850
+ abi.encodeCall(
851
+ idaLibrary.ida.deleteSubscription,
852
+ (
853
+ token,
854
+ publisher,
855
+ indexId,
856
+ subscriber,
857
+ new bytes(0) // ctx placeholder
858
+ )
831
859
  ),
832
860
  userData,
833
861
  ctx
@@ -868,13 +896,15 @@ library IDAv1Library {
868
896
  ) internal {
869
897
  idaLibrary.host.callAgreement(
870
898
  idaLibrary.ida,
871
- abi.encodeWithSelector(
872
- idaLibrary.ida.claim.selector,
873
- token,
874
- publisher,
875
- indexId,
876
- subscriber,
877
- new bytes(0) // ctx placeholder
899
+ abi.encodeCall(
900
+ idaLibrary.ida.claim,
901
+ (
902
+ token,
903
+ publisher,
904
+ indexId,
905
+ subscriber,
906
+ new bytes(0) // ctx placeholder
907
+ )
878
908
  ),
879
909
  userData
880
910
  );
@@ -925,13 +955,15 @@ library IDAv1Library {
925
955
  ) internal returns (bytes memory newCtx) {
926
956
  (newCtx, ) = idaLibrary.host.callAgreementWithContext(
927
957
  idaLibrary.ida,
928
- abi.encodeWithSelector(
929
- idaLibrary.ida.claim.selector,
930
- token,
931
- publisher,
932
- indexId,
933
- subscriber,
934
- new bytes(0) // ctx placeholder
958
+ abi.encodeCall(
959
+ idaLibrary.ida.claim,
960
+ (
961
+ token,
962
+ publisher,
963
+ indexId,
964
+ subscriber,
965
+ new bytes(0) // ctx placeholder
966
+ )
935
967
  ),
936
968
  userData,
937
969
  ctx
@@ -280,9 +280,9 @@ interface ISuperfluidToken {
280
280
  * @param liquidationTypeData Data regarding the version of the liquidation schema and the type
281
281
  * @param liquidatorAccount Address of the executor of the liquidation
282
282
  * @param useDefaultRewardAccount Whether or not the default reward account receives the rewardAmount
283
- * @param targetAccount Account of the stream sender
284
- * @param rewardAmount The amount the reward recepient account will receive
285
- * @param targetAccountBalanceDelta The amount the sender account balance should change by
283
+ * @param targetAccount Account to be liquidated
284
+ * @param rewardAmount The amount the rewarded account will receive
285
+ * @param targetAccountBalanceDelta The delta amount the target account balance should change by
286
286
  *
287
287
  * - If a bailout is required (bailoutAmount > 0)
288
288
  * - the actual reward (single deposit) goes to the executor,
@@ -312,7 +312,7 @@ interface ISuperfluidToken {
312
312
  * @param id Agreement ID
313
313
  * @param liquidatorAccount Address of the executor of the liquidation
314
314
  * @param targetAccount Account of the stream sender
315
- * @param rewardAccount Account that collects the reward or bails out insolvent accounts
315
+ * @param rewardAmountReceiver Account that collects the reward or bails out insolvent accounts
316
316
  * @param rewardAmount The amount the reward recipient account balance should change by
317
317
  * @param targetAccountBalanceDelta The amount the sender account balance should change by
318
318
  * @param liquidationTypeData The encoded liquidation type data including the version (how to decode)
@@ -320,14 +320,14 @@ interface ISuperfluidToken {
320
320
  * NOTE:
321
321
  * Reward account rule:
322
322
  * - if the agreement is liquidated during the PIC period
323
- * - the rewardAccount will get the rewardAmount (remaining deposit), regardless of the liquidatorAccount
323
+ * - the rewardAmountReceiver will get the rewardAmount (remaining deposit), regardless of the liquidatorAccount
324
324
  * - the targetAccount will pay for the rewardAmount
325
325
  * - if the agreement is liquidated after the PIC period AND the targetAccount is solvent
326
- * - the liquidatorAccount will get the rewardAmount (remaining deposit)
326
+ * - the rewardAmountReceiver will get the rewardAmount (remaining deposit)
327
327
  * - the targetAccount will pay for the rewardAmount
328
328
  * - if the targetAccount is insolvent
329
329
  * - the liquidatorAccount will get the rewardAmount (single deposit)
330
- * - the rewardAccount will pay for both the rewardAmount and bailoutAmount
330
+ * - the default reward account (governance) will pay for both the rewardAmount and bailoutAmount
331
331
  * - the targetAccount will receive the bailoutAmount
332
332
  */
333
333
  event AgreementLiquidatedV2(
@@ -335,7 +335,7 @@ interface ISuperfluidToken {
335
335
  bytes32 id,
336
336
  address indexed liquidatorAccount,
337
337
  address indexed targetAccount,
338
- address rewardAccount,
338
+ address rewardAmountReceiver,
339
339
  uint256 rewardAmount,
340
340
  int256 targetAccountBalanceDelta,
341
341
  bytes liquidationTypeData
@@ -0,0 +1,16 @@
1
+ // SPDX-License-Identifier: AGPLv3
2
+ pragma solidity 0.8.13;
3
+
4
+ /**
5
+ * @title Events Emitter Library
6
+ * @author Superfluid
7
+ * @dev A library used for emitting missing and unaccessable events.
8
+ *
9
+ */
10
+ library EventsEmitter {
11
+ event Transfer(address indexed from, address indexed to, uint256 value);
12
+
13
+ function emitTransfer(address from, address to, uint256 value) internal {
14
+ emit Transfer(from, to, value);
15
+ }
16
+ }
@@ -53,12 +53,14 @@ contract ExclusiveInflowTestApp is SuperAppBase {
53
53
  newCtx = ctx;
54
54
  ISuperfluid.Context memory context = _host.decodeCtx(ctx);
55
55
  if (_currentSender != address(0)) {
56
- bytes memory callData = abi.encodeWithSelector(
57
- _cfa.deleteFlow.selector,
58
- superToken,
59
- _currentSender,
60
- address(this),
61
- new bytes(0)
56
+ bytes memory callData = abi.encodeCall(
57
+ _cfa.deleteFlow,
58
+ (
59
+ superToken,
60
+ _currentSender,
61
+ address(this),
62
+ new bytes(0)
63
+ )
62
64
  );
63
65
  (newCtx, ) = _host.callAgreementWithContext(
64
66
  _cfa,
@@ -133,12 +135,14 @@ contract NonClosableOutflowTestApp is SuperAppBase {
133
135
  _flowRate = flowRate;
134
136
  _host.callAgreement(
135
137
  _cfa,
136
- abi.encodeWithSelector(
137
- _cfa.createFlow.selector,
138
- superToken,
139
- receiver,
140
- flowRate,
141
- new bytes(0)
138
+ abi.encodeCall(
139
+ _cfa.createFlow,
140
+ (
141
+ superToken,
142
+ receiver,
143
+ flowRate,
144
+ new bytes(0)
145
+ )
142
146
  ),
143
147
  new bytes(0) // user data
144
148
  );
@@ -158,16 +162,22 @@ contract NonClosableOutflowTestApp is SuperAppBase {
158
162
  (address flowSender, address flowReceiver) = abi.decode(agreementData, (address, address));
159
163
  assert(flowSender == address(this));
160
164
  assert(flowReceiver == _receiver);
161
- // recreate the flow
162
- (newCtx, ) = _host.callAgreementWithContext(
163
- _cfa,
164
- abi.encodeWithSelector(
165
- _cfa.createFlow.selector,
165
+
166
+ // moved out to avoid stack too deep error
167
+ bytes memory callData = abi.encodeCall(
168
+ _cfa.createFlow,
169
+ (
166
170
  superToken,
167
171
  flowReceiver,
168
172
  _flowRate,
169
173
  new bytes(0)
170
- ),
174
+ )
175
+ );
176
+
177
+ // recreate the flow
178
+ (newCtx, ) = _host.callAgreementWithContext(
179
+ _cfa,
180
+ callData,
171
181
  "0x",
172
182
  ctx
173
183
  );
@@ -218,12 +228,14 @@ contract SelfDeletingFlowTestApp is SuperAppBase {
218
228
  ISuperfluid.Context memory context = _host.decodeCtx(ctx);
219
229
  (newCtx, ) = _host.callAgreementWithContext(
220
230
  _cfa,
221
- abi.encodeWithSelector(
222
- _cfa.deleteFlow.selector,
223
- superToken,
224
- context.msgSender,
225
- address(this),
226
- new bytes(0)
231
+ abi.encodeCall(
232
+ _cfa.deleteFlow,
233
+ (
234
+ superToken,
235
+ context.msgSender,
236
+ address(this),
237
+ new bytes(0)
238
+ )
227
239
  ),
228
240
  new bytes(0), // user data
229
241
  newCtx
@@ -273,12 +285,14 @@ contract ClosingOnUpdateFlowTestApp is SuperAppBase {
273
285
  ISuperfluid.Context memory context = _host.decodeCtx(ctx);
274
286
  (newCtx, ) = _host.callAgreementWithContext(
275
287
  _cfa,
276
- abi.encodeWithSelector(
277
- _cfa.deleteFlow.selector,
278
- superToken,
279
- context.msgSender,
280
- address(this),
281
- new bytes(0)
288
+ abi.encodeCall(
289
+ _cfa.deleteFlow,
290
+ (
291
+ superToken,
292
+ context.msgSender,
293
+ address(this),
294
+ new bytes(0)
295
+ )
282
296
  ),
283
297
  new bytes(0), // user data
284
298
  newCtx
@@ -331,12 +345,14 @@ contract FlowExchangeTestApp is SuperAppBase {
331
345
  (,int96 flowRate,,) = _cfa.getFlow(superToken, context.msgSender, address(this));
332
346
  (newCtx, ) = _host.callAgreementWithContext(
333
347
  _cfa,
334
- abi.encodeWithSelector(
335
- _cfa.createFlow.selector,
336
- _targetToken,
337
- context.msgSender,
338
- flowRate,
339
- new bytes(0)
348
+ abi.encodeCall(
349
+ _cfa.createFlow,
350
+ (
351
+ _targetToken,
352
+ context.msgSender,
353
+ flowRate,
354
+ new bytes(0)
355
+ )
340
356
  ),
341
357
  new bytes(0), // user data
342
358
  newCtx
@@ -60,9 +60,16 @@ contract CustomSuperTokenProxyMock is CustomSuperTokenBaseMock {
60
60
  ) external {
61
61
  address logic = _implementation();
62
62
  // solhint-disable-next-line avoid-low-level-calls
63
- (bool success, ) = logic.delegatecall(abi.encodeWithSelector(
64
- ISuperToken.selfMint.selector,
65
- to, amount, userData));
63
+ (bool success, ) = logic.delegatecall(
64
+ abi.encodeCall(
65
+ ISuperToken(address(this)).selfMint,
66
+ (
67
+ to,
68
+ amount,
69
+ userData
70
+ )
71
+ )
72
+ );
66
73
  assert(success);
67
74
  }
68
75
 
@@ -75,7 +82,7 @@ contract CustomSuperTokenProxyMock is CustomSuperTokenBaseMock {
75
82
  // this makes msg.sender to self
76
83
  ISuperToken(address(this)).selfBurn(to, amount, userData);
77
84
  }
78
-
85
+
79
86
  // this function self calls transferFrom
80
87
  function callSelfTransferFrom(
81
88
  address holder,
@@ -33,11 +33,13 @@ contract IDASuperAppTester is ISuperApp {
33
33
 
34
34
  _host.callAgreement(
35
35
  _ida,
36
- abi.encodeWithSelector(
37
- _ida.createIndex.selector,
38
- _token,
39
- _indexId,
40
- new bytes(0) // placeholder ctx
36
+ abi.encodeCall(
37
+ _ida.createIndex,
38
+ (
39
+ _token,
40
+ _indexId,
41
+ new bytes(0) // placeholder ctx
42
+ )
41
43
  ),
42
44
  new bytes(0) // user data
43
45
  );
@@ -51,13 +53,15 @@ contract IDASuperAppTester is ISuperApp {
51
53
  {
52
54
  _host.callAgreement(
53
55
  _ida,
54
- abi.encodeWithSelector(
55
- _ida.updateSubscription.selector,
56
- _token,
57
- _indexId,
58
- subscriber,
59
- units,
60
- new bytes(0) // placeholder ctx
56
+ abi.encodeCall(
57
+ _ida.updateSubscription,
58
+ (
59
+ _token,
60
+ _indexId,
61
+ subscriber,
62
+ units,
63
+ new bytes(0) // placeholder ctx
64
+ )
61
65
  ),
62
66
  new bytes(0) // user data
63
67
  );
@@ -70,12 +74,14 @@ contract IDASuperAppTester is ISuperApp {
70
74
  {
71
75
  _host.callAgreement(
72
76
  _ida,
73
- abi.encodeWithSelector(
74
- _ida.distribute.selector,
75
- _token,
76
- _indexId,
77
- amount,
78
- new bytes(0) // placeholder ctx
77
+ abi.encodeCall(
78
+ _ida.distribute,
79
+ (
80
+ _token,
81
+ _indexId,
82
+ amount,
83
+ new bytes(0) // placeholder ctx
84
+ )
79
85
  ),
80
86
  new bytes(0) // user data
81
87
  );