Skip to content

Commit

Permalink
feat: mockups/UsingWitPriceFeeds
Browse files Browse the repository at this point in the history
  • Loading branch information
guidiaz committed Aug 9, 2024
1 parent af252c3 commit 380d3eb
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 5 deletions.
28 changes: 28 additions & 0 deletions contracts/mockups/UsingWitPriceFeeds.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// SPDX-License-Identifier: MIT

pragma solidity >=0.7.0 <0.9.0;
pragma experimental ABIEncoderV2;

import "../WitPriceFeeds.sol";

/// @title The UsingWitPriceFeeds contract
/// @dev Contracts willing to interact with a WitPriceFeeds appliance, freshly updated by a third-party.
/// @author The Witnet Foundation.
abstract contract UsingWitPriceFeeds
is
IWitFeedsEvents,
IWitOracleEvents
{
WitPriceFeeds immutable public witPriceFeeds;

constructor(WitPriceFeeds _witPriceFeeds) {
require(
address(_witPriceFeeds).code.length > 0
&& _witPriceFeeds.specs() == type(WitPriceFeeds).interfaceId,
"UsingWitPriceFeeds: uncompliant WitPriceFeeds appliance"
);
witPriceFeeds = _witPriceFeeds;
}

receive() external payable virtual {}
}
10 changes: 5 additions & 5 deletions contracts/mockups/UsingWitRandomness.sol
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ abstract contract UsingWitRandomness
IWitOracleEvents,
IWitRandomnessEvents
{
WitRandomness immutable public witOracleRandomness;
WitRandomness immutable public witRandomness;

constructor(WitRandomness _witOracleRandomness) {
constructor(WitRandomness _witRandomness) {
require(
address(_witOracleRandomness).code.length > 0
&& _witOracleRandomness.specs() == type(WitRandomness).interfaceId,
address(_witRandomness).code.length > 0
&& _witRandomness.specs() == type(WitRandomness).interfaceId,
"UsingWitRandomness: uncompliant WitRandomness appliance"
);
witOracleRandomness = _witOracleRandomness;
witRandomness = _witRandomness;
}

receive() external payable virtual {}
Expand Down

0 comments on commit 380d3eb

Please sign in to comment.