-
Notifications
You must be signed in to change notification settings - Fork 2
/
interface.sol
5080 lines (4004 loc) · 136 KB
/
interface.sol
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// SPDX-License-Identifier: UNLICENSED
pragma solidity >=0.7.0 <0.9.0;
import "forge-std/Test.sol";
interface CheatCodes {
// This allows us to getRecordedLogs()
struct Log {bytes32[] topics; bytes data;}
// Set block.timestamp (newTimestamp)
function warp(uint256) external;
// Set block.height (newHeight)
function roll(uint256) external;
// Set block.basefee (newBasefee)
function fee(uint256) external;
// Set block.coinbase (who)
function coinbase(address) external;
// Loads a storage slot from an address (who, slot)
function load(address,bytes32) external returns (bytes32);
// Stores a value to an address' storage slot, (who, slot, value)
function store(address,bytes32,bytes32) external;
// Signs data, (privateKey, digest) => (v, r, s)
function sign(uint256,bytes32) external returns (uint8,bytes32,bytes32);
// Gets address for a given private key, (privateKey) => (address)
function addr(uint256) external returns (address);
// Derive a private key from a provided mnenomic string (or mnenomic file path) at the derivation path m/44'/60'/0'/0/{index}
function deriveKey(string calldata, uint32) external returns (uint256);
// Derive a private key from a provided mnenomic string (or mnenomic file path) at the derivation path {path}{index}
function deriveKey(string calldata, string calldata, uint32) external returns (uint256);
// Performs a foreign function call via terminal, (stringInputs) => (result)
function ffi(string[] calldata) external returns (bytes memory);
// Set environment variables, (name, value)
function setEnv(string calldata, string calldata) external;
// Read environment variables, (name) => (value)
function envBool(string calldata) external returns (bool);
function envUint(string calldata) external returns (uint256);
function envInt(string calldata) external returns (int256);
function envAddress(string calldata) external returns (address);
function envBytes32(string calldata) external returns (bytes32);
function envString(string calldata) external returns (string memory);
function envBytes(string calldata) external returns (bytes memory);
// Read environment variables as arrays, (name, delim) => (value[])
function envBool(string calldata, string calldata) external returns (bool[] memory);
function envUint(string calldata, string calldata) external returns (uint256[] memory);
function envInt(string calldata, string calldata) external returns (int256[] memory);
function envAddress(string calldata, string calldata) external returns (address[] memory);
function envBytes32(string calldata, string calldata) external returns (bytes32[] memory);
function envString(string calldata, string calldata) external returns (string[] memory);
function envBytes(string calldata, string calldata) external returns (bytes[] memory);
// Sets the *next* call's msg.sender to be the input address
function prank(address) external;
// Sets all subsequent calls' msg.sender to be the input address until `stopPrank` is called
function startPrank(address) external;
// Sets the *next* call's msg.sender to be the input address, and the tx.origin to be the second input
function prank(address,address) external;
// Sets all subsequent calls' msg.sender to be the input address until `stopPrank` is called, and the tx.origin to be the second input
function startPrank(address,address) external;
// Resets subsequent calls' msg.sender to be `address(this)`
function stopPrank() external;
// Sets an address' balance, (who, newBalance)
function deal(address, uint256) external;
// Sets an address' code, (who, newCode)
function etch(address, bytes calldata) external;
// Expects an error on next call
function expectRevert() external;
function expectRevert(bytes calldata) external;
function expectRevert(bytes4) external;
// Record all storage reads and writes
function record() external;
// Gets all accessed reads and write slot from a recording session, for a given address
function accesses(address) external returns (bytes32[] memory reads, bytes32[] memory writes);
// Record all the transaction logs
function recordLogs() external;
// Gets all the recorded logs
function getRecordedLogs() external returns (Log[] memory);
// Prepare an expected log with (bool checkTopic1, bool checkTopic2, bool checkTopic3, bool checkData).
// Call this function, then emit an event, then call a function. Internally after the call, we check if
// logs were emitted in the expected order with the expected topics and data (as specified by the booleans).
// Second form also checks supplied address against emitting contract.
function expectEmit(bool,bool,bool,bool) external;
function expectEmit(bool,bool,bool,bool,address) external;
// Mocks a call to an address, returning specified data.
// Calldata can either be strict or a partial match, e.g. if you only
// pass a Solidity selector to the expected calldata, then the entire Solidity
// function will be mocked.
function mockCall(address,bytes calldata,bytes calldata) external;
// Mocks a call to an address with a specific msg.value, returning specified data.
// Calldata match takes precedence over msg.value in case of ambiguity.
function mockCall(address,uint256,bytes calldata,bytes calldata) external;
// Clears all mocked calls
function clearMockedCalls() external;
// Expect a call to an address with the specified calldata.
// Calldata can either be strict or a partial match
function expectCall(address,bytes calldata) external;
// Expect a call to an address with the specified msg.value and calldata
function expectCall(address,uint256,bytes calldata) external;
// Gets the code from an artifact file. Takes in the relative path to the json file
function getCode(string calldata) external returns (bytes memory);
// Labels an address in call traces
function label(address, string calldata) external;
// If the condition is false, discard this run's fuzz inputs and generate new ones
function assume(bool) external;
// Set nonce for an account
function setNonce(address,uint64) external;
// Get nonce for an account
function getNonce(address) external returns(uint64);
// Set block.chainid (newChainId)
function chainId(uint256) external;
// Using the address that calls the test contract, has the next call (at this call depth only) create a transaction that can later be signed and sent onchain
function broadcast() external;
// Has the next call (at this call depth only) create a transaction with the address provided as the sender that can later be signed and sent onchain
function broadcast(address) external;
// Using the address that calls the test contract, has the all subsequent calls (at this call depth only) create transactions that can later be signed and sent onchain
function startBroadcast() external;
// Has the all subsequent calls (at this call depth only) create transactions that can later be signed and sent onchain
function startBroadcast(address) external;
// Stops collecting onchain transactions
function stopBroadcast() external;
// Reads the entire content of file to string. Path is relative to the project root. (path) => (data)
function readFile(string calldata) external returns (string memory);
// Reads next line of file to string, (path) => (line)
function readLine(string calldata) external returns (string memory);
// Writes data to file, creating a file if it does not exist, and entirely replacing its contents if it does.
// Path is relative to the project root. (path, data) => ()
function writeFile(string calldata, string calldata) external;
// Writes line to file, creating a file if it does not exist.
// Path is relative to the project root. (path, data) => ()
function writeLine(string calldata, string calldata) external;
// Closes file for reading, resetting the offset and allowing to read it from beginning with readLine.
// Path is relative to the project root. (path) => ()
function closeFile(string calldata) external;
// Removes file. This cheatcode will revert in the following situations, but is not limited to just these cases:
// - Path points to a directory.
// - The file doesn't exist.
// - The user lacks permissions to remove the file.
// Path is relative to the project root. (path) => ()
function removeFile(string calldata) external;
function toString(address) external returns(string memory);
function toString(bytes calldata) external returns(string memory);
function toString(bytes32) external returns(string memory);
function toString(bool) external returns(string memory);
function toString(uint256) external returns(string memory);
function toString(int256) external returns(string memory);
// Snapshot the current state of the evm.
// Returns the id of the snapshot that was created.
// To revert a snapshot use `revertTo`
function snapshot() external returns(uint256);
// Revert the state of the evm to a previous snapshot
// Takes the snapshot id to revert to.
// This deletes the snapshot and all snapshots taken after the given snapshot id.
function revertTo(uint256) external returns(bool);
// Creates a new fork with the given endpoint and block and returns the identifier of the fork
function createFork(string calldata,uint256) external returns(uint256);
// Creates a new fork with the given endpoint and the _latest_ block and returns the identifier of the fork
function createFork(string calldata) external returns(uint256);
// Creates _and_ also selects a new fork with the given endpoint and block and returns the identifier of the fork
function createSelectFork(string calldata,uint256) external returns(uint256);
// Creates _and_ also selects a new fork with the given endpoint and the latest block and returns the identifier of the fork
function createSelectFork(string calldata) external returns(uint256);
// Takes a fork identifier created by `createFork` and sets the corresponding forked state as active.
function selectFork(uint256) external;
/// Returns the currently active fork
/// Reverts if no fork is currently active
function activeFork() external returns(uint256);
// Updates the currently active fork to given block number
// This is similar to `roll` but for the currently active fork
function rollFork(uint256) external;
// Updates the given fork to given block number
function rollFork(uint256 forkId, uint256 blockNumber) external;
/// Returns the RPC url for the given alias
function rpcUrl(string calldata) external returns(string memory);
/// Returns all rpc urls and their aliases `[alias, url][]`
function rpcUrls() external returns(string[2][] memory);
}
interface IERC20 {
event Approval(address indexed owner, address indexed spender, uint256 value);
event Transfer(address indexed from, address indexed to, uint256 value);
function name() external view returns (string memory);
function symbol() external view returns (string memory);
function decimals() external view returns (uint8);
function totalSupply() external view returns (uint256);
function balanceOf(address owner) external view returns (uint256);
function allowance(address owner, address spender)
external
view
returns (uint256);
function approve(address spender, uint256 value) external returns (bool);
function transfer(address to, uint256 value) external returns (bool);
function transferFrom(
address from,
address to,
uint256 value
) external returns (bool);
function withdraw(uint256 wad) external;
function deposit(uint256 wad) external returns (bool);
function owner() external view virtual returns (address);
}
interface ICErc20Delegate {
event AccrueInterest(
uint256 cashPrior,
uint256 interestAccumulated,
uint256 borrowIndex,
uint256 totalBorrows
);
event Approval(
address indexed owner,
address indexed spender,
uint256 amount
);
event Borrow(
address borrower,
uint256 borrowAmount,
uint256 accountBorrows,
uint256 totalBorrows
);
event Failure(uint256 error, uint256 info, uint256 detail);
event LiquidateBorrow(
address liquidator,
address borrower,
uint256 repayAmount,
address cTokenCollateral,
uint256 seizeTokens
);
event Mint(address minter, uint256 mintAmount, uint256 mintTokens);
event NewAdmin(address oldAdmin, address newAdmin);
event NewComptroller(address oldComptroller, address newComptroller);
event NewMarketInterestRateModel(
address oldInterestRateModel,
address newInterestRateModel
);
event NewPendingAdmin(address oldPendingAdmin, address newPendingAdmin);
event NewReserveFactor(
uint256 oldReserveFactorMantissa,
uint256 newReserveFactorMantissa
);
event Redeem(address redeemer, uint256 redeemAmount, uint256 redeemTokens);
event RepayBorrow(
address payer,
address borrower,
uint256 repayAmount,
uint256 accountBorrows,
uint256 totalBorrows
);
event ReservesAdded(
address benefactor,
uint256 addAmount,
uint256 newTotalReserves
);
event ReservesReduced(
address admin,
uint256 reduceAmount,
uint256 newTotalReserves
);
event Transfer(address indexed from, address indexed to, uint256 amount);
function _acceptAdmin() external returns (uint256);
function _addReserves(uint256 addAmount) external returns (uint256);
function _becomeImplementation(bytes memory data) external;
function _delegateCompLikeTo(address compLikeDelegatee) external;
function _reduceReserves(uint256 reduceAmount) external returns (uint256);
function _resignImplementation() external;
function _setComptroller(address newComptroller) external returns (uint256);
function _setInterestRateModel(address newInterestRateModel)
external
returns (uint256);
function _setPendingAdmin(address newPendingAdmin) external returns (uint256);
function _setReserveFactor(uint256 newReserveFactorMantissa)
external
returns (uint256);
function accrualBlockNumber() external view returns (uint256);
function accrueInterest() external returns (uint256);
function admin() external view returns (address);
function allowance(address owner, address spender)
external
view
returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function balanceOf(address owner) external view returns (uint256);
function balanceOfUnderlying(address owner) external returns (uint256);
function borrow(uint256 borrowAmount) external returns (uint256);
function borrowBalanceCurrent(address account) external returns (uint256);
function borrowBalanceStored(address account) external view returns (uint256);
function borrowIndex() external view returns (uint256);
function borrowRatePerBlock() external view returns (uint256);
function comptroller() external view returns (address);
function decimals() external view returns (uint8);
function exchangeRateCurrent() external returns (uint256);
function exchangeRateStored() external view returns (uint256);
function getAccountSnapshot(address account)
external
view
returns (
uint256,
uint256,
uint256,
uint256
);
function getCash() external view returns (uint256);
function implementation() external view returns (address);
function initialize(
address underlying_,
address comptroller_,
address interestRateModel_,
uint256 initialExchangeRateMantissa_,
string memory name_,
string memory symbol_,
uint8 decimals_
) external;
function initialize(
address comptroller_,
address interestRateModel_,
uint256 initialExchangeRateMantissa_,
string memory name_,
string memory symbol_,
uint8 decimals_
) external;
function interestRateModel() external view returns (address);
function isCToken() external view returns (bool);
function liquidateBorrow(
address borrower,
uint256 repayAmount,
address cTokenCollateral
) external returns (uint256);
function mint(uint256 mintAmount) external returns (uint256);
function name() external view returns (string memory);
function pendingAdmin() external view returns (address);
function protocolSeizeShareMantissa() external view returns (uint256);
function redeem(uint256 redeemTokens) external returns (uint256);
function redeemUnderlying(uint256 redeemAmount) external returns (uint256);
function repayBorrow(uint256 repayAmount) external returns (uint256);
function repayBorrowBehalf(address borrower, uint256 repayAmount)
external
returns (uint256);
function reserveFactorMantissa() external view returns (uint256);
function seize(
address liquidator,
address borrower,
uint256 seizeTokens
) external returns (uint256);
function supplyRatePerBlock() external view returns (uint256);
function sweepToken(address token) external;
function symbol() external view returns (string memory);
function totalBorrows() external view returns (uint256);
function totalBorrowsCurrent() external returns (uint256);
function totalReserves() external view returns (uint256);
function totalSupply() external view returns (uint256);
function transfer(address dst, uint256 amount) external returns (bool);
function transferFrom(
address src,
address dst,
uint256 amount
) external returns (bool);
function underlying() external view returns (address);
}
interface ERC1820Registry {
function setInterfaceImplementer(
address _addr,
bytes32 _interfaceHash,
address _implementer
) external;
}
interface IUniswapV2Factory {
event PairCreated(address indexed token0, address indexed token1, address pair, uint);
function feeTo() external view returns (address);
function feeToSetter() external view returns (address);
function getPair(address tokenA, address tokenB) external view returns (address pair);
function allPairs(uint) external view returns (address pair);
function allPairsLength() external view returns (uint);
function createPair(address tokenA, address tokenB) external returns (address pair);
function setFeeTo(address) external;
function setFeeToSetter(address) external;
}
interface IUniswapV2Pair {
function swap(
uint256 amount0Out,
uint256 amount1Out,
address to,
bytes calldata data
) external;
function token0() external view returns (address);
function token1() external view returns (address);
function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast);
function price0CumulativeLast() external view returns (uint);
function price1CumulativeLast() external view returns (uint);
}
interface IBacon {
function lend(uint256 index) external;
function redeem(uint256 index) external;
function balanceOf(address account) external view returns (uint256);
}
interface IACOWriter {
function erc20proxy() external view returns (address);
function weth() external view returns (address);
function write(
address acoToken,
uint256 collateralAmount,
address exchangeAddress,
bytes memory exchangeData
) external payable;
receive() external payable;
}
interface IRevest {
struct FNFTConfig {
address asset;
address pipeToContract;
uint256 depositAmount;
uint256 depositMul;
uint256 split;
uint256 depositStopTime;
bool maturityExtension;
bool isMulti;
bool nontransferrable;
}
event FNFTAddionalDeposited(
address indexed from,
uint256 indexed newFNFTId,
uint256 indexed quantity,
uint256 amount
);
event FNFTAddressLockMinted(
address indexed asset,
address indexed from,
uint256 indexed fnftId,
address trigger,
uint256[] quantities,
FNFTConfig fnftConfig
);
event FNFTMaturityExtended(
address indexed from,
uint256 indexed fnftId,
uint256 indexed newExtendedTime
);
event FNFTSplit(
address indexed from,
uint256[] indexed newFNFTId,
uint256[] indexed proportions,
uint256 quantity
);
event FNFTTimeLockMinted(
address indexed asset,
address indexed from,
uint256 indexed fnftId,
uint256 endTime,
uint256[] quantities,
FNFTConfig fnftConfig
);
event FNFTUnlocked(address indexed from, uint256 indexed fnftId);
event FNFTValueLockMinted(
address indexed primaryAsset,
address indexed from,
uint256 indexed fnftId,
address compareTo,
address oracleDispatch,
uint256[] quantities,
FNFTConfig fnftConfig
);
event FNFTWithdrawn(
address indexed from,
uint256 indexed fnftId,
uint256 indexed quantity
);
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
event RoleAdminChanged(
bytes32 indexed role,
bytes32 indexed previousAdminRole,
bytes32 indexed newAdminRole
);
event RoleGranted(
bytes32 indexed role,
address indexed account,
address indexed sender
);
event RoleRevoked(
bytes32 indexed role,
address indexed account,
address indexed sender
);
function ADDRESS_LOCK_INTERFACE_ID() external view returns (bytes4);
function DEFAULT_ADMIN_ROLE() external view returns (bytes32);
function PAUSER_ROLE() external view returns (bytes32);
function depositAdditionalToFNFT(
uint256 fnftId,
uint256 amount,
uint256 quantity
) external returns (uint256);
function erc20Fee() external view returns (uint256);
function extendFNFTMaturity(uint256 fnftId, uint256 endTime)
external
returns (uint256);
function flatWeiFee() external view returns (uint256);
function getAddressesProvider() external view returns (address);
function getERC20Fee() external view returns (uint256);
function getFlatWeiFee() external view returns (uint256);
function getRoleAdmin(bytes32 role) external view returns (bytes32);
function getRoleMember(bytes32 role, uint256 index)
external
view
returns (address);
function getRoleMemberCount(bytes32 role) external view returns (uint256);
function grantRole(bytes32 role, address account) external;
function hasRole(bytes32 role, address account) external view returns (bool);
function mintAddressLock(
address trigger,
bytes memory arguments,
address[] memory recipients,
uint256[] memory quantities,
FNFTConfig memory fnftConfig
) external payable returns (uint256);
function mintTimeLock(
uint256 endTime,
address[] memory recipients,
uint256[] memory quantities,
FNFTConfig memory fnftConfig
) external payable returns (uint256);
function mintValueLock(
address primaryAsset,
address compareTo,
uint256 unlockValue,
bool unlockRisingEdge,
address oracleDispatch,
address[] memory recipients,
uint256[] memory quantities,
FNFTConfig memory fnftConfig
) external payable returns (uint256);
function owner() external view returns (address);
function renounceOwnership() external;
function renounceRole(bytes32 role, address account) external;
function revokeRole(bytes32 role, address account) external;
function setAddressRegistry(address registry) external;
function setERC20Fee(uint256 erc20) external;
function setFlatWeiFee(uint256 wethFee) external;
function splitFNFT(
uint256 fnftId,
uint256[] memory proportions,
uint256 quantity
) external returns (uint256[] memory);
function supportsInterface(bytes4 interfaceId) external view returns (bool);
function transferOwnership(address newOwner) external;
function unlockFNFT(uint256 fnftId) external;
function withdrawFNFT(uint256 fnftId, uint256 quantity) external;
}
interface AnyswapV4Router {
function anySwapOutUnderlyingWithPermit(
address from,
address token,
address to,
uint256 amount,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s,
uint256 toChainID
) external;
}
interface WETH {
function approve(address guy, uint256 wad) external returns (bool);
function withdraw(uint256 wad) external;
function balanceOf(address) external view returns (uint256);
function transfer(address dst, uint256 wad) external returns (bool);
}
interface AnyswapV1ERC20 {
function mint(address to, uint256 amount) external returns (bool);
function burn(address from, uint256 amount) external returns (bool);
function changeVault(address newVault) external returns (bool);
function depositVault(uint256 amount, address to) external returns (uint256);
function withdrawVault(
address from,
uint256 amount,
address to
) external returns (uint256);
function underlying() external view returns (address);
}
interface IERC1820Registry {
function setInterfaceImplementer(
address _addr,
bytes32 _interfaceHash,
address _implementer
) external;
function getManager(address _addr) external view returns (address);
function setManager(address _addr, address _newManager) external;
function interfaceHash(string memory _interfaceName)
external
pure
returns (bytes32);
function updateERC165Cache(address _contract, bytes4 _interfaceId) external;
function getInterfaceImplementer(address _addr, bytes32 _interfaceHash)
external
view
returns (address);
function implementsERC165InterfaceNoCache(
address _contract,
bytes4 _interfaceId
) external view returns (bool);
function implementsERC165Interface(address _contract, bytes4 _interfaceId)
external
view
returns (bool);
event InterfaceImplementerSet(
address indexed addr,
bytes32 indexed interfaceHash,
address indexed implementer
);
event ManagerChanged(address indexed addr, address indexed newManager);
}
interface IERC777 {
function name() external view returns (string memory);
function symbol() external view returns (string memory);
function granularity() external view returns (uint256);
function totalSupply() external view returns (uint256);
function balanceOf(address owner) external view returns (uint256);
function send(
address recipient,
uint256 amount,
bytes calldata data
) external;
function burn(uint256 amount, bytes calldata data) external;
function isOperatorFor(address operator, address tokenHolder)
external
view
returns (bool);
function authorizeOperator(address operator) external;
function revokeOperator(address operator) external;
function defaultOperators() external view returns (address[] memory);
function operatorSend(
address sender,
address recipient,
uint256 amount,
bytes calldata data,
bytes calldata operatorData
) external;
function operatorBurn(
address account,
uint256 amount,
bytes calldata data,
bytes calldata operatorData
) external;
event Sent(
address indexed operator,
address indexed from,
address indexed to,
uint256 amount,
bytes data,
bytes operatorData
);
event Minted(
address indexed operator,
address indexed to,
uint256 amount,
bytes data,
bytes operatorData
);
event Burned(
address indexed operator,
address indexed from,
uint256 amount,
bytes data,
bytes operatorData
);
event AuthorizedOperator(
address indexed operator,
address indexed tokenHolder
);
event RevokedOperator(address indexed operator, address indexed tokenHolder);
}
interface Uni_Pair_V2 {
event Approval(address indexed owner, address indexed spender, uint256 value);
event Burn(
address indexed sender,
uint256 amount0,
uint256 amount1,
address indexed to
);
event Mint(address indexed sender, uint256 amount0, uint256 amount1);
event Swap(
address indexed sender,
uint256 amount0In,
uint256 amount1In,
uint256 amount0Out,
uint256 amount1Out,
address indexed to
);
event Sync(uint112 reserve0, uint112 reserve1);
event Transfer(address indexed from, address indexed to, uint256 value);
function DOMAIN_SEPARATOR() external view returns (bytes32);
function MINIMUM_LIQUIDITY() external view returns (uint256);
function PERMIT_TYPEHASH() external view returns (bytes32);
function allowance(address, address) external view returns (uint256);
function approve(address spender, uint256 value) external returns (bool);
function balanceOf(address) external view returns (uint256);
function burn(address to) external returns (uint256 amount0, uint256 amount1);
function decimals() external view returns (uint8);
function factory() external view returns (address);
function getReserves()
external
view
returns (
uint112 _reserve0,
uint112 _reserve1,
uint32 _blockTimestampLast
);
function initialize(address _token0, address _token1) external;
function kLast() external view returns (uint256);
function mint(address to) external returns (uint256 liquidity);
function name() external view returns (string memory);
function nonces(address) external view returns (uint256);
function permit(
address owner,
address spender,
uint256 value,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) external;
function price0CumulativeLast() external view returns (uint256);
function price1CumulativeLast() external view returns (uint256);
function skim(address to) external;
function swap(
uint256 amount0Out,
uint256 amount1Out,
address to,
bytes memory data
) external;
function symbol() external view returns (string memory);
function sync() external;
function token0() external view returns (address);
function token1() external view returns (address);
function totalSupply() external view returns (uint256);
function transfer(address to, uint256 value) external returns (bool);
function transferFrom(
address from,
address to,
uint256 value
) external returns (bool);
}
interface Uni_Router_V2 {
function WETH() external view returns (address);
function addLiquidity(
address tokenA,
address tokenB,
uint256 amountADesired,
uint256 amountBDesired,
uint256 amountAMin,
uint256 amountBMin,
address to,
uint256 deadline
)
external
returns (
uint256 amountA,
uint256 amountB,
uint256 liquidity
);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
function factory() external view returns (address);
function getAmountIn(
uint256 amountOut,
uint256 reserveIn,
uint256 reserveOut
) external pure returns (uint256 amountIn);
function getAmountOut(
uint256 amountIn,
uint256 reserveIn,
uint256 reserveOut
) external pure returns (uint256 amountOut);
function getAmountsIn(uint256 amountOut, address[] memory path)
external
view
returns (uint256[] memory amounts);
function getAmountsOut(uint256 amountIn, address[] memory path)
external
view
returns (uint256[] memory amounts);
function quote(
uint256 amountA,
uint256 reserveA,
uint256 reserveB
) external pure returns (uint256 amountB);
function removeLiquidity(
address tokenA,
address tokenB,
uint256 liquidity,
uint256 amountAMin,
uint256 amountBMin,
address to,
uint256 deadline
) external returns (uint256 amountA, uint256 amountB);
function removeLiquidityETH(
address token,
uint256 liquidity,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
) external returns (uint256 amountToken, uint256 amountETH);
function removeLiquidityETHSupportingFeeOnTransferTokens(