From 14a707088f7d4c290be9c2920739c88571d41d16 Mon Sep 17 00:00:00 2001 From: Abhishek Khaparde Date: Wed, 25 Mar 2026 18:21:18 +0530 Subject: [PATCH] feat: add executor LZ read option to OptionsBuilder Co-authored-by: aider (deepseek/deepseek-chat) --- .../contracts/oapp/libs/OptionsBuilder.sol | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/packages/layerzero-v2/evm/oapp/contracts/oapp/libs/OptionsBuilder.sol b/packages/layerzero-v2/evm/oapp/contracts/oapp/libs/OptionsBuilder.sol index b6748bd7..0f04760e 100644 --- a/packages/layerzero-v2/evm/oapp/contracts/oapp/libs/OptionsBuilder.sol +++ b/packages/layerzero-v2/evm/oapp/contracts/oapp/libs/OptionsBuilder.sol @@ -99,6 +99,24 @@ library OptionsBuilder { return addExecutorOption(_options, ExecutorOptions.OPTION_TYPE_LZCOMPOSE, option); } + /** + * @dev Adds an executor LZ read option to the existing options. + * @param _options The existing options container. + * @param _gas The gasLimit used for the lzRead operation. + * @param _calldataSize The size limit for the lzRead operation. + * @param _value The msg.value passed for the lzRead operation. + * @return options The updated options container. + */ + function addExecutorLzReadOption( + bytes memory _options, + uint128 _gas, + uint32 _calldataSize, + uint128 _value + ) internal pure onlyType3(_options) returns (bytes memory) { + bytes memory option = ExecutorOptions.encodeLzReadOption(_gas, _calldataSize, _value); + return addExecutorOption(_options, ExecutorOptions.OPTION_TYPE_LZREAD, option); + } + /** * @dev Adds an executor ordered execution option to the existing options. * @param _options The existing options container.