forked from aave-dao/aave-v3-origin
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathAaveV3MockListingCustom.sol
72 lines (64 loc) · 2.14 KB
/
AaveV3MockListingCustom.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
// SPDX-License-Identifier: BUSL-1.1
pragma solidity ^0.8.0;
import '../../../../src/contracts/extensions/v3-config-engine/AaveV3Payload.sol';
/**
* @dev Smart contract for a mock custom listing update, for testing purposes
* IMPORTANT Parameters are pseudo-random, DON'T USE THIS ANYHOW IN PRODUCTION
* @author BGD Labs
*/
contract AaveV3MockListingCustom is AaveV3Payload {
address public immutable ASSET_ADDRESS;
address public immutable ASSET_FEED;
address public immutable A_TOKEN_IMPL;
address public immutable V_TOKEN_IMPL;
constructor(
address assetAddress,
address assetFeed,
address customEngine,
address aTokenImpl,
address vTokenImpl
) AaveV3Payload(IEngine(customEngine)) {
ASSET_ADDRESS = assetAddress;
ASSET_FEED = assetFeed;
A_TOKEN_IMPL = aTokenImpl;
V_TOKEN_IMPL = vTokenImpl;
}
function newListingsCustom()
public
view
override
returns (IEngine.ListingWithCustomImpl[] memory)
{
IEngine.ListingWithCustomImpl[] memory listingsCustom = new IEngine.ListingWithCustomImpl[](1);
listingsCustom[0] = IEngine.ListingWithCustomImpl(
IEngine.Listing({
asset: ASSET_ADDRESS,
assetSymbol: 'PSP',
priceFeed: ASSET_FEED,
rateStrategyParams: IEngine.InterestRateInputData({
optimalUsageRatio: 80_00,
baseVariableBorrowRate: 25, // 0.25%
variableRateSlope1: 3_00,
variableRateSlope2: 75_00
}),
enabledToBorrow: EngineFlags.ENABLED,
borrowableInIsolation: EngineFlags.DISABLED,
withSiloedBorrowing: EngineFlags.DISABLED,
flashloanable: EngineFlags.DISABLED,
ltv: 82_50,
liqThreshold: 86_00,
liqBonus: 5_00,
reserveFactor: 10_00,
supplyCap: 85_000,
borrowCap: 60_000,
debtCeiling: 0,
liqProtocolFee: 10_00
}),
IEngine.TokenImplementations({aToken: A_TOKEN_IMPL, vToken: V_TOKEN_IMPL})
);
return listingsCustom;
}
function getPoolContext() public pure override returns (IEngine.PoolContext memory) {
return IEngine.PoolContext({networkName: 'Local', networkAbbreviation: 'Loc'});
}
}