Skip to content

Commit 94497ee

Browse files
committed
zkEVM - fix Cordona chainID
2 parents 97b0b87 + 8ad23f6 commit 94497ee

File tree

30 files changed

+243
-58
lines changed

30 files changed

+243
-58
lines changed
212 KB
Loading

docs/tools/oracles/pyth.md

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
## Overview
2+
3+
The [Pyth network](https://pyth.network/) is the largest first-party financial oracle network, delivering real-time market data to over 40 blockchains securely and transparently.
4+
5+
The network comprises some of the world’s largest exchanges, market makers, and financial services providers; publishing proprietary price-data on-chain for aggregation and distribution to smart contract applications.
6+
7+
## Using Pyth network
8+
9+
The Pyth network introduces an innovative low-latency [pull oracle design](https://docs.pyth.network/documentation/pythnet-price-feeds/on-demand), where users can pull price updates on-chain when needed, enabling everyone in the blockchain environment to access that data point.
10+
11+
Developers on Polygon have permissionless access to any of Pyth’s 350+ price feeds for equities, ETFs, commodities, foreign exchange pairs, and cryptocurrencies.
12+
13+
Here is a working example of a contract that fetches the latest price of MATIC/USD on the Polygon network.
14+
You have to pass [Pyth's contract address](https://docs.pyth.network/price-feeds/contract-addresses/evm) for Polygon mainnet/testnet and the desired [price feed id](https://pyth.network/developers/price-feed-ids) to fetch the latest price.
15+
16+
```solidity
17+
// SPDX-License-Identifier: UNLICENSED
18+
pragma solidity ^0.8.13;
19+
20+
import "@pythnetwork/pyth-sdk-solidity/IPyth.sol";
21+
22+
contract MyFirstPythContract {
23+
IPyth pyth;
24+
25+
constructor(address _pyth) {
26+
pyth = IPyth(_pyth);
27+
}
28+
29+
function fetchPrice(
30+
bytes[] calldata pythPriceUpdate,
31+
bytes32 priceFeed
32+
) public payable returns (int64) {
33+
uint updateFee = pyth.getUpdateFee(pythPriceUpdate);
34+
pyth.updatePriceFeeds{value: updateFee}(pythPriceUpdate);
35+
36+
// Fetch the latest price
37+
PythStructs.Price memory price = pyth.getPrice(priceFeed);
38+
return price.price;
39+
}
40+
}
41+
42+
```
43+
44+
Here you can fetch the `updateData` from our [`Hermes` feed](https://docs.pyth.network/price-feeds/pythnet-price-feeds/hermes), which listens to Pythnet and Wormhole for price updates; or you can use the [`pyth-evm-js`](https://github.com/pyth-network/pyth-crosschain/blob/main/target_chains/ethereum/sdk/js/src/EvmPriceServiceConnection.ts#L15) SDK.
45+
46+
47+
This [package](https://github.com/pyth-network/pyth-crosschain/tree/main/target_chains/ethereum/sdk/solidity) provides utilities for consuming prices from the Pyth network oracle using Solidity. Also, it contains the [Pyth Interface ABI](https://github.com/pyth-network/pyth-crosschain/blob/main/target_chains/ethereum/sdk/solidity/abis/IPyth.json) that you can use in your libraries to communicate with the Pyth contract.
48+
49+
We recommend following the [consumer best practices](https://docs.pyth.network/documentation/pythnet-price-feeds/best-practices) when consuming Pyth data.
50+
51+
For more information, check out the official [Pyth documentation](https://docs.pyth.network/price-feeds). There are details on the various functions available for interacting with the Pyth smart contract in the [API Reference section](https://docs.pyth.network/price-feeds/api-reference/evm).
52+
53+
## Pyth on Polygon
54+
55+
The Pyth Network smart contract is available at the following address:
56+
57+
- Mainnet: [0xff1a0f4744e8582DF1aE09D5611b887B6a12925C](https://polygonscan.com/address/0xff1a0f4744e8582df1ae09d5611b887b6a12925c).
58+
- Amoy: [0x2880aB155794e7179c9eE2e38200202908C17B43](https://www.oklink.com/amoy/address/0x2880ab155794e7179c9ee2e38200202908c17b43)
59+
60+
Additionally, click to access the [Pyth price-feed IDs](https://pyth.network/developers/price-feed-ids).
61+
62+
## Developers and community
63+
64+
The Pyth network provides additional tools to developers, such as [TradingView Integration](https://docs.pyth.network/guides/how-to-create-tradingview-charts), or the [Gelato web3 functions](https://docs.pyth.network/guides/how-to-schedule-price-updates-with-gelato).
65+
66+
If you have any questions or issues, contact us on the following platforms:
67+
68+
- [Telegram](https://t.me/Pyth_Network)
69+
- [Discord](https://discord.gg/invite/PythNetwork)
70+
- [Website](https://pyth.network/contact)

docs/tools/wallets/torus.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
!!! caution "Content disclaimer"
2-
Please view the third-party content disclaimer [here](https://github.com/0xPolygon/polygon-docs/blob/main/CONTENT_DISCLAIMER.md).
2+
Please view the third-party content disclaimer [here](https://github.com/0xPolygon/polygon-docs/blob/main/CONTENT_DISCLAIMER.md)
33

44
Torus is a user-friendly, secure, and non-custodial key management system for decentralized apps. We're focused on providing mainstream users a gateway to the decentralized ecosystem.
55

docs/zkEVM/architecture/effective-gas/implement-egp-strat.md

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,10 @@ The following parameters can be configured in the Polygon zkEVM node:
3434
- $\texttt{PollMinAllowedGasPriceInterval}$ is the interval to poll L1 in order to find the suggested L2 minimum gas price.
3535
- $\texttt{IntervalToRefreshGasPrices}$ is the interval to refresh L2 gas prices.
3636

37-
More specifically, these are configured in the $\texttt{[Pool]}$ section of the configuration file found [here](https://github.com/0xPolygonHermez/zkevm-node/blob/b938572f138ba6cc40ef6736153c469afeb11c96/config/default.go#L37).
38-
37+
More specifically, these are configured in the $\texttt{[Pool]}$ section of the [configuration file](https://github.com/0xPolygonHermez/zkevm-node/blob/b938572f138ba6cc40ef6736153c469afeb11c96/config/default.go#L37).
3938

4039
![Figure: ](../../../img/zkEVM/config-prev-parameter.png)
4140

42-
43-
44-
45-
4641
## How to avoid incurring losses in L2
4742

4843
There are three measures put in place to help avoid incurring gas price-induced losses in the L2 network:
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
!!! warning
2+
Coming soon.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
!!! warning
2+
Coming soon.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
!!! warning
2+
Coming soon.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
!!! warning
2+
Coming soon.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
!!! warning
2+
Coming soon.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
!!! warning
2+
Coming soon.

0 commit comments

Comments
 (0)