Skip to content

Commit 1f9c548

Browse files
authored
Merge pull request #9532 from Dom-Mac/uniswap-dead-links
Uniswap dead links
2 parents 52ace65 + 560ad3f commit 1f9c548

File tree

11 files changed

+23
-23
lines changed
  • src/content
    • developers
    • translations
      • fr/developers/tutorials/uniswap-v2-annotated-code
      • id/developers/tutorials/uniswap-v2-annotated-code
      • it/developers
        • docs/smart-contracts/security
        • tutorials/uniswap-v2-annotated-code
      • ja/developers/docs/smart-contracts/security
      • ro/developers/tutorials/uniswap-v2-annotated-code
      • tr/developers/tutorials/uniswap-v2-annotated-code
      • zh/developers/tutorials/uniswap-v2-annotated-code

11 files changed

+23
-23
lines changed

src/content/developers/docs/oracles/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ The following are common use-cases for oracles in Ethereum:
318318

319319
If you plan to build a DeFi lending protocol, for example, you’ll need to query current market prices for assets (e.g., ETH) deposited as collateral. This is so your smart contract can determine the value of collateral assets and determine how much they can borrow from the system.
320320

321-
Popular “price oracles” (as they are often called) in DeFi include Chainlink Price Feeds, Compound Protocol’s [Open Price Feed](https://compound.finance/docs/prices), Uniswap’s [Time-Weighted Average Prices (TWAPs)](https://docs.uniswap.org/protocol/V2/concepts/core-concepts/oracles), and [Maker Oracles](https://docs.makerdao.com/smart-contract-modules/oracle-module). It is advisable to understand the caveats that come with these price oracles before integrating them into your project. This [article](https://blog.openzeppelin.com/secure-smart-contract-guidelines-the-dangers-of-price-oracles/) provides a detailed analysis of what to consider when planning to use any of the price oracles mentioned.
321+
Popular “price oracles” (as they are often called) in DeFi include Chainlink Price Feeds, Compound Protocol’s [Open Price Feed](https://compound.finance/docs/prices), Uniswap’s [Time-Weighted Average Prices (TWAPs)](https://docs.uniswap.org/contracts/v2/concepts/core-concepts/oracles), and [Maker Oracles](https://docs.makerdao.com/smart-contract-modules/oracle-module). It is advisable to understand the caveats that come with these price oracles before integrating them into your project. This [article](https://blog.openzeppelin.com/secure-smart-contract-guidelines-the-dangers-of-price-oracles/) provides a detailed analysis of what to consider when planning to use any of the price oracles mentioned.
322322

323323
Below is an example of how you can retrieve the latest ETH price in your smart contract using a Chainlink price feed:
324324

src/content/developers/docs/smart-contracts/security/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,7 @@ For instance, an attacker could artificially pump the spot price of an asset by
450450

451451
The minimum requirement to avoid oracle manipulation is to use a decentralized oracle network that queries information from multiple sources to avoid single points of failure. In most cases, decentralized oracles have built-in cryptoeconomic incentives to encourage oracle nodes to report correct information, making them more secure than centralized oracles.
452452

453-
If you plan on querying an on-chain oracle for asset prices, consider using one that implements a time-weighted average price (TWAP) mechanism. A [TWAP oracle](https://docs.uniswap.org/protocol/V2/concepts/core-concepts/oracles) queries the price of an asset at two different points in time (which you can modify) and calculates the spot price based on the average obtained. Choosing longer time periods protects your protocol against price manipulation since large orders executed recently cannot impact asset prices.
453+
If you plan on querying an on-chain oracle for asset prices, consider using one that implements a time-weighted average price (TWAP) mechanism. A [TWAP oracle](https://docs.uniswap.org/contracts/v2/concepts/core-concepts/oracles) queries the price of an asset at two different points in time (which you can modify) and calculates the spot price based on the average obtained. Choosing longer time periods protects your protocol against price manipulation since large orders executed recently cannot impact asset prices.
454454

455455
## Smart contract security resources for developers {#smart-contract-security-resources-for-developers}
456456

src/content/developers/tutorials/uniswap-v2-annotated-code/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ _Traders_ send one type of token to the pool and receive the other (for example,
2222

2323
When liquidity providers want their assets back they can burn the pool tokens and receive back their tokens, including their share of the rewards.
2424

25-
[Click here for a fuller description](https://docs.uniswap.org/protocol/V2/concepts/core-concepts/swaps/).
25+
[Click here for a fuller description](https://docs.uniswap.org/contracts/v2/concepts/core-concepts/swaps/).
2626

2727
### Why v2? Why not v3? {#why-v2}
2828

@@ -816,7 +816,7 @@ These two functions allow `feeSetter` to control the fee recipient (if any), and
816816

817817
[This contract](https://github.com/Uniswap/uniswap-v2-core/blob/master/contracts/UniswapV2ERC20.sol) implements the ERC-20 liquidity token. It is similar to the [OpenZeppelin ERC-20 contract](/developers/tutorials/erc20-annotated-code), so I will only explain the part that is different, the `permit` functionality.
818818

819-
Transactions on Ethereum cost ether (ETH), which is equivalent to real money. If you have ERC-20 tokens but not ETH, you can't send transactions, so you can't do anything with them. One solution to avoid this problem is [meta-transactions](https://docs.uniswap.org/protocol/V2/guides/smart-contract-integration/supporting-meta-transactions/).
819+
Transactions on Ethereum cost ether (ETH), which is equivalent to real money. If you have ERC-20 tokens but not ETH, you can't send transactions, so you can't do anything with them. One solution to avoid this problem is [meta-transactions](https://docs.uniswap.org/contracts/v2/guides/smart-contract-integration/supporting-meta-transactions).
820820
The owner of the tokens signs a transaction that allows somebody else to withdraw tokens off chain and sends it using the Internet to the recipient. The recipient, which does have ETH, then submits the permit on behalf of the owner.
821821

822822
```solidity

src/content/translations/fr/developers/tutorials/uniswap-v2-annotated-code/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Les _traders_ envoient un type de jeton au pool et reçoivent l'autre (par exemp
2424

2525
Lorsque les fournisseurs de liquidités veulent récupérer leurs actifs, ils peuvent brûler les jetons du pool et récupérer leurs jetons, y compris leur part des récompenses.
2626

27-
[Cliquez ici pour une description plus complète](https://docs.uniswap.org/protocol/V2/concepts/core-concepts/swaps/).
27+
[Cliquez ici pour une description plus complète](https://docs.uniswap.org/contracts/v2/concepts/core-concepts/swaps/).
2828

2929
### Pourquoi v2 ? Pourquoi pas v3 ? {#why-v2}
3030

@@ -803,7 +803,7 @@ Ces deux fonctions permettent à `feeSetter` de contrôler le destinataire des f
803803

804804
[Ce contrat](https://github.com/Uniswap/uniswap-v2-core/blob/master/contracts/UniswapV2ERC20.sol) implemente le jeton de liquidité ERC-20. Il est identique au [contrat OpenWhisk ERC-20](/developers/tutorials/erc20-annotated-code). De fait, je n'expliquerai que la partie qui est différente, à savoir la fonctionnalité `Permit`.
805805

806-
Les transactions sur Ethereum coûtent de l'Ether (ETH), ce qui équivaut à de l'argent réel. Si vous avez des jetons ERC-20 mais pas d'ETH, vous ne pouvez pas envoyer de transactions. Vous ne pouvez donc rien faire avec. Pour éviter ce problème, vous pouvez opter pour des [méta-transactions](https://docs.uniswap.org/protocol/V2/guides/smart-contract-integration/supporting-meta-transactions/). Le propriétaire des jetons signe une transaction qui permet à quelqu'un d'autre de retirer des jetons hors chaîne et de les envoyer via Internet à un destinataire. Le destinataire disposant d'ETH soumet ensuite le permis pour le compte du propriétaire.
806+
Les transactions sur Ethereum coûtent de l'Ether (ETH), ce qui équivaut à de l'argent réel. Si vous avez des jetons ERC-20 mais pas d'ETH, vous ne pouvez pas envoyer de transactions. Vous ne pouvez donc rien faire avec. Pour éviter ce problème, vous pouvez opter pour des [méta-transactions](https://docs.uniswap.org/contracts/v2/guides/smart-contract-integration/supporting-meta-transactions). Le propriétaire des jetons signe une transaction qui permet à quelqu'un d'autre de retirer des jetons hors chaîne et de les envoyer via Internet à un destinataire. Le destinataire disposant d'ETH soumet ensuite le permis pour le compte du propriétaire.
807807

808808
```solidity
809809
bytes32 public DOMAIN_SEPARATOR;

src/content/translations/id/developers/tutorials/uniswap-v2-annotated-code/index.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ _Pedagang_ mengirimkan satu jenis token ke pool dan menerima token lainnya (cont
2424

2525
Ketika penyedia likuiditas menginginkan kembali aset mereka, mereka dapat membakar token pool dan menerima kembali token mereka, termasuk bagian imbalan mereka.
2626

27-
[Klik di sini untuk deskripsi lengkapnya](https://docs.uniswap.org/protocol/V2/concepts/core-concepts/swaps/).
27+
[Klik di sini untuk deskripsi lengkapnya](https://docs.uniswap.org/contracts/v2/concepts/core-concepts/swaps/).
2828

2929
### Mengapa v2? Mengapa bukan v3? {#why-v2}
3030

@@ -803,7 +803,7 @@ Kedua fungsi ini membuat `feeSetter` dapat mengendalikan penerima biaya (jika ad
803803

804804
[Kontrak ini](https://github.com/Uniswap/uniswap-v2-core/blob/master/contracts/UniswapV2ERC20.sol) menerapkan token likuiditas ERC-20. Sama dengan kontrak [ERC-20 OpenWhisk](/developers/tutorials/erc20-annotated-code), sehingga saya hanya akan menjelaskan perbedaannya, fungsionalitas `izin`.
805805

806-
Transaksi di Ethereum membutuhkan ether (ETH), yang sama dengan uang sebenarnya. Jika Anda memiliki token ERC-20, tetapi bukan ETH, Anda tidak dapat mengirim transaksi, sehingga Anda tidak dapat melakukan apa pun dengannya. Satu solusi untuk menghindari masalah ini adalah [transaksi meta](https://docs.uniswap.org/protocol/V2/guides/smart-contract-integration/supporting-meta-transactions/). Pemilik token menandatangani transaksi yang membuat seseorang lainnya menarik token di luar rantai dan mengirimnya menggunakan Internet kepada penerima. Penerima, yang memiliki ETH, kemudian mengirim izin atas nama pemilik.
806+
Transaksi di Ethereum membutuhkan ether (ETH), yang sama dengan uang sebenarnya. Jika Anda memiliki token ERC-20, tetapi bukan ETH, Anda tidak dapat mengirim transaksi, sehingga Anda tidak dapat melakukan apa pun dengannya. Satu solusi untuk menghindari masalah ini adalah [transaksi meta](https://docs.uniswap.org/contracts/v2/guides/smart-contract-integration/supporting-meta-transactions). Pemilik token menandatangani transaksi yang membuat seseorang lainnya menarik token di luar rantai dan mengirimnya menggunakan Internet kepada penerima. Penerima, yang memiliki ETH, kemudian mengirim izin atas nama pemilik.
807807

808808
```solidity
809809
bytes32 public DOMAIN_SEPARATOR;
@@ -891,11 +891,11 @@ Kontrak perifer adalah API (antarmuka program aplikasi) untuk Uniswap. Kontrak i
891891

892892
### UniswapV2Router01.sol {#UniswapV2Router01}
893893

894-
[Kontrak ini](https://github.com/Uniswap/uniswap-v2-periphery/blob/master/contracts/UniswapV2Router01.sol) memiliki masalah, dan [seharusnya tidak lagi digunakan](https://docs.uniswap.org/protocol/V2/reference/smart-contracts/router-01/). Untungnya, kontrak perifer bersifat tanpa status dan tidak menampung aset apa pun, sehingga mudah untuk mengusangkannya dan menyarankan orang-orang menggunakan penggantinya, `UniswapV2Router02`, sebagai gantinya.
894+
[Kontrak ini](https://github.com/Uniswap/uniswap-v2-periphery/blob/master/contracts/UniswapV2Router01.sol) memiliki masalah, dan [seharusnya tidak lagi digunakan](https://docs.uniswap.org/contracts/v2/reference/smart-contracts/router-01). Untungnya, kontrak perifer bersifat tanpa status dan tidak menampung aset apa pun, sehingga mudah untuk mengusangkannya dan menyarankan orang-orang menggunakan penggantinya, `UniswapV2Router02`, sebagai gantinya.
895895

896896
### UniswapV2Router02.sol {#UniswapV2Router02}
897897

898-
Dalam kebanyakan kasus, Anda akan menggunakan Uniswap melalui [kontrak ini](https://github.com/Uniswap/uniswap-v2-periphery/blob/master/contracts/UniswapV2Router02.sol). Anda dapat melihat cara menggunakannya [di sini](https://docs.uniswap.org/protocol/V2/reference/smart-contracts/router-02/).
898+
Dalam kebanyakan kasus, Anda akan menggunakan Uniswap melalui [kontrak ini](https://github.com/Uniswap/uniswap-v2-periphery/blob/master/contracts/UniswapV2Router02.sol). Anda dapat melihat cara menggunakannya [di sini](https://docs.uniswap.org/contracts/v2/reference/smart-contracts/router-02).
899899

900900
```solidity
901901
pragma solidity =0.6.6;

src/content/translations/it/developers/docs/smart-contracts/security/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,7 @@ Ad esempio, un utente malevolo potrebbe pompare artificialmente il prezzo a pron
450450

451451
Il requisito minimo per evitare la manipolazione degli oracoli è utilizzare una rete di oracoli decentralizzati che richieda le informazioni da fonti multiple per evitare singoli punti di errore. In gran parte dei casi, gli oracoli decentralizzati contengono incentivi criptoeconomici integrati per incoraggiare i nodi dell'oracolo a segnalare le informazioni corrette, rendendoli più sicuri rispetto agli oracoli centralizzati.
452452

453-
Se prevedi di interrogare un oracolo sulla catena per conoscere i prezzi dei beni, valuta di utilizzarne uno che implementi un meccanismo di prezzo medio ponderato per il tempo (TWAP). Un [oracolo TWAP](https://docs.uniswap.org/protocol/V2/concepts/core-concepts/oracles) interroga il prezzo di un bene in due momenti differenti (che puoi modificare) e calcola il prezzo a pronti a seconda della media ottenuta. La scelta di periodi di tempo più lunghi protegge il tuo protocollo dalla manipolazione dei prezzi poiché i grandi ordini eseguiti di recente non possono influire sui prezzi dei beni.
453+
Se prevedi di interrogare un oracolo sulla catena per conoscere i prezzi dei beni, valuta di utilizzarne uno che implementi un meccanismo di prezzo medio ponderato per il tempo (TWAP). Un [oracolo TWAP](https://docs.uniswap.org/contracts/v2/concepts/core-concepts/oracles) interroga il prezzo di un bene in due momenti differenti (che puoi modificare) e calcola il prezzo a pronti a seconda della media ottenuta. La scelta di periodi di tempo più lunghi protegge il tuo protocollo dalla manipolazione dei prezzi poiché i grandi ordini eseguiti di recente non possono influire sui prezzi dei beni.
454454

455455
## Risorse di sicurezza dei contratti intelligenti per sviluppatori {#smart-contract-security-resources-for-developers}
456456

src/content/translations/it/developers/tutorials/uniswap-v2-annotated-code/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -803,7 +803,7 @@ Queste due funzioni consentono a `feeSetter` di controllare il destinatario dell
803803

804804
[Questo contratto](https://github.com/Uniswap/uniswap-v2-core/blob/master/contracts/UniswapV2ERC20.sol) implementa il token di liquidità ERC-20. È simile al [contratto ERC-20 di OpenWhisk](/developers/tutorials/erc20-annotated-code), quindi spiegherò solo la parte diversa, la funzionalità `permit`.
805805

806-
Le transazioni su Ethereum costano ether (ETH), equivalente al denaro reale. Se hai token ERC-20 ma non ETH, non puoi inviare transazioni, quindi non puoi farci nulla. Una soluzione per evitare questo problema sono le [meta-transazioni](https://docs.uniswap.org/protocol/V2/guides/smart-contract-integration/supporting-meta-transactions/). Il proprietario dei token firma una transazione che consenta ad altri di prelevare i token al di fuori della catena e la invia al destinatario usando Internet. Il destinatario, che ha ETH a disposizione, invia il permesso per conto del proprietario.
806+
Le transazioni su Ethereum costano ether (ETH), equivalente al denaro reale. Se hai token ERC-20 ma non ETH, non puoi inviare transazioni, quindi non puoi farci nulla. Una soluzione per evitare questo problema sono le [meta-transazioni](https://docs.uniswap.org/contracts/v2/guides/smart-contract-integration/supporting-meta-transactions). Il proprietario dei token firma una transazione che consenta ad altri di prelevare i token al di fuori della catena e la invia al destinatario usando Internet. Il destinatario, che ha ETH a disposizione, invia il permesso per conto del proprietario.
807807

808808
```solidity
809809
bytes32 public DOMAIN_SEPARATOR;

src/content/translations/ja/developers/docs/smart-contracts/security/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -448,7 +448,7 @@ DEX の価格は正確であることが多く、これは市場の均衡を取
448448

449449
オラクルの改ざんを回避するための最小要件としては、単一障害点を避けるために複数のソースから情報を照会する分散型オラクルネットワークを使用することです。 ほとんどの場合、分散型オラクルにはオラクルノードに正しい情報を報告するよう促す暗号経済的なインセンティブが組み込まれており、集中型オラクルよりも安全性が高くなっています。
450450

451-
オンチェーンオラクルに資産価格を照会する場合は、時間加重平均価格 (TWAP) メカニズムを実装しているものを使用することを検討してください。 [TWAP オラクル](https://docs.uniswap.org/protocol/V2/concepts/core-concepts/oracles)は、ある資産の価格を 2 つの異なる時点 (修正可能) で照会し、得られた平均値に基づいて現在価格を計算します。 長い期間を選択することで、直前に行われた大量の注文が資産価格に影響を与えることができないため、価格の不正操作からプロトコルを保護します。
451+
オンチェーンオラクルに資産価格を照会する場合は、時間加重平均価格 (TWAP) メカニズムを実装しているものを使用することを検討してください。 [TWAP オラクル](https://docs.uniswap.org/contracts/v2/concepts/core-concepts/oracles)は、ある資産の価格を 2 つの異なる時点 (修正可能) で照会し、得られた平均値に基づいて現在価格を計算します。 長い期間を選択することで、直前に行われた大量の注文が資産価格に影響を与えることができないため、価格の不正操作からプロトコルを保護します。
452452

453453
## デペロッパー向けスマートコントラクト・セキュリティリソース {#smart-contract-security-resources-for-developers}
454454

0 commit comments

Comments
 (0)