-
Notifications
You must be signed in to change notification settings - Fork 37
Expand file tree
/
Copy pathInterfaces.sol
More file actions
613 lines (398 loc) · 17.8 KB
/
Copy pathInterfaces.sol
File metadata and controls
613 lines (398 loc) · 17.8 KB
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
// SPDX-License-Identifier: AGPL-3.0
pragma solidity >=0.7.5 <0.9.0;
import { IERC20 } from "forge-std/interfaces/IERC20.sol";
import { IERC4626 } from "forge-std/interfaces/IERC4626.sol";
import { IERC7540 } from "forge-std/interfaces/IERC7540.sol";
import { Id } from "metamorpho/interfaces/IMetaMorpho.sol";
import { PoolId } from "spark-alm-controller/lib/uniswap-v4-core/src/types/PoolId.sol";
import { PoolKey } from "spark-alm-controller/lib/uniswap-v4-core/src/types/PoolKey.sol";
import { PositionInfo } from "spark-alm-controller/lib/uniswap-v4-periphery/src/libraries/PositionInfoLibrary.sol";
interface IALMProxyFreezableLike {
function ALLOCATOR_ROLE() external returns (bytes32);
function DEFAULT_ADMIN_ROLE() external returns (bytes32);
function FREEZER_ROLE() external returns (bytes32);
function hasRole(bytes32 role, address account) external view returns (bool);
}
interface IArbitrumTokenBridge {
function outboundTransfer(
address l1Token,
address to,
uint256 amount,
uint256 maxGas,
uint256 gasPriceBid,
bytes calldata data
) external payable returns (bytes memory res);
function getOutboundCalldata(
address l1Token,
address from,
address to,
uint256 amount,
bytes memory data
) external pure returns (bytes memory outboundCalldata);
}
interface IProxyLike {
function implementation() external view returns (address);
}
interface IOptimismTokenBridge {
function bridgeERC20To(
address _localToken,
address _remoteToken,
address _to,
uint256 _amount,
uint32 _minGasLimit,
bytes calldata _extraData
) external;
}
interface IOracleLike {
function DECIMALS() external view returns (uint8);
function decimals() external view returns (uint8);
function description() external view returns (string memory);
function name() external view returns (string memory);
function version() external view returns (uint256);
function latestAnswer() external view returns (int256);
}
interface ITreasuryControllerLike {
function transfer(
address collector,
address token,
address recipient,
uint256 amount
) external;
}
interface IStarGuardLike {
function plot(address addr_, bytes32 tag_) external;
function exec() external returns (address addr);
}
interface ISparkVaultV2Like {
function asset() external view returns (address);
function assetsOf(address user) external view returns (uint256);
function balanceOf(address user) external view returns (uint256);
function chi() external view returns (uint192);
function decimals() external view returns (uint8);
function DEFAULT_ADMIN_ROLE() external view returns (bytes32);
function deposit(uint256 assets, address receiver) external returns (uint256 shares);
function depositCap() external view returns (uint256);
function getImplementation() external view returns (address);
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 minVsr() external view returns (uint256);
function maxDeposit(address) external view returns (uint256);
function maxVsr() external view returns (uint256);
function name() external view returns (string memory);
function nowChi() external view returns (uint256);
function redeem(uint256 shares, address receiver, address owner) external returns (uint256 assets);
function revokeRole(bytes32 role, address account) external;
function rho() external view returns (uint64);
function setDepositCap(uint256 newCap) external;
function SETTER_ROLE() external view returns (bytes32);
function setVsr(uint256 newVsr) external;
function setVsrBounds(uint256 minVsr_, uint256 maxVsr_) external;
function symbol() external view returns (string memory);
function TAKER_ROLE() external view returns (bytes32);
function totalAssets() external view returns (uint256);
function totalSupply() external view returns (uint256);
function vsr() external view returns (uint256);
}
interface IAuthorityLike {
function canCall(address src, address dst, bytes4 sig) external view returns (bool);
function hat() external view returns (address);
function lock(uint256 amount) external;
function vote(address[] calldata slate) external;
function lift(address target) external;
}
interface ICustomIRMLike {
function RATE_SOURCE() external view returns (address);
function getBaseVariableBorrowRateSpread() external view returns (uint256);
}
interface IExecutableLike {
function execute() external;
}
interface IMorphoLike {
struct Position {
uint256 supplyShares;
uint128 borrowShares;
uint128 collateral;
}
function position(Id id, address user) external view returns (Position memory p);
function market(Id id)
external
view
returns (
uint128 totalSupplyAssets,
uint128 totalSupplyShares,
uint128 totalBorrowAssets,
uint128 totalBorrowShares,
uint128 lastUpdate,
uint128 fee
);
}
interface IMorphoOracleFactoryLike {
// NOTE: This applies to all oracles deployed by the factory
function isMorphoChainlinkOracleV2(address) external view returns (bool);
}
interface IMorphoVaultLike {
function acceptGuardian() external;
function curator() external returns (address);
function guardian() external returns (address);
function timelock() external returns (uint256);
function isAllocator(address) external returns (bool);
function setCurator(address newCurator) external;
function submitGuardian(address newGuardian) external;
function setIsAllocator(address newAllocator, bool newIsAllocator) external;
function submitTimelock(uint256 newTimelock) external;
}
interface IPendleLinearDiscountOracleLike {
function baseDiscountPerYear() external view returns (uint256);
function decimals() external view returns (uint256);
function getDiscount(uint256 timeLeft) external view returns (uint256);
function maturity() external view returns (uint256);
function PT() external view returns (address);
function latestRoundData()
external
view
returns (uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound);
}
interface IRateSourceLike {
function getAPR() external view returns (int256);
function decimals() external view returns (uint256);
}
interface ISparkProxyLike {
function wards(address) external view returns (uint256);
}
interface ITargetBaseIRMLike {
function getBaseVariableBorrowRateSpread() external view returns (uint256);
}
interface ITargetKinkIRMLike {
function getVariableRateSlope1Spread() external view returns (uint256);
}
interface ICurvePoolLike is IERC20 {
function A() external view returns (uint256);
function add_liquidity(
uint256[] memory amounts,
uint256 minMintAmount,
address receiver
) external;
function balances(uint256 index) external view returns (uint256);
function coins(uint256 index) external returns (address);
function exchange(
int128 inputIndex,
int128 outputIndex,
uint256 amountIn,
uint256 minAmountOut,
address receiver
) external returns (uint256 tokensOut);
function fee() external view returns (uint256);
function get_dy(
int128 inputIndex,
int128 outputIndex,
uint256 amountIn
) external view returns (uint256 tokensOut);
function get_virtual_price() external view returns (uint256);
function N_COINS() external view returns (uint256);
function offpeg_fee_multiplier() external view returns (uint256);
function remove_liquidity(
uint256 burnAmount,
uint256[] memory minAmounts,
address receiver
) external;
function stored_rates() external view returns (uint256[] memory);
}
interface IPoolManagerLike {
function poolDelegate() external view returns (address);
function strategyList(uint256 index) external view returns (address);
function strategyListLength() external view returns (uint256);
function withdrawalManager() external view returns (address);
}
interface IPSMLike {
function pocket() external view returns (address);
}
interface IMapleStrategyLike {
function assetsUnderManagement() external view returns (uint256);
function withdrawFromStrategy(uint256 amount) external;
}
interface IWithdrawalManagerLike {
function processRedemptions(uint256 maxSharesToProcess) external;
function totalShares() external returns (uint256);
}
interface ISyrupLike is IERC4626 {
function manager() external view returns (address);
}
interface ISUSDELike is IERC4626 {
function silo() external view returns (address);
}
interface ICurveStableswapFactoryLike {
function get_implementation_address(address pool) external view returns (address);
}
interface IFarmLike {
function earned(address account) external view returns (uint256);
function rewardsToken() external view returns (address);
function stakingToken() external view returns (address);
}
interface ISuperstateTokenLike is IERC20 {
function calculateSuperstateTokenOut(uint256, address) external view returns (uint256, uint256, uint256);
function supportedStablecoins(address stablecoin) external view returns (address sweepDestination, uint256 fee);
}
interface ISSRedemptionLike {
function calculateUsdcOut(uint256 ustbAmount) external view returns (uint256 usdcOutAmount, uint256 usdPerUstbChainlinkRaw);
function calculateUstbIn(uint256 usdcOutAmount) external view returns (uint256 ustbInAmount, uint256 usdPerUstbChainlinkRaw);
}
interface IInvestmentManagerLike {
function fulfillCancelDepositRequest(
uint64 poolId,
bytes16 trancheId,
address user,
uint128 assetId,
uint128 assets,
uint128 fulfillment
) external;
function fulfillCancelRedeemRequest(
uint64 poolId,
bytes16 trancheId,
address user,
uint128 assetId,
uint128 shares
) external;
function fulfillDepositRequest(
uint64 poolId,
bytes16 trancheId,
address user,
uint128 assetId,
uint128 assets,
uint128 shares
) external;
function fulfillRedeemRequest(
uint64 poolId,
bytes16 trancheId,
address user,
uint128 assetId,
uint128 assets,
uint128 shares
) external;
function escrow() external view returns (address);
}
interface ICentrifugeTokenLike is IERC7540 {
function claimableCancelDepositRequest(uint256 requestId, address controller)
external view returns (uint256 claimableAssets);
function claimableCancelRedeemRequest(uint256 requestId, address controller)
external view returns (uint256 claimableShares);
function pendingCancelDepositRequest(uint256 requestId, address controller)
external view returns (bool isPending);
function pendingCancelRedeemRequest(uint256 requestId, address controller)
external view returns (bool isPending);
function manager() external view returns (address);
function share() external view returns (address);
function root() external view returns (address);
function trancheId() external view returns (bytes16);
function poolId() external view returns (uint64);
}
interface IPSM3Like {
function convertToAssets(address asset, uint256 shares) external view returns (uint256);
function convertToAssetValue(uint256 shares) external view returns (uint256);
function shares(address account) external view returns (uint256);
}
interface IATokenLike {
function POOL() external view returns(address);
}
interface IERC20Like {
function balanceOf(address account) external view returns (uint256);
function decimals() external view returns (uint8);
}
// Uniswap V4
interface IPositionManagerLike {
function getPositionLiquidity(uint256 tokenId) external view returns (uint128 liquidity);
function nextTokenId() external view returns (uint256 nextTokenId);
function ownerOf(uint256 tokenId) external view returns (address owner);
function poolKeys(bytes25 poolId) external view returns (PoolKey memory poolKeys);
}
// Uniswap V4
interface IStateViewLike {
function getSlot0(PoolId poolId)
external view returns (uint160 sqrtPriceX96, int24 tick, uint24 protocolFee, uint24 lpFee);
}
// Uniswap V4
interface IV4QuoterLike {
struct QuoteExactSingleParams {
PoolKey poolKey;
bool zeroForOne;
uint128 exactAmount;
bytes hookData;
}
function quoteExactInputSingle(QuoteExactSingleParams memory params)
external returns (uint256 amountOut, uint256 gasEstimate);
}
// Morpho v2 vault
interface IMorphoVaultV2FactoryLike {
function createVaultV2(address owner, address asset, bytes32 salt) external returns (address newVaultV2);
}
interface IMorphoMarketV1AdapterV2FactoryLike {
function isMorphoMarketV1AdapterV2(address account) external view returns (bool);
}
interface IMorphoMarketV1AdapterV2Like {
function asset() external view returns (address);
function adaptiveCurveIrm() external view returns (address);
function burnShares(bytes32 marketId) external;
function factory() external view returns (address);
function morpho() external view returns (address);
function marketIds(uint256 index) external view returns (bytes32);
function marketIdsLength() external view returns (uint256);
function parentVault() external view returns (address);
function timelock(bytes4 selector) external view returns (uint256);
}
interface IMorphoVaultV2Like {
event Constructor(address indexed owner, address indexed asset);
event AccrueInterest(uint256 previousTotalAssets, uint256 newTotalAssets, uint256 performanceFeeShares, uint256 managementFeeShares);
event Transfer(address indexed from, address indexed to, uint256 shares);
event Deposit(address indexed sender, address indexed onBehalf, uint256 assets, uint256 shares);
event SetIsSentinel(address indexed account, bool newIsSentinel);
event SetIsAllocator(address indexed account, bool newIsAllocator);
function abdicate(bytes4 selector) external;
function abdicated(bytes4 selector) external view returns (bool);
function accrueInterest() external;
function adapters(uint256 index) external view returns (address);
function adaptersLength() external view returns (uint256);
function adapterRegistry() external view returns (address);
function allocate(address adapter, bytes memory data, uint256 assets) external;
function asset() external view returns (address);
function balanceOf(address account) external view returns (uint256);
function curator() external view returns (address);
function convertToAssets(uint256 shares) external view returns (uint256);
function deallocate(address adapter, bytes memory data, uint256 assets) external;
function decimals() external view returns (uint8);
function deposit(uint256 assets, address receiver) external returns (uint256 shares);
function isAllocator(address allocator) external view returns (bool);
function isAdapter(address adapter) external view returns (bool);
function isSentinel(address sentinel) external view returns (bool);
function increaseAbsoluteCap(bytes memory idData, uint256 newAbsoluteCap) external;
function increaseRelativeCap(bytes memory idData, uint256 newRelativeCap) external;
function increaseTimelock(bytes4 selector, uint256 newDuration) external;
function liquidityAdapter() external view returns (address);
function liquidityData() external view returns (bytes memory);
function managementFee() external view returns (uint96);
function managementFeeRecipient() external view returns (address);
function maxRate() external view returns (uint64);
function name() external view returns (string memory);
function owner() external view returns (address);
function performanceFee() external view returns (uint96);
function performanceFeeRecipient() external view returns (address);
function removeAdapter(address account) external;
function symbol() external view returns (string memory);
function setCurator(address newCurator) external;
function setForceDeallocatePenalty(address adapter, uint256 newForceDeallocatePenalty) external;
function setName(string memory newName) external;
function setSymbol(string memory newSymbol) external;
function setIsAllocator(address newAllocator, bool newIsAllocator) external;
function setIsSentinel(address newSentinel, bool newIsSentinel) external;
function setAdapterRegistry(address newAdapterRegistry) external;
function setLiquidityAdapterAndData(address newLiquidityAdapter, bytes memory newLiquidityData) external;
function setMaxRate(uint256 newMaxRate) external;
function setReceiveSharesGate(address newReceiveSharesGate) external;
function setReceiveAssetsGate(address newReceiveAssetsGate) external;
function setSendSharesGate(address newSendSharesGate) external;
function timelock(bytes4 selector) external view returns (uint256);
function addAdapter(address account) external;
function submit(bytes calldata data) external;
function totalAssets() external view returns (uint256);
function withdraw(uint256 assets, address receiver, address owner) external returns (uint256 shares);
}