-
Notifications
You must be signed in to change notification settings - Fork 11
article: layer zero lzRead #141
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
PavelNaydanov
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Статья очень крутая! Я вижу в ней прям хороший потенциал. Тема сложная, но ты хорошо в ней разобрался!)
|
Спасибо! Рад что понравилась - я старался! |
| @@ -0,0 +1,83 @@ | |||
| // SPDX-License-Identifier: MIT | |||
| pragma solidity ^0.8.20; | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Удалить старый контракт. Больше не используется
|
|
||
| 1. Откройте [Remix](https://remix.ethereum.org/) и добавьте контракты [LzReadConfig.sol](./LzReadConfig.sol) и [UniswapV3ObserveRead.sol](./UniswapV3ObserveRead.sol). | ||
| 2. В [Chains](https://docs.layerzero.network/v2/developers/evm/technical-reference/deployed-contracts) найдите адрес Endpoint для origin и EID для data chain. Для data chain найдите адрес пула Uniswap V3 ([Uniswap deployments](https://docs.uniswap.org/contracts/v3/reference/deployments/ethereum-deployments)). Убедитесь, что вызов `observe` на пуле возвращает данные. | ||
| 3. Узнайте Read Channel ID и адреса ReadLib, executor, DVN для выбранной сети из [таблицы](https://docs.layerzero.network/v2/deployments/read-contracts). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Нужно заменить скриншот. Он сейчас показывает неправильную сеть.
|
|
||
| 1. Откройте [Remix](https://remix.ethereum.org/) и добавьте контракты [LzReadConfig.sol](./LzReadConfig.sol) и [UniswapV3ObserveRead.sol](./UniswapV3ObserveRead.sol). | ||
| 2. В [Chains](https://docs.layerzero.network/v2/developers/evm/technical-reference/deployed-contracts) найдите адрес Endpoint для origin и EID для data chain. Для data chain найдите адрес пула Uniswap V3 ([Uniswap deployments](https://docs.uniswap.org/contracts/v3/reference/deployments/ethereum-deployments)). Убедитесь, что вызов `observe` на пуле возвращает данные. | ||
| 3. Узнайте Read Channel ID и адреса ReadLib, executor, DVN для выбранной сети из [таблицы](https://docs.layerzero.network/v2/deployments/read-contracts). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Сделать все передаваемые параметры списком и указать из настроек какой сети в документации их нужно брать.
| - **\_libConfig** — конфиг ReadLib на endpoint: `(executor, requiredDVNCount, optionalDVNCount, optionalDVNThreshold, requiredDVNs[], optionalDVNs[])`. Адреса **executor**, **requiredDVNs** и **optionalDVNs** и массив требуемых DVNs вы можете выбрать из [таблицы](https://docs.layerzero.network/v2/deployments/read-contracts). | ||
| - **\_receiveGracePeriod** — задержка активации receive-библиотеки в секундах; обычно **0** (сразу). | ||
| - **\_enforced** — принудительные опции для lzRead: структура из трех полей. **eid** (uint32) = тот же readChannel; **msgType** (uint16) = 1 для lzRead; **options** (bytes) — закодированные опции (gas, размер ответа в байтах, value). | ||
| - **Поле options:** К сожалению в библиотеках layerZero нет доступа к вспомогательному методу кодировки этих параметров, поэтому я создал для вас [тулзу]((./tools/options-encoder.html)) кодировки, которой вы можете воспользоваться для удобства. Для этого откройте этот файл в браузере и поменяйте параметры на необходимые. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Обозначить явно, что файл тулзы надо скачать и потом только открыть в бразуере
No description provided.