forked from aave-dao/aave-v3-origin
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathAaveV3MockBorrowUpdate.sol
37 lines (30 loc) · 1.29 KB
/
AaveV3MockBorrowUpdate.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
// 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 borrow update, to be able to test
* IMPORTANT Parameters are pseudo-random, DON'T USE THIS ANYHOW IN PRODUCTION
* @dev Inheriting directly from AaveV3Payload for being able to inject a custom engine
* @author BGD Labs
*/
contract AaveV3MockBorrowUpdate is AaveV3Payload {
address public immutable ASSET_ADDRESS;
constructor(address assetAddress, address customEngine) AaveV3Payload(IEngine(customEngine)) {
ASSET_ADDRESS = assetAddress;
}
function borrowsUpdates() public view override returns (IEngine.BorrowUpdate[] memory) {
IEngine.BorrowUpdate[] memory borrowsUpdate = new IEngine.BorrowUpdate[](1);
borrowsUpdate[0] = IEngine.BorrowUpdate({
asset: ASSET_ADDRESS,
enabledToBorrow: EngineFlags.ENABLED,
flashloanable: EngineFlags.DISABLED,
borrowableInIsolation: EngineFlags.KEEP_CURRENT,
withSiloedBorrowing: EngineFlags.KEEP_CURRENT,
reserveFactor: 15_00
});
return borrowsUpdate;
}
function getPoolContext() public pure override returns (IEngine.PoolContext memory) {
return IEngine.PoolContext({networkName: 'Local', networkAbbreviation: 'Loc'});
}
}