Contract Name:
AlwaysOnlineOracleSentinel
Contract Source Code:
<i class='far fa-question-circle text-muted ms-2' data-bs-trigger='hover' data-bs-toggle='tooltip' data-bs-html='true' data-bs-title='Click on the check box to select individual contract to compare. Only 1 contract can be selected from each side.'></i>
/*
Copyright 2020 Dolomite.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
pragma solidity ^0.5.7;
pragma experimental ABIEncoderV2;
import { IOracleSentinel } from "../../protocol/interfaces/IOracleSentinel.sol";
/**
* @title AlwaysOnlineOracleSentinel
* @author Dolomite
*
* An implementation of the IOracleSentinel interface that always returns `true` for its implementation functions.
* Useful for deployments on networks that don't need an oracle sentinel.
*/
contract AlwaysOnlineOracleSentinel is IOracleSentinel {
function ownerSetGracePeriod(
uint256 /* _gracePeriod */
) external {
revert("AlwaysOnlineOracleSentinel: Not implemented");
}
function isBorrowAllowed() external view returns (bool) {
return true;
}
function isLiquidationAllowed() external view returns (bool) {
return true;
}
function gracePeriod() external view returns (uint256) {
return 0;
}
}
<i class='far fa-question-circle text-muted ms-2' data-bs-trigger='hover' data-bs-toggle='tooltip' data-bs-html='true' data-bs-title='Click on the check box to select individual contract to compare. Only 1 contract can be selected from each side.'></i>
/*
Copyright 2023 Dolomite
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
pragma solidity ^0.5.7;
pragma experimental ABIEncoderV2;
/**
* @title IOracleSentinel
* @author Dolomite
*
* Interface that Dolomite pings to check if the Blockchain or L2 is alive, if liquidations should be processed, and if
* markets should are in size-down only mode.
*/
contract IOracleSentinel {
// ============ Events ============
event GracePeriodSet(
uint256 gracePeriod
);
// ============ Functions ============
/**
* @dev Allows the owner to set the grace period duration, which specifies how long the system will disallow
* liquidations after sequencer is back online. Only callable by the owner.
*
* @param _gracePeriod The new duration of the grace period
*/
function ownerSetGracePeriod(
uint256 _gracePeriod
)
external;
/**
* @return True if new borrows should be allowed, false otherwise
*/
function isBorrowAllowed() external view returns (bool);
/**
* @return True if liquidations should be allowed, false otherwise
*/
function isLiquidationAllowed() external view returns (bool);
/**
* @return The duration between when the feed comes back online and when the system will allow liquidations to be
* processed normally
*/
function gracePeriod() external view returns (uint256);
}