@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.
- package/build/contracts/AccessControl.json +1 -1
- package/build/contracts/AccessControlEnumerable.json +1 -1
- package/build/contracts/Address.json +1 -1
- package/build/contracts/AgreementBase.json +10 -10
- package/build/contracts/AgreementLibrary.json +4 -4
- package/build/contracts/BaseRelayRecipient.json +1 -1
- package/build/contracts/BatchLiquidator.json +1385 -1242
- package/build/contracts/BatchOperation.json +1 -1
- package/build/contracts/CFAv1Library.json +3437 -3625
- package/build/contracts/CallUtils.json +1 -1
- package/build/contracts/ClosingOnUpdateFlowTestApp.json +4440 -4451
- package/build/contracts/ConstantFlowAgreementV1.json +5204 -5204
- package/build/contracts/Context.json +1 -1
- package/build/contracts/ContextDefinitions.json +1 -1
- package/build/contracts/Create2.json +1 -1
- package/build/contracts/CustomSuperTokenBase.json +2 -2
- package/build/contracts/ERC165.json +1 -1
- package/build/contracts/ERC1820Implementer.json +79 -79
- package/build/contracts/ERC1820RegistryCompiled.json +1 -1
- package/build/contracts/ERC20.json +1008 -1008
- package/build/contracts/ERC20Burnable.json +1 -1
- package/build/contracts/ERC20Pausable.json +1 -1
- package/build/contracts/ERC20PresetMinterPauser.json +1816 -1816
- package/build/contracts/ERC20WithTokenInfo.json +1 -1
- package/build/contracts/ERC777Helper.json +1 -1
- package/build/contracts/ERC777RecipientDrainingGas.json +1874 -1874
- package/build/contracts/ERC777RecipientReverting.json +1896 -1896
- package/build/contracts/EnumerableSet.json +1 -1
- package/build/contracts/EventsEmitter.json +414 -0
- package/build/contracts/ExclusiveInflowTestApp.json +4468 -4479
- package/build/contracts/FixedSizeData.json +405 -405
- package/build/contracts/FlowExchangeTestApp.json +4578 -4589
- package/build/contracts/FlowOperatorDefinitions.json +1 -1
- package/build/contracts/FullUpgradableSuperTokenProxy.json +319 -319
- package/build/contracts/IAccessControl.json +1 -1
- package/build/contracts/IAccessControlEnumerable.json +1 -1
- package/build/contracts/IConstantFlowAgreementV1.json +2 -2
- package/build/contracts/IDAv1Library.json +3227 -3403
- package/build/contracts/IERC165.json +1 -1
- package/build/contracts/IERC1820Implementer.json +1 -1
- package/build/contracts/IERC1820Registry.json +1 -1
- package/build/contracts/IERC20.json +1 -1
- package/build/contracts/IERC20Metadata.json +1 -1
- package/build/contracts/IERC777.json +1 -1
- package/build/contracts/IERC777Recipient.json +1 -1
- package/build/contracts/IERC777Sender.json +1 -1
- package/build/contracts/IInstantDistributionAgreementV1.json +2 -2
- package/build/contracts/IMaticBridgedNativeSuperToken.json +6 -6
- package/build/contracts/IMaticBridgedNativeSuperTokenCustom.json +2 -2
- package/build/contracts/IMultiSigWallet.json +1 -1
- package/build/contracts/IPureSuperToken.json +6 -6
- package/build/contracts/IPureSuperTokenCustom.json +2 -2
- package/build/contracts/IRelayRecipient.json +1 -1
- package/build/contracts/IResolver.json +1 -1
- package/build/contracts/ISETH.json +6 -6
- package/build/contracts/ISETHCustom.json +2 -2
- package/build/contracts/ISuperAgreement.json +2 -2
- package/build/contracts/ISuperApp.json +2 -2
- package/build/contracts/ISuperToken.json +6 -6
- package/build/contracts/ISuperTokenFactory.json +2 -2
- package/build/contracts/ISuperfluid.json +2 -2
- package/build/contracts/ISuperfluidGovernance.json +2 -2
- package/build/contracts/ISuperfluidToken.json +122 -122
- package/build/contracts/ITOGAv1.json +2689 -2739
- package/build/contracts/ITOGAv2.json +2689 -2739
- package/build/contracts/Initializable.json +1 -1
- package/build/contracts/InstantDistributionAgreementV1.json +5387 -5387
- package/build/contracts/MaticBridgedNativeSuperTokenProxy.json +971 -971
- package/build/contracts/NonClosableOutflowTestApp.json +4343 -4354
- package/build/contracts/Ownable.json +1 -1
- package/build/contracts/Pausable.json +1 -1
- package/build/contracts/Proxy.json +1 -1
- package/build/contracts/PureSuperToken.json +694 -694
- package/build/contracts/Resolver.json +1058 -1058
- package/build/contracts/SETHProxy.json +661 -661
- package/build/contracts/SafeCast.json +1 -1
- package/build/contracts/SafeERC20.json +1 -1
- package/build/contracts/SafeMath.json +1 -1
- package/build/contracts/SelfDeletingFlowTestApp.json +4440 -4451
- package/build/contracts/SlotsBitmapLibrary.json +1757 -1757
- package/build/contracts/Strings.json +1 -1
- package/build/contracts/SuperAppBase.json +2 -2
- package/build/contracts/SuperAppDefinitions.json +1 -1
- package/build/contracts/SuperToken.json +9757 -9515
- package/build/contracts/SuperTokenFactory.json +2074 -2074
- package/build/contracts/SuperTokenFactoryBase.json +989 -989
- package/build/contracts/SuperTokenFactoryHelper.json +1095 -1095
- package/build/contracts/SuperUpgrader.json +2495 -2495
- package/build/contracts/Superfluid.json +12978 -12978
- package/build/contracts/SuperfluidFrameworkDeployer.json +2042 -2042
- package/build/contracts/SuperfluidGovernanceBase.json +9 -9
- package/build/contracts/SuperfluidGovernanceConfigs.json +1 -1
- package/build/contracts/SuperfluidGovernanceII.json +2022 -2022
- package/build/contracts/SuperfluidGovernanceIIProxy.json +227 -227
- package/build/contracts/SuperfluidLoader.json +752 -752
- package/build/contracts/SuperfluidToken.json +3476 -2953
- package/build/contracts/TOGA.json +4681 -4731
- package/build/contracts/TestGovernance.json +2402 -2402
- package/build/contracts/TestToken.json +1267 -1267
- package/build/contracts/TokenCustodian.json +903 -903
- package/build/contracts/TokenInfo.json +1 -1
- package/build/contracts/UUPSProxiable.json +233 -233
- package/build/contracts/UUPSProxy.json +257 -257
- package/build/contracts/UUPSUtils.json +85 -85
- package/build/contracts-sizes.txt +6 -6
- package/contracts/apps/CFAv1Library.sol +147 -111
- package/contracts/apps/IDAv1Library.sol +133 -101
- package/contracts/interfaces/superfluid/ISuperfluidToken.sol +8 -8
- package/contracts/libs/EventsEmitter.sol +16 -0
- package/contracts/mocks/CFAAppMocks.sol +52 -36
- package/contracts/mocks/CustomSuperTokenMock.sol +11 -4
- package/contracts/mocks/IDASuperAppTester.sol +24 -18
- package/contracts/mocks/MultiFlowTesterApp.sol +33 -24
- package/contracts/mocks/SuperAppMocks.sol +54 -40
- package/contracts/superfluid/SuperfluidToken.sol +33 -31
- package/contracts/utils/BatchLiquidator.sol +15 -11
- package/contracts/utils/TOGA.sol +40 -30
- 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.
|
|
190
|
-
idaLibrary.ida.createIndex
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
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.
|
|
229
|
-
idaLibrary.ida.createIndex
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
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.
|
|
272
|
-
idaLibrary.ida.updateIndex
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
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.
|
|
325
|
-
idaLibrary.ida.updateIndex
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
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.
|
|
369
|
-
idaLibrary.ida.distribute
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
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.
|
|
416
|
-
idaLibrary.ida.distribute
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
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.
|
|
466
|
-
idaLibrary.ida.approveSubscription
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
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.
|
|
521
|
-
idaLibrary.ida.approveSubscription
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
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.
|
|
562
|
-
idaLibrary.ida.revokeSubscription
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
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.
|
|
614
|
-
idaLibrary.ida.revokeSubscription
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
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.
|
|
661
|
-
idaLibrary.ida.updateSubscription
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
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.
|
|
720
|
-
idaLibrary.ida.updateSubscription
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
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.
|
|
767
|
-
idaLibrary.ida.deleteSubscription
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
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.
|
|
825
|
-
idaLibrary.ida.deleteSubscription
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
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.
|
|
872
|
-
idaLibrary.ida.claim
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
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.
|
|
929
|
-
idaLibrary.ida.claim
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
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
|
|
284
|
-
* @param rewardAmount The amount the
|
|
285
|
-
* @param targetAccountBalanceDelta The amount the
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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.
|
|
57
|
-
_cfa.deleteFlow
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
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.
|
|
137
|
-
_cfa.createFlow
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
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
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
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.
|
|
222
|
-
_cfa.deleteFlow
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
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.
|
|
277
|
-
_cfa.deleteFlow
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
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.
|
|
335
|
-
_cfa.createFlow
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
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(
|
|
64
|
-
|
|
65
|
-
|
|
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.
|
|
37
|
-
_ida.createIndex
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
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.
|
|
55
|
-
_ida.updateSubscription
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
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.
|
|
74
|
-
_ida.distribute
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
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
|
);
|