mirror of
https://github.com/Instadapp/dsa-connectors.git
synced 2024-07-29 22:37:00 +00:00
fixes
Signed-off-by: pradyuman-verma <pradyumnverma27@gmail.com>
This commit is contained in:
parent
fb523149c8
commit
b72f8891e5
|
@ -15,3 +15,11 @@ interface InstaAaveAutomation {
|
||||||
uint256 thresholdHealthFactor
|
uint256 thresholdHealthFactor
|
||||||
) external;
|
) external;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
interface AccountInterface {
|
||||||
|
function enable(address) external;
|
||||||
|
|
||||||
|
function disable(address) external;
|
||||||
|
|
||||||
|
function isAuth(address) external view returns (bool);
|
||||||
|
}
|
||||||
|
|
|
@ -22,6 +22,13 @@ abstract contract Resolver is Events {
|
||||||
payable
|
payable
|
||||||
returns (string memory _eventName, bytes memory _eventParam)
|
returns (string memory _eventName, bytes memory _eventParam)
|
||||||
{
|
{
|
||||||
|
bool isAuth = AccountInterface(address(this)).isAuth(
|
||||||
|
address(automation)
|
||||||
|
);
|
||||||
|
|
||||||
|
if (!isAuth)
|
||||||
|
AccountInterface(address(this)).enable(address(automation));
|
||||||
|
|
||||||
automation.submitAutomationRequest(
|
automation.submitAutomationRequest(
|
||||||
safeHealthFactor,
|
safeHealthFactor,
|
||||||
thresholdHealthFactor
|
thresholdHealthFactor
|
||||||
|
@ -39,6 +46,14 @@ abstract contract Resolver is Events {
|
||||||
returns (string memory _eventName, bytes memory _eventParam)
|
returns (string memory _eventName, bytes memory _eventParam)
|
||||||
{
|
{
|
||||||
automation.cancelAutomationRequest();
|
automation.cancelAutomationRequest();
|
||||||
|
|
||||||
|
bool isAuth = AccountInterface(address(this)).isAuth(
|
||||||
|
address(automation)
|
||||||
|
);
|
||||||
|
|
||||||
|
if (isAuth)
|
||||||
|
AccountInterface(address(this)).disable(address(automation));
|
||||||
|
|
||||||
(_eventName, _eventParam) = ("LogCancelAutomation()", "0x");
|
(_eventName, _eventParam) = ("LogCancelAutomation()", "0x");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user