From 2e21822854b3cddf17de3d038703b8bb3fac348c Mon Sep 17 00:00:00 2001 From: radar bear Date: Mon, 12 Aug 2024 21:05:56 -0400 Subject: [PATCH] use weth as default pay token --- src/oracle/ChainlinkDS.sol | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/oracle/ChainlinkDS.sol b/src/oracle/ChainlinkDS.sol index 3273734..909a79a 100644 --- a/src/oracle/ChainlinkDS.sol +++ b/src/oracle/ChainlinkDS.sol @@ -69,11 +69,9 @@ contract ChainlinkDSPortal is Ownable { // Verify the report bytes memory verifiedReportData = IVerifierProxy(dsVerifyProxy).verify( unverifiedReport, - abi.encode(address(this)) // todo need a token address here + abi.encode(0x4200000000000000000000000000000000000006) // todo need a token address here ); - // Decode verified report data into a Report struct - // If your report is a PremiumReport, you should decode it as a PremiumReport Report memory verifiedReport = abi.decode(verifiedReportData, (Report)); return verifiedReport; } @@ -167,7 +165,7 @@ contract ChainlinkDSPortal is Ownable { } // Get DS report price uint256 latestTimestamp; - require(DSReport.validFromTimestamp > 0 || feedUpdatedAt > 0); + require(DSReport.validFromTimestamp > 0 || feedUpdatedAt > 0, "NO_VALID_DATA"); if (DSReport.validFromTimestamp > feedUpdatedAt) { latestTimestamp = DSReport.validFromTimestamp; price = @@ -193,7 +191,8 @@ contract ChainlinkDSAdaptor { address portal; bytes32 key; - constructor(string memory tradingPairName) { + constructor(string memory tradingPairName, address _portal) { + portal = _portal; key = keccak256(abi.encodePacked(tradingPairName)); }