forked from aave-dao/aave-v3-origin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAaveV3MockAssetEModeUpdate.sol
46 lines (39 loc) · 1.42 KB
/
AaveV3MockAssetEModeUpdate.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
// 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 asset e-mode update, for testing purposes
* IMPORTANT Parameters are pseudo-random, DON'T USE THIS ANYHOW IN PRODUCTION
* @author BGD Labs
*/
contract AaveV3MockAssetEModeUpdate is AaveV3Payload {
address public immutable ASSET_ADDRESS;
address public immutable ASSET_2_ADDRESS;
constructor(
address assetAddress,
address asset2Address,
address customEngine
) AaveV3Payload(IEngine(customEngine)) {
ASSET_ADDRESS = assetAddress;
ASSET_2_ADDRESS = asset2Address;
}
function assetsEModeUpdates() public view override returns (IEngine.AssetEModeUpdate[] memory) {
IEngine.AssetEModeUpdate[] memory eModeUpdate = new IEngine.AssetEModeUpdate[](2);
eModeUpdate[0] = IEngine.AssetEModeUpdate({
asset: ASSET_ADDRESS,
eModeCategory: 1,
collateral: EngineFlags.DISABLED,
borrowable: EngineFlags.ENABLED
});
eModeUpdate[1] = IEngine.AssetEModeUpdate({
asset: ASSET_2_ADDRESS,
eModeCategory: 1,
collateral: EngineFlags.ENABLED,
borrowable: EngineFlags.KEEP_CURRENT
});
return eModeUpdate;
}
function getPoolContext() public pure override returns (IEngine.PoolContext memory) {
return IEngine.PoolContext({networkName: 'Local', networkAbbreviation: 'Loc'});
}
}