Skip to content

Conversation

@bimkon144
Copy link
Contributor

No description provided.

Copy link
Collaborator

@PavelNaydanov PavelNaydanov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Статья очень крутая! Я вижу в ней прям хороший потенциал. Тема сложная, но ты хорошо в ней разобрался!)

@bimkon144
Copy link
Contributor Author

Спасибо! Рад что понравилась - я старался!

@@ -0,0 +1,83 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
Copy link
Collaborator

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).
Copy link
Collaborator

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).
Copy link
Collaborator

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)) кодировки, которой вы можете воспользоваться для удобства. Для этого откройте этот файл в браузере и поменяйте параметры на необходимые.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Обозначить явно, что файл тулзы надо скачать и потом только открыть в бразуере

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants