Skip to content

Commit

Permalink
Update FraxEthDualOracle contract address and ABI. (#3142)
Browse files Browse the repository at this point in the history
  • Loading branch information
alecgard authored Jan 11, 2024
1 parent aa1a0b6 commit 0734e09
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 36 deletions.
5 changes: 5 additions & 0 deletions .changeset/ninety-paws-jump.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@chainlink/frxeth-exchange-rate-adapter': minor
---

Update FraxEthDualOracle contract address and ABI.
2 changes: 1 addition & 1 deletion packages/sources/frxeth-exchange-rate/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ This document was generated automatically. Please see [README Generator](../../s
| :-------: | :---------------------: | :-----------------------------------------------------------------------------------------------: | :----: | :-----: | :------------------------------------------: |
|| RPC_URL | The RPC URL to connect to the EVM chain | string | | |
|| CHAIN_ID | The chain id to connect to | number | | `1` |
|| FRAX_ETH_PRICE_CONTRACT | The address of the deployed Frax Dual Oracle Price Logic contract | string | | `0xb12c19c838499e3447afd9e59274b1be56b1546a` |
|| FRAX_ETH_PRICE_CONTRACT | The address of the deployed Frax Dual Oracle Price Logic contract | string | | `0x350a9841956D8B0212EAdF5E14a449CA85FAE1C0` |
| | BACKGROUND_EXECUTE_MS | The number of milliseconds the background execute should sleep before performing the next request | number | | `1000` |

---
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@
}
],
"internalType": "struct ConstructorParams",
"name": "params",
"name": "_params",
"type": "tuple"
}
],
Expand Down Expand Up @@ -578,7 +578,7 @@
"inputs": [
{
"internalType": "contract IPriceSourceReceiver",
"name": "fraxOracle",
"name": "_fraxOracle",
"type": "address"
}
],
Expand All @@ -591,50 +591,50 @@
"inputs": [
{
"internalType": "uint256",
"name": "ethPerFrxEthCurveEma",
"name": "_ethPerFrxEthCurveEma",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "fraxPerFrxEthTwap",
"name": "_fraxPerFrxEthTwap",
"type": "uint256"
},
{
"internalType": "bool",
"name": "isBadDataEthUsdChainlink",
"name": "_isBadDataEthUsdChainlink",
"type": "bool"
},
{
"internalType": "uint256",
"name": "usdPerEthChainlink",
"name": "_usdPerEthChainlink",
"type": "uint256"
},
{
"internalType": "bool",
"name": "isBadDataFraxUsdChainlink",
"name": "_isBadDataFraxUsdChainlink",
"type": "bool"
},
{
"internalType": "uint256",
"name": "usdPerFraxChainlink",
"name": "_usdPerFraxChainlink",
"type": "uint256"
}
],
"name": "calculatePrices",
"outputs": [
{
"internalType": "bool",
"name": "isBadData",
"name": "_isBadData",
"type": "bool"
},
{
"internalType": "uint256",
"name": "priceLow",
"name": "_priceLow",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "priceHigh",
"name": "_priceHigh",
"type": "uint256"
}
],
Expand All @@ -660,12 +660,12 @@
"outputs": [
{
"internalType": "bool",
"name": "isBadData",
"name": "_isBadData",
"type": "bool"
},
{
"internalType": "uint256",
"name": "usdPerFrax",
"name": "_usdPerFrax",
"type": "uint256"
}
],
Expand All @@ -678,7 +678,7 @@
"outputs": [
{
"internalType": "uint256",
"name": "ethPerFrxEth",
"name": "_ethPerFrxEth",
"type": "uint256"
}
],
Expand Down Expand Up @@ -750,17 +750,17 @@
"outputs": [
{
"internalType": "bool",
"name": "isBadData",
"name": "_isBadData",
"type": "bool"
},
{
"internalType": "uint256",
"name": "priceLow",
"name": "_priceLow",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "priceHigh",
"name": "_priceHigh",
"type": "uint256"
}
],
Expand All @@ -773,17 +773,17 @@
"outputs": [
{
"internalType": "bool",
"name": "isBadDataNormal",
"name": "_isBadDataNormal",
"type": "bool"
},
{
"internalType": "uint256",
"name": "priceLowNormal",
"name": "_priceLowNormal",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "priceHighNormal",
"name": "_priceHighNormal",
"type": "uint256"
}
],
Expand All @@ -809,12 +809,12 @@
"outputs": [
{
"internalType": "bool",
"name": "isBadData",
"name": "_isBadData",
"type": "bool"
},
{
"internalType": "uint256",
"name": "usdPerEth",
"name": "_usdPerEth",
"type": "uint256"
}
],
Expand Down Expand Up @@ -883,7 +883,7 @@
"type": "string"
}
],
"stateMutability": "view",
"stateMutability": "pure",
"type": "function"
},
{
Expand All @@ -910,7 +910,7 @@
"inputs": [
{
"internalType": "uint256",
"name": "maximumPrice",
"name": "_maximumPrice",
"type": "uint256"
}
],
Expand All @@ -923,7 +923,7 @@
"inputs": [
{
"internalType": "uint256",
"name": "newMaxOracleDelay",
"name": "_newMaxOracleDelay",
"type": "uint256"
}
],
Expand All @@ -936,7 +936,7 @@
"inputs": [
{
"internalType": "uint256",
"name": "newMaxOracleDelay",
"name": "_newMaxOracleDelay",
"type": "uint256"
}
],
Expand All @@ -949,7 +949,7 @@
"inputs": [
{
"internalType": "uint256",
"name": "minimumPrice",
"name": "_minimumPrice",
"type": "uint256"
}
],
Expand All @@ -962,7 +962,7 @@
"inputs": [
{
"internalType": "uint32",
"name": "newTwapDuration",
"name": "_newTwapDuration",
"type": "uint32"
}
],
Expand Down
2 changes: 1 addition & 1 deletion packages/sources/frxeth-exchange-rate/src/config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export const config = new AdapterConfig({
description: 'The address of the deployed Frax Dual Oracle Price Logic contract',
type: 'string',
required: true,
default: '0xb12c19c838499e3447afd9e59274b1be56b1546a',
default: '0x350a9841956D8B0212EAdF5E14a449CA85FAE1C0',
},
BACKGROUND_EXECUTE_MS: {
description:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import { TimestampedAdapterResponse, sleep } from '@chainlink/external-adapter-f
type ExchangeRateTransportTypes = BaseEndpointTypes
type RequestParams = typeof inputParameters.validated
type GetPricesResponse = {
isBadData: boolean
priceLow: BigNumber
priceHigh: BigNumber
_isBadData: boolean
_priceLow: BigNumber
_priceHigh: BigNumber
}

class ExchangeRateTransport extends SubscriptionTransport<ExchangeRateTransportTypes> {
Expand Down Expand Up @@ -53,11 +53,12 @@ class ExchangeRateTransport extends SubscriptionTransport<ExchangeRateTransportT
provider,
)

const { isBadData, priceLow, priceHigh } = (await fraxEthPrice.getPrices()) as GetPricesResponse
const { _isBadData, _priceLow, _priceHigh } =
(await fraxEthPrice.getPrices()) as GetPricesResponse

let response: TimestampedAdapterResponse

if (isBadData != false) {
if (_isBadData != false) {
response = {
statusCode: 502,
errorMessage: 'Contract is reporting stale or bad data for getPrices.',
Expand All @@ -68,7 +69,7 @@ class ExchangeRateTransport extends SubscriptionTransport<ExchangeRateTransportT
},
}
} else {
const price = param.priceType.toUpperCase() == 'HIGH' ? priceHigh : priceLow
const price = param.priceType.toUpperCase() == 'HIGH' ? _priceHigh : _priceLow
response = {
data: {
result: price.toString(),
Expand Down

0 comments on commit 0734e09

Please sign in to comment.