Skip to content

Commit 1d95ea1

Browse files
authored
Merge pull request #21 from api3dao/renovate/other-minor-updates
Update other minor updates
2 parents 56b9676 + ed939b1 commit 1d95ea1

File tree

4 files changed

+323
-252
lines changed

4 files changed

+323
-252
lines changed

.prettierrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
{
1616
"files": "*.sol",
1717
"options": {
18-
"parser": "antlr",
18+
"parser": "slang",
1919
"printWidth": 80,
2020
"tabWidth": 4,
2121
"useTabs": false,

README.md

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,6 @@ The `NETWORK` variable should be set to a chain name as defined by `@api3/contra
9595
**Required Environment Variables per Contract:**
9696

9797
- **`InverseApi3ReaderProxyV1`**:
98-
9998
- `NETWORK`: Target network name.
10099
- `PROXY`: Address of the underlying `IApi3ReaderProxy` contract (e.g., an ETH/USD dAPI proxy).
101100
- Example:
@@ -104,7 +103,6 @@ The `NETWORK` variable should be set to a chain name as defined by `@api3/contra
104103
```
105104

106105
- **`NormalizedApi3ReaderProxyV1`**:
107-
108106
- `NETWORK`: Target network name.
109107
- `FEED`: Address of the external data feed (e.g., a Chainlink `AggregatorV2V3Interface` compatible feed).
110108
- Example:
@@ -113,7 +111,6 @@ The `NETWORK` variable should be set to a chain name as defined by `@api3/contra
113111
```
114112

115113
- **`ProductApi3ReaderProxyV1`**:
116-
117114
- `NETWORK`: Target network name.
118115
- `PROXY1`: Address of the first `IApi3ReaderProxy` contract.
119116
- `PROXY2`: Address of the second `IApi3ReaderProxy` contract.
@@ -123,7 +120,6 @@ The `NETWORK` variable should be set to a chain name as defined by `@api3/contra
123120
```
124121

125122
- **`ScaledApi3FeedProxyV1`**:
126-
127123
- `NETWORK`: Target network name.
128124
- `PROXY`: Address of the underlying `IApi3ReaderProxy` contract.
129125
- `DECIMALS`: The desired number of decimals for the scaled output.
@@ -133,7 +129,6 @@ The `NETWORK` variable should be set to a chain name as defined by `@api3/contra
133129
```
134130

135131
- **`PriceCappedApi3ReaderProxyV1`**:
136-
137132
- `NETWORK`: Target network name.
138133
- `PROXY`: Address of the underlying `IApi3ReaderProxy` contract.
139134
- `LOWER_BOUND`: The minimum price (inclusive) this proxy will report, as a full integer string (e.g., `"990000000000000000"` for $0.99 with 18 decimals). **Optional: Defaults to `"0"` if not provided (effectively setting only an upper bound).**
@@ -180,13 +175,11 @@ Below are some common scenarios illustrating how you can combine these proxies:
180175
Imagine your dApp requires a USD/ETH price feed with 8 decimal places, but the available Api3 dAPI provides ETH/USD with 18 decimals.
181176
182177
1. **Deploy `InverseApi3ReaderProxyV1`**:
183-
184178
- Input `PROXY`: Address of the ETH/USD `IApi3ReaderProxy` dAPI.
185179
- Output: An `IApi3ReaderProxy` contract. This deployed instance of `InverseApi3ReaderProxyV1` reads USD/ETH.
186180
- Example command: `NETWORK=your_network PROXY=0xAddressOfEthUsdDapi pnpm deploy:InverseApi3ReaderProxyV1`
187181
188182
2. **Deploy `ScaledApi3FeedProxyV1`**:
189-
190183
- Input `PROXY`: Address of the `InverseApi3ReaderProxyV1` instance deployed in step 1.
191184
- Input `DECIMALS`: `8`.
192185
- Output: An `AggregatorV2V3Interface` contract. This deployed instance of `ScaledApi3FeedProxyV1` reads USD/ETH scaled to 8 decimals.
@@ -205,12 +198,10 @@ Suppose your dApp needs an `stETH/USD` price feed. This specific feed might not
205198
To achieve this, you would:
206199
207200
1. **Create and Deploy a Custom `IApi3ReaderProxy` for `stETH/wstETH`**:
208-
209201
- Since the `wstETH` contract's `stEthPerToken()` function doesn't directly implement the `IApi3ReaderProxy` interface, you'd first deploy a simple wrapper contract. This wrapper (let's call it `WstETHApi3ReaderProxyV1`) would call `stEthPerToken()` and expose the result (`stETH` amount for 1 `wstETH` with 18 decimals) and the current block timestamp via the `read()` method of `IApi3ReaderProxy`.
210202
_Note: An example of such a deployed custom proxy is `WstETHApi3ReaderProxyV1` at `0x3EA363B8CE16A26BFF70484883587DcF7E53C27d` on Ethereum mainnet. The development of this custom wrapper is outside the scope of the data-feed-proxy-combinators repository but illustrates how any data source can be adapted to be `IApi3ReaderProxy` compatible._
211203
212204
2. **Deploy `ProductApi3ReaderProxyV1` to calculate `stETH/USD`**:
213-
214205
- This step multiplies the `stETH/wstETH` rate (from your custom proxy) by the `wstETH/USD` rate (from the Api3 dAPI).
215206
- Input `PROXY1`: Address of `WstETHApi3ReaderProxyV1` (e.g., `0x3EA363B8CE16A26BFF70484883587DcF7E53C27d` on Ethereum mainnet).
216207
- Input `PROXY2`: Address of the Api3 `wstETH/USD` dAPI proxy (e.g., `0x37422cC8e1487a0452cc0D0BF75877d86c63c88A` on Ethereum mainnet).
@@ -230,7 +221,6 @@ Suppose your dApp needs a price for a less common asset, like "UnsupportedStaked
230221
To derive the desired uStETH/USD feed and make it compatible with the Api3 ecosystem, you can combine these feeds:
231222
232223
1. **Deploy `NormalizedApi3ReaderProxyV1`**:
233-
234224
- This step adapts the external uStETH/ETH feed, which implements the `AggregatorV2V3Interface`, to the `IApi3ReaderProxy` interface. A key function of `NormalizedApi3ReaderProxyV1` is to read the `decimals()` from the external feed and automatically scale its value to the 18 decimal places expected by the `IApi3ReaderProxy` interface. For instance, if the uStETH/ETH feed returns its value with a different precision (e.g., 8 or 36 decimals), this proxy will normalize it.
235225
- Input `FEED`: Address of the external uStETH/ETH `AggregatorV2V3Interface` feed.
236226
- Output: An `IApi3ReaderProxy` contract. This deployed instance of `NormalizedApi3ReaderProxyV1` reads uStETH/ETH, with its value normalized to 18 decimals.

package.json

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -40,31 +40,31 @@
4040
"devDependencies": {
4141
"@api3/contracts": "^25.0.0",
4242
"@api3/eslint-plugin-commons": "^3.0.0",
43-
"@eslint/js": "^9.28.0",
44-
"@nomicfoundation/hardhat-ethers": "^3.0.8",
45-
"@nomicfoundation/hardhat-network-helpers": "^1.0.12",
43+
"@eslint/js": "^9.30.0",
44+
"@nomicfoundation/hardhat-ethers": "^3.0.9",
45+
"@nomicfoundation/hardhat-network-helpers": "^1.0.13",
4646
"@nomicfoundation/hardhat-toolbox": "^5.0.0",
4747
"@nomicfoundation/hardhat-verify": "^2.0.14",
4848
"@types/chai": "^4.3.20",
4949
"@types/mocha": "^10.0.10",
50-
"@types/node": "^22.15.29",
50+
"@types/node": "^22.15.34",
5151
"@typescript-eslint/eslint-plugin": "^7.18.0",
5252
"@typescript-eslint/parser": "^7.18.0",
5353
"chai": "^4.5.0",
54-
"dotenv": "^17.0.0",
54+
"dotenv": "^17.0.1",
5555
"eslint": "8.57.1",
56-
"ethers": "^6.14.3",
57-
"glob": "^11.0.2",
58-
"hardhat": "^2.24.1",
59-
"hardhat-deploy": "^1.0.2",
60-
"prettier": "^3.5.3",
56+
"ethers": "^6.14.4",
57+
"glob": "^11.0.3",
58+
"hardhat": "^2.25.0",
59+
"hardhat-deploy": "^1.0.4",
60+
"prettier": "^3.6.2",
6161
"prettier-plugin-solidity": "^2.0.0",
62-
"solhint": "^5.1.0",
62+
"solhint": "^5.2.0",
6363
"solidity-coverage": "^0.8.16",
6464
"ts-node": "^10.9.2",
6565
"typechain": "^8.3.2",
6666
"typescript": "^5.8.3",
67-
"typescript-eslint": "^8.33.0"
67+
"typescript-eslint": "^8.35.1"
6868
},
6969
"packageManager": "[email protected]"
7070
}

0 commit comments

Comments
 (0)