Skip to content

Commit

Permalink
chris format & licence update
Browse files Browse the repository at this point in the history
Signed-off-by: chrismaree <christopher.maree@gmail.com>
  • Loading branch information
chrismaree committed May 16, 2024
1 parent 97d60b0 commit bdfce05
Show file tree
Hide file tree
Showing 26 changed files with 16 additions and 33 deletions.
1 change: 0 additions & 1 deletion src/DiamondRootOval.sol
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import {IOval} from "./interfaces/IOval.sol";
* need. They are exposed here to simplify the inheritance structure of Oval contract system and to enable easier
* composability and extensibility at the integration layer, enabling arbitrary combinations of sources and destinations.
*/

abstract contract DiamondRootOval is IBaseController, IOval, IBaseOracleAdapter {
/**
* @notice Returns the latest data from the source.
Expand Down
1 change: 0 additions & 1 deletion src/Oval.sol
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import {DiamondRootOval} from "./DiamondRootOval.sol";
* contract that governs who can call unlockLatestValue.
* @custom:security-contact bugs@umaproject.org
*/

abstract contract Oval is DiamondRootOval {
uint256 public lastUnlockTime; // Timestamp of the latest unlock to Oval.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import {DiamondRootOval} from "../../DiamondRootOval.sol";
* implementation that consumers can connect with if they don't want to use an opinionated destination Adapter.
*
*/

abstract contract BaseDestinationAdapter is DiamondRootOval {
uint8 public constant decimals = 18;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import {DiamondRootOval} from "../../DiamondRootOval.sol";
/**
* @title ChainlinkDestinationAdapter contract to expose Oval data via the standard Chainlink Aggregator interface.
*/

abstract contract ChainlinkDestinationAdapter is DiamondRootOval, IAggregatorV3 {
uint8 public immutable override decimals;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SPDX-License-Identifier: AGPL-3.0-only
// SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.8.17;

import {IMedian} from "../../interfaces/chronicle/IMedian.sol";
Expand All @@ -7,7 +7,6 @@ import {DiamondRootOval} from "../../DiamondRootOval.sol";
/**
* @notice ChronicleMedianDestinationAdapter contract to expose Oval data via the standard Chronicle interface.
*/

abstract contract ChronicleMedianDestinationAdapter is IMedian, DiamondRootOval {
constructor(address _sourceAdapter) {}

Expand Down
3 changes: 1 addition & 2 deletions src/adapters/destination-adapters/OSMDestinationAdapter.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SPDX-License-Identifier: AGPL-3.0-only
// SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.8.17;

import {IOSM} from "../../interfaces/makerdao/IOSM.sol";
Expand All @@ -7,7 +7,6 @@ import {DiamondRootOval} from "../../DiamondRootOval.sol";
/**
* @title OSMDestinationAdapter contract to expose Oval data via the standard MakerDAO OSM interface.
*/

abstract contract OSMDestinationAdapter is IOSM, DiamondRootOval {
constructor() {}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SPDX-License-Identifier: AGPL-3.0-only
// SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.8.17;

import {Ownable} from "openzeppelin-contracts/contracts/access/Ownable.sol";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import {IOval} from "../../interfaces/IOval.sol";
* that it uses to return the correct price for each cToken. This is needed as the UniswapAnchoredView interface is a
* one to many relationship with cTokens, and so we need to be able to return the correct price for each cToken.
*/

contract UniswapAnchoredViewDestinationAdapter is Ownable, IUniswapAnchoredView {
mapping(address => address) public cTokenToOval;
mapping(address => uint8) public cTokenToDecimal;
Expand Down
3 changes: 1 addition & 2 deletions src/adapters/source-adapters/BoundedUnionSourceAdapter.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SPDX-License-Identifier: AGPL-3.0-only
// SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.8.17;

import {SignedMath} from "openzeppelin-contracts/contracts/utils/math/SignedMath.sol";
Expand All @@ -20,7 +20,6 @@ import {SnapshotSource} from "./SnapshotSource.sol";
* @dev This adapter only works with Chainlink, Chronicle and Pyth adapters. If alternative adapter configs are desired
* then a new adapter should be created.
*/

abstract contract BoundedUnionSourceAdapter is
ChainlinkSourceAdapter,
ChronicleMedianSourceAdapter,
Expand Down
1 change: 0 additions & 1 deletion src/adapters/source-adapters/ChainlinkSourceAdapter.sol
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import {DiamondRootOval} from "../../DiamondRootOval.sol";
* @title ChainlinkSourceAdapter contract to read data from Chainlink aggregator and standardize it for Oval.
* @dev Can fetch information from Chainlink source at a desired timestamp for historic lookups.
*/

abstract contract ChainlinkSourceAdapter is DiamondRootOval {
IAggregatorV3Source public immutable CHAINLINK_SOURCE;
uint8 private immutable SOURCE_DECIMALS;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SPDX-License-Identifier: AGPL-3.0-only
// SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.8.17;

import {SnapshotSource} from "./SnapshotSource.sol";
Expand All @@ -8,7 +8,6 @@ import {SafeCast} from "openzeppelin-contracts/contracts/utils/math/SafeCast.sol
/**
* @title ChronicleMedianSourceAdapter contract to read data from Chronicle and standardize it for Oval.
*/

abstract contract ChronicleMedianSourceAdapter is SnapshotSource {
IMedian public immutable CHRONICLE_SOURCE;

Expand Down
3 changes: 1 addition & 2 deletions src/adapters/source-adapters/OSMSourceAdapter.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SPDX-License-Identifier: AGPL-3.0-only
// SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.8.17;

import {SnapshotSource} from "./SnapshotSource.sol";
Expand All @@ -7,7 +7,6 @@ import {IOSM} from "../../interfaces/makerdao/IOSM.sol";
/**
* @title OSMSourceAdapter contract to read data from MakerDAO OSM and standardize it for Oval.
*/

abstract contract OSMSourceAdapter is SnapshotSource {
IOSM public immutable osmSource;

Expand Down
3 changes: 1 addition & 2 deletions src/adapters/source-adapters/PythSourceAdapter.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SPDX-License-Identifier: AGPL-3.0-only
// SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.8.17;

import {IPyth} from "../../interfaces/pyth/IPyth.sol";
Expand All @@ -8,7 +8,6 @@ import {DecimalLib} from "../lib/DecimalLib.sol";
/**
* @title PythSourceAdapter contract to read data from Pyth and standardize it for Oval.
*/

abstract contract PythSourceAdapter is SnapshotSource {
IPyth public immutable PYTH_SOURCE;
bytes32 public immutable PYTH_PRICE_ID;
Expand Down
1 change: 0 additions & 1 deletion src/adapters/source-adapters/SnapshotSource.sol
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import {DiamondRootOval} from "../../DiamondRootOval.sol";
/**
* @title SnapshotSource contract to be used in conjunction with a source adapter that needs to snapshot historic data.
*/

abstract contract SnapshotSource is DiamondRootOval {
// Snapshot records the historical answer at a specific timestamp.
struct Snapshot {
Expand Down
3 changes: 1 addition & 2 deletions src/adapters/source-adapters/UnionSourceAdapter.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SPDX-License-Identifier: AGPL-3.0-only
// SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.8.17;

import {IAggregatorV3Source} from "../../interfaces/chainlink/IAggregatorV3Source.sol";
Expand All @@ -14,7 +14,6 @@ import {SnapshotSource} from "./SnapshotSource.sol";
* @dev This adapter only works with Chainlink, Chronicle and Pyth adapters. If alternative adapter configs are desired
* then a new adapter should be created.
*/

abstract contract UnionSourceAdapter is ChainlinkSourceAdapter, ChronicleMedianSourceAdapter, PythSourceAdapter {
constructor(IAggregatorV3Source chainlink, IMedian chronicle, IPyth pyth, bytes32 pythPriceId)
ChainlinkSourceAdapter(chainlink)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import {IValidatorProxy} from "../../interfaces/compound/IValidatorProxy.sol";
* @title UniswapAnchoredViewSourceAdapter contract to read data from UniswapAnchoredView and standardize it for Oval.
*
*/

abstract contract UniswapAnchoredViewSourceAdapter is SnapshotSource {
IUniswapAnchoredView public immutable UNISWAP_ANCHORED_VIEW;
address public immutable C_TOKEN;
Expand Down
1 change: 0 additions & 1 deletion src/controllers/BaseController.sol
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import {Oval} from "../Oval.sol";
* @title BaseController providing the simplest possible controller logic to govern who can unlock Oval.
* @dev Custom Controllers can be created to provide more granular control over who can unlock Oval.
*/

abstract contract BaseController is Ownable, Oval {
// these don't need to be public since they can be accessed via the accessor functions below.
uint256 private lockWindow_ = 60; // The lockWindow in seconds.
Expand Down
1 change: 0 additions & 1 deletion src/controllers/ImmutableController.sol
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import {Oval} from "../Oval.sol";
* 2. Because LOCK_WINDOW and MAX_TRAVERSAL are immutable, the read costs are much lower in the "hot" path (end
* oracle users).
*/

abstract contract ImmutableController is Oval {
uint256 private immutable LOCK_WINDOW; // The lockWindow in seconds.
uint256 private immutable MAX_TRAVERSAL; // The maximum number of rounds to traverse when looking for historical data.
Expand Down
2 changes: 1 addition & 1 deletion test/fork/adapters/ChronicleMedianSourceAdapter.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SPDX-License-Identifier: AGPL-3.0-only
// SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.8.17;

import {CommonTest} from "../../Common.sol";
Expand Down
2 changes: 1 addition & 1 deletion test/fork/adapters/OSMSourceAdapter.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SPDX-License-Identifier: AGPL-3.0-only
// SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.8.17;

import {CommonTest} from "../../Common.sol";
Expand Down
2 changes: 1 addition & 1 deletion test/fork/adapters/PythSourceAdapter.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SPDX-License-Identifier: AGPL-3.0-only
// SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.8.17;

import {CommonTest} from "../../Common.sol";
Expand Down
2 changes: 1 addition & 1 deletion test/fork/adapters/UnionSourceAdapter.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SPDX-License-Identifier: AGPL-3.0-only
// SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.8.17;

import {CommonTest} from "../../Common.sol";
Expand Down
2 changes: 1 addition & 1 deletion test/unit/Oval.ChronicleMedianDestinationAdapter.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SPDX-License-Identifier: AGPL-3.0-only
// SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.8.17;

import {Oval} from "../../src/Oval.sol";
Expand Down
2 changes: 1 addition & 1 deletion test/unit/Oval.OSMDestinationAdapter.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SPDX-License-Identifier: AGPL-3.0-only
// SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.8.17;

import {Oval} from "../../src/Oval.sol";
Expand Down
2 changes: 1 addition & 1 deletion test/unit/Oval.PythDestinationAdapter.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SPDX-License-Identifier: AGPL-3.0-only
// SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.8.17;

import {Oval} from "../../src/Oval.sol";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SPDX-License-Identifier: AGPL-3.0-only-only
// SPDX-License-Identifier: BUSL-1.1-only
pragma solidity 0.8.17;

import {IAggregatorV3Source} from "../../../src/interfaces/chainlink/IAggregatorV3Source.sol";
Expand Down

0 comments on commit bdfce05

Please sign in to comment.