-
Notifications
You must be signed in to change notification settings - Fork 567
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add initial contract to validate operations
- Loading branch information
1 parent
8a041be
commit d6af2e5
Showing
2 changed files
with
44 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
// SPDX-License-Identifier: agpl-3.0 | ||
pragma solidity 0.8.7; | ||
|
||
interface IOperationalValidator { | ||
function isBorrowAllowed() external returns (bool); | ||
|
||
function isLiquidationAllowed() external returns (bool); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// SPDX-License-Identifier: agpl-3.0 | ||
pragma solidity 0.8.7; | ||
|
||
import {IPoolAddressesProvider} from '../../interfaces/IPoolAddressesProvider.sol'; | ||
import {IOperationalValidator} from '../../interfaces/IOperationalValidator.sol'; | ||
|
||
/** | ||
* @title OperationalValidator | ||
* @author Aave | ||
* @notice | ||
*/ | ||
contract OperationalValidator is IOperationalValidator { | ||
IPoolAddressesProvider public _addressesProvider; | ||
uint256 public _gracePeriod; | ||
|
||
/** | ||
* @notice Constructor | ||
* @dev | ||
* @param provider The address of the PoolAddressesProvider | ||
*/ | ||
constructor(IPoolAddressesProvider provider, uint256 gracePeriod) { | ||
_addressesProvider = provider; | ||
_gracePeriod = gracePeriod; | ||
} | ||
|
||
/// @inheritdoc IOperationalValidator | ||
function isBorrowAllowed() public override returns (bool) { | ||
// If the sequencer goes down, borrowing is not allowed | ||
} | ||
|
||
/// @inheritdoc IOperationalValidator | ||
function isLiquidationAllowed() public override returns (bool) { | ||
// If the sequencer goes down AND HF > 0.9, liquidation is not allowed | ||
// If timestampSequencerGotUp - block.timestamp > gracePeriod, liquidation allowed | ||
} | ||
} |