This repository has been archived by the owner on Mar 28, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add IntermediaryMedianizer for Ropsten
So that new system deployments don't require new contract authorizations on the Maker side, an intermediate medianizer has already been deployed to Ropsten for Maker to authorize. It is designed to have an updatable reference to the Maker medianizer, and pass through reads to that instance. The already-deployed address is added to the externals file, while the code is checked in to the price-feed directory, but not migrated as part of the system migrations.
- Loading branch information
1 parent
35393f9
commit 2f5a57c
Showing
4 changed files
with
48 additions
and
2 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
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 @@ | ||
pragma solidity 0.5.17; | ||
|
||
import "openzeppelin-solidity/contracts/ownership/Ownable.sol"; | ||
import "../external/IMedianizer.sol"; | ||
|
||
/// @title IntermediaryMedianizer is an updatable intermediary between a real | ||
/// medianizer and IMedianizer users. | ||
/// @dev This is used in Keep testnets where Maker has deployed a Medianizer | ||
/// instance that needs to authorize a single consumer, to enable multiple | ||
/// tBTC deployments to happen in the background and be pointed at a stable | ||
/// medianizer instance that is authorized on the Maker contract. It allows | ||
/// the updating of the backing medianizer and therefore is NOT suitable | ||
/// for mainnet deployment. | ||
contract IntermediaryMedianizer is Ownable, IMedianizer { | ||
IMedianizer private _realMedianizer; | ||
|
||
constructor(IMedianizer realMedianizer) public { | ||
_realMedianizer = realMedianizer; | ||
} | ||
|
||
function getMedianizer() external view returns (IMedianizer) { | ||
return _realMedianizer; | ||
} | ||
|
||
function peek() external view returns (uint256, bool) { | ||
return _realMedianizer.peek(); | ||
} | ||
|
||
function read() external view returns (uint256) { | ||
return _realMedianizer.read(); | ||
} | ||
|
||
function setMedianizer(IMedianizer realMedianizer) public onlyOwner { | ||
_realMedianizer = realMedianizer; | ||
} | ||
} |
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
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