@layerzerolabs/protocol-starknet-v2 0.0.34
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +186 -0
- package/.turbo/turbo-lint.log +71 -0
- package/.turbo/turbo-test.log +937 -0
- package/README.md +41 -0
- package/Scarb.lock +211 -0
- package/Scarb.toml +2 -0
- package/dist/4XD3ZRZ4.cjs +301 -0
- package/dist/4XD3ZRZ4.cjs.map +1 -0
- package/dist/4Z5IPBC3.js +299 -0
- package/dist/4Z5IPBC3.js.map +1 -0
- package/dist/5NEZDLVQ.cjs +474 -0
- package/dist/5NEZDLVQ.cjs.map +1 -0
- package/dist/6JYCOKDE.js +472 -0
- package/dist/6JYCOKDE.js.map +1 -0
- package/dist/7C4PFMIZ.cjs +1288 -0
- package/dist/7C4PFMIZ.cjs.map +1 -0
- package/dist/7ZSGGZUE.js +1229 -0
- package/dist/7ZSGGZUE.js.map +1 -0
- package/dist/ARHOGUYH.cjs +2136 -0
- package/dist/ARHOGUYH.cjs.map +1 -0
- package/dist/CRCRIUFX.js +1264 -0
- package/dist/CRCRIUFX.js.map +1 -0
- package/dist/DB7CQSED.cjs +430 -0
- package/dist/DB7CQSED.cjs.map +1 -0
- package/dist/DFXLWHYP.cjs +1266 -0
- package/dist/DFXLWHYP.cjs.map +1 -0
- package/dist/EOLZCMCK.js +988 -0
- package/dist/EOLZCMCK.js.map +1 -0
- package/dist/FFDPTOWG.cjs +331 -0
- package/dist/FFDPTOWG.cjs.map +1 -0
- package/dist/FOJGEAIO.js +2134 -0
- package/dist/FOJGEAIO.js.map +1 -0
- package/dist/IWIUMVGB.js +629 -0
- package/dist/IWIUMVGB.js.map +1 -0
- package/dist/MUEN6AWV.cjs +697 -0
- package/dist/MUEN6AWV.cjs.map +1 -0
- package/dist/ORE6VBZ4.cjs +990 -0
- package/dist/ORE6VBZ4.cjs.map +1 -0
- package/dist/OUFKWPZ7.js +732 -0
- package/dist/OUFKWPZ7.js.map +1 -0
- package/dist/T2QTYQXJ.js +1229 -0
- package/dist/T2QTYQXJ.js.map +1 -0
- package/dist/UPJTM7BR.cjs +631 -0
- package/dist/UPJTM7BR.cjs.map +1 -0
- package/dist/VNVNX2P3.cjs +1231 -0
- package/dist/VNVNX2P3.cjs.map +1 -0
- package/dist/VUOMXK5T.js +6 -0
- package/dist/VUOMXK5T.js.map +1 -0
- package/dist/WISWRTDG.js +1286 -0
- package/dist/WISWRTDG.js.map +1 -0
- package/dist/WU5L7YIQ.cjs +1231 -0
- package/dist/WU5L7YIQ.cjs.map +1 -0
- package/dist/X3B5JDMZ.js +695 -0
- package/dist/X3B5JDMZ.js.map +1 -0
- package/dist/XYNBDBBV.cjs +297 -0
- package/dist/XYNBDBBV.cjs.map +1 -0
- package/dist/Y5JFPCYJ.cjs +734 -0
- package/dist/Y5JFPCYJ.cjs.map +1 -0
- package/dist/YEHL7IYO.js +295 -0
- package/dist/YEHL7IYO.js.map +1 -0
- package/dist/YJF4D23A.cjs +8 -0
- package/dist/YJF4D23A.cjs.map +1 -0
- package/dist/YTS44OEA.js +428 -0
- package/dist/YTS44OEA.js.map +1 -0
- package/dist/Z2NIUZMW.js +329 -0
- package/dist/Z2NIUZMW.js.map +1 -0
- package/dist/abis/blocked-message-lib.cjs +13 -0
- package/dist/abis/blocked-message-lib.cjs.map +1 -0
- package/dist/abis/blocked-message-lib.d.ts +338 -0
- package/dist/abis/blocked-message-lib.d.ts.map +1 -0
- package/dist/abis/blocked-message-lib.js +4 -0
- package/dist/abis/blocked-message-lib.js.map +1 -0
- package/dist/abis/dvn-fee-lib.cjs +13 -0
- package/dist/abis/dvn-fee-lib.cjs.map +1 -0
- package/dist/abis/dvn-fee-lib.d.ts +214 -0
- package/dist/abis/dvn-fee-lib.d.ts.map +1 -0
- package/dist/abis/dvn-fee-lib.js +4 -0
- package/dist/abis/dvn-fee-lib.js.map +1 -0
- package/dist/abis/dvn.cjs +13 -0
- package/dist/abis/dvn.cjs.map +1 -0
- package/dist/abis/dvn.d.ts +952 -0
- package/dist/abis/dvn.d.ts.map +1 -0
- package/dist/abis/dvn.js +4 -0
- package/dist/abis/dvn.js.map +1 -0
- package/dist/abis/endpoint-v2.cjs +13 -0
- package/dist/abis/endpoint-v2.cjs.map +1 -0
- package/dist/abis/endpoint-v2.d.ts +1580 -0
- package/dist/abis/endpoint-v2.d.ts.map +1 -0
- package/dist/abis/endpoint-v2.js +4 -0
- package/dist/abis/endpoint-v2.js.map +1 -0
- package/dist/abis/executor-fee-lib.cjs +13 -0
- package/dist/abis/executor-fee-lib.cjs.map +1 -0
- package/dist/abis/executor-fee-lib.d.ts +217 -0
- package/dist/abis/executor-fee-lib.d.ts.map +1 -0
- package/dist/abis/executor-fee-lib.js +4 -0
- package/dist/abis/executor-fee-lib.js.map +1 -0
- package/dist/abis/executor.cjs +13 -0
- package/dist/abis/executor.cjs.map +1 -0
- package/dist/abis/executor.d.ts +914 -0
- package/dist/abis/executor.d.ts.map +1 -0
- package/dist/abis/executor.js +4 -0
- package/dist/abis/executor.js.map +1 -0
- package/dist/abis/o-app.cjs +13 -0
- package/dist/abis/o-app.cjs.map +1 -0
- package/dist/abis/o-app.d.ts +311 -0
- package/dist/abis/o-app.d.ts.map +1 -0
- package/dist/abis/o-app.js +4 -0
- package/dist/abis/o-app.js.map +1 -0
- package/dist/abis/oft-adapter.cjs +13 -0
- package/dist/abis/oft-adapter.cjs.map +1 -0
- package/dist/abis/oft-adapter.d.ts +722 -0
- package/dist/abis/oft-adapter.d.ts.map +1 -0
- package/dist/abis/oft-adapter.js +4 -0
- package/dist/abis/oft-adapter.js.map +1 -0
- package/dist/abis/oft.cjs +13 -0
- package/dist/abis/oft.cjs.map +1 -0
- package/dist/abis/oft.d.ts +922 -0
- package/dist/abis/oft.d.ts.map +1 -0
- package/dist/abis/oft.js +4 -0
- package/dist/abis/oft.js.map +1 -0
- package/dist/abis/omni-counter.cjs +13 -0
- package/dist/abis/omni-counter.cjs.map +1 -0
- package/dist/abis/omni-counter.d.ts +459 -0
- package/dist/abis/omni-counter.d.ts.map +1 -0
- package/dist/abis/omni-counter.js +4 -0
- package/dist/abis/omni-counter.js.map +1 -0
- package/dist/abis/price-feed.cjs +13 -0
- package/dist/abis/price-feed.cjs.map +1 -0
- package/dist/abis/price-feed.d.ts +505 -0
- package/dist/abis/price-feed.d.ts.map +1 -0
- package/dist/abis/price-feed.js +4 -0
- package/dist/abis/price-feed.js.map +1 -0
- package/dist/abis/simple-message-lib.cjs +13 -0
- package/dist/abis/simple-message-lib.cjs.map +1 -0
- package/dist/abis/simple-message-lib.d.ts +535 -0
- package/dist/abis/simple-message-lib.d.ts.map +1 -0
- package/dist/abis/simple-message-lib.js +4 -0
- package/dist/abis/simple-message-lib.js.map +1 -0
- package/dist/abis/treasury.cjs +13 -0
- package/dist/abis/treasury.cjs.map +1 -0
- package/dist/abis/treasury.d.ts +240 -0
- package/dist/abis/treasury.d.ts.map +1 -0
- package/dist/abis/treasury.js +4 -0
- package/dist/abis/treasury.js.map +1 -0
- package/dist/abis/ultra-light-node.cjs +13 -0
- package/dist/abis/ultra-light-node.cjs.map +1 -0
- package/dist/abis/ultra-light-node.d.ts +900 -0
- package/dist/abis/ultra-light-node.d.ts.map +1 -0
- package/dist/abis/ultra-light-node.js +4 -0
- package/dist/abis/ultra-light-node.js.map +1 -0
- package/dist/index.cjs +78 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +15 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +17 -0
- package/dist/index.js.map +1 -0
- package/dist/scripts/build-abi.cjs +28 -0
- package/dist/scripts/build-abi.cjs.map +1 -0
- package/dist/scripts/build-abi.d.ts +2 -0
- package/dist/scripts/build-abi.d.ts.map +1 -0
- package/dist/scripts/build-abi.js +26 -0
- package/dist/scripts/build-abi.js.map +1 -0
- package/layerzero/README.md +244 -0
- package/layerzero/Scarb.lock +203 -0
- package/layerzero/Scarb.toml +30 -0
- package/layerzero/snfoundry.toml +11 -0
- package/layerzero/src/common/constants.cairo +26 -0
- package/layerzero/src/common/conversions.cairo +16 -0
- package/layerzero/src/common/guid.cairo +20 -0
- package/layerzero/src/common/packet_v1_codec.cairo +307 -0
- package/layerzero/src/common/structs/messaging.cairo +40 -0
- package/layerzero/src/common/structs/packet.cairo +31 -0
- package/layerzero/src/endpoint/constants.cairo +14 -0
- package/layerzero/src/endpoint/endpoint.cairo +688 -0
- package/layerzero/src/endpoint/errors.cairo +108 -0
- package/layerzero/src/endpoint/events.cairo +124 -0
- package/layerzero/src/endpoint/interfaces/endpoint.cairo +286 -0
- package/layerzero/src/endpoint/interfaces/layerzero_composer.cairo +62 -0
- package/layerzero/src/endpoint/interfaces/layerzero_receiver.cairo +63 -0
- package/layerzero/src/endpoint/message_lib_manager/errors.cairo +95 -0
- package/layerzero/src/endpoint/message_lib_manager/events.cairo +90 -0
- package/layerzero/src/endpoint/message_lib_manager/interface.cairo +449 -0
- package/layerzero/src/endpoint/message_lib_manager/message_lib_manager.cairo +720 -0
- package/layerzero/src/endpoint/message_lib_manager/structs.cairo +33 -0
- package/layerzero/src/endpoint/messaging_channel/errors.cairo +37 -0
- package/layerzero/src/endpoint/messaging_channel/events.cairo +58 -0
- package/layerzero/src/endpoint/messaging_channel/interface.cairo +171 -0
- package/layerzero/src/endpoint/messaging_channel/messaging_channel.cairo +453 -0
- package/layerzero/src/endpoint/messaging_composer/errors.cairo +46 -0
- package/layerzero/src/endpoint/messaging_composer/events.cairo +67 -0
- package/layerzero/src/endpoint/messaging_composer/interface.cairo +132 -0
- package/layerzero/src/endpoint/messaging_composer/messaging_composer.cairo +223 -0
- package/layerzero/src/lib.cairo +189 -0
- package/layerzero/src/message_lib/blocked_message_lib.cairo +114 -0
- package/layerzero/src/message_lib/interface.cairo +63 -0
- package/layerzero/src/message_lib/sml/errors.cairo +23 -0
- package/layerzero/src/message_lib/sml/events.cairo +32 -0
- package/layerzero/src/message_lib/sml/simple_message_lib.cairo +312 -0
- package/layerzero/src/message_lib/structs.cairo +22 -0
- package/layerzero/src/message_lib/uln/errors.cairo +128 -0
- package/layerzero/src/message_lib/uln/events.cairo +97 -0
- package/layerzero/src/message_lib/uln/interface.cairo +83 -0
- package/layerzero/src/message_lib/uln/options.cairo +64 -0
- package/layerzero/src/message_lib/uln/structs/executor_config.cairo +35 -0
- package/layerzero/src/message_lib/uln/structs/payment_info.cairo +7 -0
- package/layerzero/src/message_lib/uln/structs/uln_config.cairo +155 -0
- package/layerzero/src/message_lib/uln/structs/uln_config_storage_node.cairo +91 -0
- package/layerzero/src/message_lib/uln/structs/verification.cairo +7 -0
- package/layerzero/src/message_lib/uln/ultra_light_node.cairo +965 -0
- package/layerzero/src/oapps/common/oapp_options_type_3/errors.cairo +22 -0
- package/layerzero/src/oapps/common/oapp_options_type_3/events.cairo +6 -0
- package/layerzero/src/oapps/common/oapp_options_type_3/interface.cairo +34 -0
- package/layerzero/src/oapps/common/oapp_options_type_3/oapp_options_type_3.cairo +120 -0
- package/layerzero/src/oapps/common/oapp_options_type_3/structs.cairo +6 -0
- package/layerzero/src/oapps/counter/constants.cairo +3 -0
- package/layerzero/src/oapps/counter/counter.cairo +170 -0
- package/layerzero/src/oapps/counter/interface.cairo +27 -0
- package/layerzero/src/oapps/counter/structs.cairo +20 -0
- package/layerzero/src/oapps/message_inspector/interface.cairo +21 -0
- package/layerzero/src/oapps/oapp/errors.cairo +72 -0
- package/layerzero/src/oapps/oapp/events.cairo +9 -0
- package/layerzero/src/oapps/oapp/interface.cairo +67 -0
- package/layerzero/src/oapps/oapp/oapp.cairo +70 -0
- package/layerzero/src/oapps/oapp/oapp_core.cairo +448 -0
- package/layerzero/src/oapps/oft/errors.cairo +42 -0
- package/layerzero/src/oapps/oft/events.cairo +33 -0
- package/layerzero/src/oapps/oft/interface.cairo +87 -0
- package/layerzero/src/oapps/oft/oft.cairo +188 -0
- package/layerzero/src/oapps/oft/oft_adapter.cairo +175 -0
- package/layerzero/src/oapps/oft/oft_compose_msg_codec.cairo +128 -0
- package/layerzero/src/oapps/oft/oft_core.cairo +542 -0
- package/layerzero/src/oapps/oft/oft_msg_codec.cairo +131 -0
- package/layerzero/src/oapps/oft/structs.cairo +72 -0
- package/layerzero/src/treasury/errors.cairo +22 -0
- package/layerzero/src/treasury/events.cairo +5 -0
- package/layerzero/src/treasury/interfaces/layerzero_treasury.cairo +54 -0
- package/layerzero/src/treasury/interfaces/lz_token_fee_lib.cairo +45 -0
- package/layerzero/src/treasury/interfaces/treasury_admin.cairo +39 -0
- package/layerzero/src/treasury/treasury.cairo +140 -0
- package/layerzero/src/workers/access_control.cairo +11 -0
- package/layerzero/src/workers/base/base.cairo +238 -0
- package/layerzero/src/workers/base/errors.cairo +24 -0
- package/layerzero/src/workers/base/events.cairo +43 -0
- package/layerzero/src/workers/base/interface.cairo +93 -0
- package/layerzero/src/workers/base/structs.cairo +10 -0
- package/layerzero/src/workers/common.cairo +59 -0
- package/layerzero/src/workers/dvn/constants.cairo +11 -0
- package/layerzero/src/workers/dvn/dvn.cairo +338 -0
- package/layerzero/src/workers/dvn/errors.cairo +80 -0
- package/layerzero/src/workers/dvn/events.cairo +30 -0
- package/layerzero/src/workers/dvn/fee_lib/dvn_fee_lib.cairo +152 -0
- package/layerzero/src/workers/dvn/fee_lib/interface.cairo +45 -0
- package/layerzero/src/workers/dvn/interface.cairo +131 -0
- package/layerzero/src/workers/dvn/options.cairo +125 -0
- package/layerzero/src/workers/dvn/structs.cairo +51 -0
- package/layerzero/src/workers/executor/errors.cairo +159 -0
- package/layerzero/src/workers/executor/events.cairo +32 -0
- package/layerzero/src/workers/executor/executor.cairo +392 -0
- package/layerzero/src/workers/executor/fee_lib/executor_fee_lib.cairo +160 -0
- package/layerzero/src/workers/executor/fee_lib/interface.cairo +87 -0
- package/layerzero/src/workers/executor/interface.cairo +131 -0
- package/layerzero/src/workers/executor/options.cairo +244 -0
- package/layerzero/src/workers/executor/structs.cairo +119 -0
- package/layerzero/src/workers/interface.cairo +32 -0
- package/layerzero/src/workers/price_feed/constants.cairo +7 -0
- package/layerzero/src/workers/price_feed/errors.cairo +28 -0
- package/layerzero/src/workers/price_feed/events.cairo +13 -0
- package/layerzero/src/workers/price_feed/interface.cairo +264 -0
- package/layerzero/src/workers/price_feed/price_feed.cairo +392 -0
- package/layerzero/src/workers/price_feed/structs.cairo +74 -0
- package/layerzero/tests/common/test_constants.cairo +21 -0
- package/layerzero/tests/common/test_guid.cairo +232 -0
- package/layerzero/tests/common/test_packet_v1_codec.cairo +372 -0
- package/layerzero/tests/common/utils.cairo +23 -0
- package/layerzero/tests/e2e/oft_utils.cairo +121 -0
- package/layerzero/tests/e2e/test_counter_with_sml.cairo +194 -0
- package/layerzero/tests/e2e/test_counter_with_uln.cairo +352 -0
- package/layerzero/tests/e2e/test_dvn.cairo +406 -0
- package/layerzero/tests/e2e/test_lz_token.cairo +354 -0
- package/layerzero/tests/e2e/test_oft_compose_with_uln.cairo +364 -0
- package/layerzero/tests/e2e/test_oft_with_sml.cairo +240 -0
- package/layerzero/tests/e2e/test_oft_with_uln.cairo +299 -0
- package/layerzero/tests/e2e/utils.cairo +490 -0
- package/layerzero/tests/endpoint/message_lib_manager/test_message_lib_manager.cairo +2051 -0
- package/layerzero/tests/endpoint/message_lib_manager/utils.cairo +45 -0
- package/layerzero/tests/endpoint/messaging_channel/test_messaging_channel.cairo +621 -0
- package/layerzero/tests/endpoint/messaging_channel/utils.cairo +96 -0
- package/layerzero/tests/endpoint/messaging_composer/test_messaging_composer.cairo +456 -0
- package/layerzero/tests/endpoint/messaging_composer/utils.cairo +75 -0
- package/layerzero/tests/endpoint/test_endpoint_commit.cairo +763 -0
- package/layerzero/tests/endpoint/test_endpoint_lzreceive.cairo +1253 -0
- package/layerzero/tests/endpoint/test_endpoint_quote.cairo +71 -0
- package/layerzero/tests/endpoint/test_endpoint_send.cairo +1327 -0
- package/layerzero/tests/endpoint/utils.cairo +129 -0
- package/layerzero/tests/fuzzable/blockchain_config.cairo +89 -0
- package/layerzero/tests/fuzzable/bytes32.cairo +16 -0
- package/layerzero/tests/fuzzable/contract_address.cairo +67 -0
- package/layerzero/tests/fuzzable/dst_config.cairo +37 -0
- package/layerzero/tests/fuzzable/eid.cairo +23 -0
- package/layerzero/tests/fuzzable/eth_address.cairo +17 -0
- package/layerzero/tests/fuzzable/expiry.cairo +27 -0
- package/layerzero/tests/fuzzable/felt_array.cairo +38 -0
- package/layerzero/tests/fuzzable/inbound_params.cairo +21 -0
- package/layerzero/tests/fuzzable/keys.cairo +16 -0
- package/layerzero/tests/fuzzable/model_type.cairo +27 -0
- package/layerzero/tests/fuzzable/origin.cairo +21 -0
- package/layerzero/tests/fuzzable/price.cairo +32 -0
- package/layerzero/tests/fuzzable/role_admin.cairo +29 -0
- package/layerzero/tests/fuzzable/small_byte_array.cairo +61 -0
- package/layerzero/tests/lib.cairo +177 -0
- package/layerzero/tests/message_lib/sml/test_simple_message_lib.cairo +224 -0
- package/layerzero/tests/message_lib/uln/test_uln_admin.cairo +2150 -0
- package/layerzero/tests/message_lib/uln/test_uln_config.cairo +527 -0
- package/layerzero/tests/message_lib/uln/test_uln_config_storage_node.cairo +69 -0
- package/layerzero/tests/message_lib/uln/test_uln_executor_config.cairo +173 -0
- package/layerzero/tests/message_lib/uln/test_uln_options.cairo +329 -0
- package/layerzero/tests/message_lib/uln/test_uln_quote.cairo +1038 -0
- package/layerzero/tests/message_lib/uln/test_uln_receive.cairo +715 -0
- package/layerzero/tests/message_lib/uln/test_uln_send.cairo +1155 -0
- package/layerzero/tests/message_lib/uln/utils.cairo +59 -0
- package/layerzero/tests/mocks/composer_target.cairo +76 -0
- package/layerzero/tests/mocks/endpoint.cairo +199 -0
- package/layerzero/tests/mocks/erc20/erc20.cairo +50 -0
- package/layerzero/tests/mocks/erc20/interface.cairo +8 -0
- package/layerzero/tests/mocks/message_inspector/message_inspector.cairo +17 -0
- package/layerzero/tests/mocks/message_lib_manager.cairo +98 -0
- package/layerzero/tests/mocks/messaging_channel/interface.cairo +23 -0
- package/layerzero/tests/mocks/messaging_channel/messaging_channel.cairo +138 -0
- package/layerzero/tests/mocks/messaging_composer.cairo +171 -0
- package/layerzero/tests/mocks/oapp_core/interface.cairo +53 -0
- package/layerzero/tests/mocks/oapp_core/oapp_core.cairo +142 -0
- package/layerzero/tests/mocks/oapp_options_type3.cairo +42 -0
- package/layerzero/tests/mocks/oft_core/interface.cairo +28 -0
- package/layerzero/tests/mocks/oft_core/oft_core.cairo +242 -0
- package/layerzero/tests/mocks/receiver.cairo +54 -0
- package/layerzero/tests/mocks/treasury/lz_token_fee_lib.cairo +57 -0
- package/layerzero/tests/mocks/treasury/treasury.cairo +74 -0
- package/layerzero/tests/mocks/uln_config/interface.cairo +12 -0
- package/layerzero/tests/mocks/uln_config/uln_config.cairo +35 -0
- package/layerzero/tests/mocks/workers/base.cairo +80 -0
- package/layerzero/tests/mocks/workers/dvn.cairo +115 -0
- package/layerzero/tests/mocks/workers/executor/decode/decode.cairo +97 -0
- package/layerzero/tests/mocks/workers/executor/decode/interface.cairo +59 -0
- package/layerzero/tests/mocks/workers/executor/executor.cairo +176 -0
- package/layerzero/tests/oapps/common/test_oapp_options_type_3.cairo +279 -0
- package/layerzero/tests/oapps/oft/test_oft_adapter.cairo +441 -0
- package/layerzero/tests/oapps/oft/test_oft_compose_msg_codec.cairo +139 -0
- package/layerzero/tests/oapps/oft/test_oft_core.cairo +751 -0
- package/layerzero/tests/oapps/oft/test_oft_msg_codec.cairo +268 -0
- package/layerzero/tests/oapps/test_counter.cairo +470 -0
- package/layerzero/tests/oapps/test_oapp_core.cairo +750 -0
- package/layerzero/tests/treasury/test_lz_token_fee_lib.cairo +63 -0
- package/layerzero/tests/treasury/test_treasury.cairo +458 -0
- package/layerzero/tests/treasury/utils.cairo +8 -0
- package/layerzero/tests/utils.cairo +48 -0
- package/layerzero/tests/workers/base/test_worker_base.cairo +1097 -0
- package/layerzero/tests/workers/base/utils.cairo +76 -0
- package/layerzero/tests/workers/dvn/fee_lib/test_dvn_fee_lib.cairo +361 -0
- package/layerzero/tests/workers/dvn/test_dvn.cairo +1101 -0
- package/layerzero/tests/workers/dvn/test_dvn_options.cairo +312 -0
- package/layerzero/tests/workers/dvn/utils.cairo +236 -0
- package/layerzero/tests/workers/executor/fee_lib/test_executor_fee_lib.cairo +223 -0
- package/layerzero/tests/workers/executor/test_decode.cairo +612 -0
- package/layerzero/tests/workers/executor/test_executor.cairo +1472 -0
- package/layerzero/tests/workers/executor/utils.cairo +296 -0
- package/layerzero/tests/workers/price_feed/test_price_feed.cairo +879 -0
- package/layerzero/tests/workers/price_feed/utils.cairo +37 -0
- package/libs/enumerable_set/Scarb.lock +24 -0
- package/libs/enumerable_set/Scarb.toml +17 -0
- package/libs/enumerable_set/src/enumerable_set.cairo +118 -0
- package/libs/enumerable_set/src/lib.cairo +4 -0
- package/libs/enumerable_set/tests/lib.cairo +5 -0
- package/libs/enumerable_set/tests/mocks/mock_enumerable_set.cairo +61 -0
- package/libs/enumerable_set/tests/test_enumerable_set.cairo +379 -0
- package/libs/lz_utils/Scarb.lock +24 -0
- package/libs/lz_utils/Scarb.toml +17 -0
- package/libs/lz_utils/src/bytes.cairo +33 -0
- package/libs/lz_utils/src/error.cairo +12 -0
- package/libs/lz_utils/src/keccak.cairo +28 -0
- package/libs/lz_utils/src/lib.cairo +3 -0
- package/libs/multisig/Scarb.lock +172 -0
- package/libs/multisig/Scarb.toml +23 -0
- package/libs/multisig/src/errors.cairo +84 -0
- package/libs/multisig/src/events.cairo +13 -0
- package/libs/multisig/src/interface.cairo +73 -0
- package/libs/multisig/src/lib.cairo +7 -0
- package/libs/multisig/src/multisig.cairo +241 -0
- package/libs/multisig/tests/lib.cairo +4 -0
- package/libs/multisig/tests/mocks/mock_multisig.cairo +57 -0
- package/libs/multisig/tests/test_multisig.cairo +452 -0
- package/package.json +41 -0
- package/src/scripts/build-abi.ts +51 -0
- package/target/CACHEDIR.TAG +3 -0
- package/target/dev/.fingerprint/alexandria_bytes-5ea6u5t70d7qi/alexandria_bytes +1 -0
- package/target/dev/.fingerprint/alexandria_data_structures-0aue3g6q80gs0/alexandria_data_structures +1 -0
- package/target/dev/.fingerprint/alexandria_math-h2fi7jdq4isuu/alexandria_math +1 -0
- package/target/dev/.fingerprint/core-lq3u730l5p1ag/core +1 -0
- package/target/dev/.fingerprint/core-vf7fc6rvic5vi/core +1 -0
- package/target/dev/.fingerprint/enumerable_set-eaerkg8njl85o/enumerable_set +1 -0
- package/target/dev/.fingerprint/enumerable_set-r54oje7t06ku8/enumerable_set +1 -0
- package/target/dev/.fingerprint/layerzero-oqgdqsaddpi2k/layerzero +1 -0
- package/target/dev/.fingerprint/lz_utils-kfkkeueiqg0pa/lz_utils +1 -0
- package/target/dev/.fingerprint/lz_utils-u4v1os6e7gkng/lz_utils +1 -0
- package/target/dev/.fingerprint/multisig-0fjetugejecge/multisig +1 -0
- package/target/dev/.fingerprint/multisig-6j5kqs436hm54/multisig +1 -0
- package/target/dev/.fingerprint/openzeppelin-ei1id1hu088lo/openzeppelin +1 -0
- package/target/dev/.fingerprint/openzeppelin-j9d5nd1qhfnu6/openzeppelin +1 -0
- package/target/dev/.fingerprint/openzeppelin_access-3oa41aikpaek0/openzeppelin_access +1 -0
- package/target/dev/.fingerprint/openzeppelin_access-p5h849v8so76q/openzeppelin_access +1 -0
- package/target/dev/.fingerprint/openzeppelin_account-4qhv5fks84g9u/openzeppelin_account +1 -0
- package/target/dev/.fingerprint/openzeppelin_account-hgbm8ln9ah7rm/openzeppelin_account +1 -0
- package/target/dev/.fingerprint/openzeppelin_finance-n70q9al0cps8i/openzeppelin_finance +1 -0
- package/target/dev/.fingerprint/openzeppelin_finance-nnd4f8703t3ak/openzeppelin_finance +1 -0
- package/target/dev/.fingerprint/openzeppelin_governance-3gnk21ubp5lis/openzeppelin_governance +1 -0
- package/target/dev/.fingerprint/openzeppelin_governance-rj1bfont4fij4/openzeppelin_governance +1 -0
- package/target/dev/.fingerprint/openzeppelin_introspection-3fja9hd1gvbcq/openzeppelin_introspection +1 -0
- package/target/dev/.fingerprint/openzeppelin_introspection-jc3nf5525eet6/openzeppelin_introspection +1 -0
- package/target/dev/.fingerprint/openzeppelin_merkle_tree-4en77ogr2r2l2/openzeppelin_merkle_tree +1 -0
- package/target/dev/.fingerprint/openzeppelin_merkle_tree-4t190frqs4db8/openzeppelin_merkle_tree +1 -0
- package/target/dev/.fingerprint/openzeppelin_presets-aqb0f6p9c0bp6/openzeppelin_presets +1 -0
- package/target/dev/.fingerprint/openzeppelin_presets-nseg8korhin8e/openzeppelin_presets +1 -0
- package/target/dev/.fingerprint/openzeppelin_security-g7p73ji1ih1qg/openzeppelin_security +1 -0
- package/target/dev/.fingerprint/openzeppelin_security-qp5328v80452u/openzeppelin_security +1 -0
- package/target/dev/.fingerprint/openzeppelin_token-jjf7tl9rphc6k/openzeppelin_token +1 -0
- package/target/dev/.fingerprint/openzeppelin_token-r6s43vlpj6rqk/openzeppelin_token +1 -0
- package/target/dev/.fingerprint/openzeppelin_upgrades-0dpbnre7engca/openzeppelin_upgrades +1 -0
- package/target/dev/.fingerprint/openzeppelin_upgrades-2sqgvbuv9s800/openzeppelin_upgrades +1 -0
- package/target/dev/.fingerprint/openzeppelin_utils-mj395ivff1ffo/openzeppelin_utils +1 -0
- package/target/dev/.fingerprint/openzeppelin_utils-oh1hse8sjumgm/openzeppelin_utils +1 -0
- package/target/dev/.fingerprint/starkware_utils-1qnnjnq0pf9u0/starkware_utils +1 -0
- package/target/dev/.fingerprint/starkware_utils-mh8e3te65lju4/starkware_utils +1 -0
- package/target/dev/enumerable_set.sierra.json +1 -0
- package/target/dev/incremental/alexandria_bytes-5ea6u5t70d7qi.bin +0 -0
- package/target/dev/incremental/alexandria_data_structures-0aue3g6q80gs0.bin +0 -0
- package/target/dev/incremental/alexandria_math-h2fi7jdq4isuu.bin +0 -0
- package/target/dev/incremental/core-lq3u730l5p1ag.bin +0 -0
- package/target/dev/incremental/core-vf7fc6rvic5vi.bin +0 -0
- package/target/dev/incremental/enumerable_set-eaerkg8njl85o.bin +0 -0
- package/target/dev/incremental/enumerable_set-r54oje7t06ku8.bin +0 -0
- package/target/dev/incremental/layerzero-oqgdqsaddpi2k.bin +0 -0
- package/target/dev/incremental/lz_utils-kfkkeueiqg0pa.bin +0 -0
- package/target/dev/incremental/lz_utils-u4v1os6e7gkng.bin +0 -0
- package/target/dev/incremental/multisig-0fjetugejecge.bin +0 -0
- package/target/dev/incremental/multisig-6j5kqs436hm54.bin +0 -0
- package/target/dev/incremental/openzeppelin-ei1id1hu088lo.bin +0 -0
- package/target/dev/incremental/openzeppelin-j9d5nd1qhfnu6.bin +0 -0
- package/target/dev/incremental/openzeppelin_access-3oa41aikpaek0.bin +0 -0
- package/target/dev/incremental/openzeppelin_access-p5h849v8so76q.bin +0 -0
- package/target/dev/incremental/openzeppelin_account-4qhv5fks84g9u.bin +0 -0
- package/target/dev/incremental/openzeppelin_account-hgbm8ln9ah7rm.bin +0 -0
- package/target/dev/incremental/openzeppelin_finance-n70q9al0cps8i.bin +0 -0
- package/target/dev/incremental/openzeppelin_finance-nnd4f8703t3ak.bin +0 -0
- package/target/dev/incremental/openzeppelin_governance-3gnk21ubp5lis.bin +0 -0
- package/target/dev/incremental/openzeppelin_governance-rj1bfont4fij4.bin +0 -0
- package/target/dev/incremental/openzeppelin_introspection-3fja9hd1gvbcq.bin +0 -0
- package/target/dev/incremental/openzeppelin_introspection-jc3nf5525eet6.bin +0 -0
- package/target/dev/incremental/openzeppelin_merkle_tree-4en77ogr2r2l2.bin +0 -0
- package/target/dev/incremental/openzeppelin_merkle_tree-4t190frqs4db8.bin +0 -0
- package/target/dev/incremental/openzeppelin_presets-aqb0f6p9c0bp6.bin +0 -0
- package/target/dev/incremental/openzeppelin_presets-nseg8korhin8e.bin +0 -0
- package/target/dev/incremental/openzeppelin_security-g7p73ji1ih1qg.bin +0 -0
- package/target/dev/incremental/openzeppelin_security-qp5328v80452u.bin +0 -0
- package/target/dev/incremental/openzeppelin_token-jjf7tl9rphc6k.bin +0 -0
- package/target/dev/incremental/openzeppelin_token-r6s43vlpj6rqk.bin +0 -0
- package/target/dev/incremental/openzeppelin_upgrades-0dpbnre7engca.bin +0 -0
- package/target/dev/incremental/openzeppelin_upgrades-2sqgvbuv9s800.bin +0 -0
- package/target/dev/incremental/openzeppelin_utils-mj395ivff1ffo.bin +0 -0
- package/target/dev/incremental/openzeppelin_utils-oh1hse8sjumgm.bin +0 -0
- package/target/dev/incremental/starkware_utils-1qnnjnq0pf9u0.bin +0 -0
- package/target/dev/incremental/starkware_utils-mh8e3te65lju4.bin +0 -0
- package/target/dev/layerzero.starknet_artifacts.json +1 -0
- package/target/dev/layerzero_BlockedMessageLib.compiled_contract_class.json +1 -0
- package/target/dev/layerzero_BlockedMessageLib.contract_class.json +1 -0
- package/target/dev/layerzero_Dvn.compiled_contract_class.json +1 -0
- package/target/dev/layerzero_Dvn.contract_class.json +1 -0
- package/target/dev/layerzero_DvnFeeLib.compiled_contract_class.json +1 -0
- package/target/dev/layerzero_DvnFeeLib.contract_class.json +1 -0
- package/target/dev/layerzero_Endpoint.compiled_contract_class.json +1 -0
- package/target/dev/layerzero_Endpoint.contract_class.json +1 -0
- package/target/dev/layerzero_Executor.compiled_contract_class.json +1 -0
- package/target/dev/layerzero_Executor.contract_class.json +1 -0
- package/target/dev/layerzero_ExecutorFeeLib.compiled_contract_class.json +1 -0
- package/target/dev/layerzero_ExecutorFeeLib.contract_class.json +1 -0
- package/target/dev/layerzero_OApp.compiled_contract_class.json +1 -0
- package/target/dev/layerzero_OApp.contract_class.json +1 -0
- package/target/dev/layerzero_OFT.compiled_contract_class.json +1 -0
- package/target/dev/layerzero_OFT.contract_class.json +1 -0
- package/target/dev/layerzero_OFTAdapter.compiled_contract_class.json +1 -0
- package/target/dev/layerzero_OFTAdapter.contract_class.json +1 -0
- package/target/dev/layerzero_OmniCounter.compiled_contract_class.json +1 -0
- package/target/dev/layerzero_OmniCounter.contract_class.json +1 -0
- package/target/dev/layerzero_PriceFeed.compiled_contract_class.json +1 -0
- package/target/dev/layerzero_PriceFeed.contract_class.json +1 -0
- package/target/dev/layerzero_SimpleMessageLib.compiled_contract_class.json +1 -0
- package/target/dev/layerzero_SimpleMessageLib.contract_class.json +1 -0
- package/target/dev/layerzero_Treasury.compiled_contract_class.json +1 -0
- package/target/dev/layerzero_Treasury.contract_class.json +1 -0
- package/target/dev/layerzero_UltraLightNode.compiled_contract_class.json +1 -0
- package/target/dev/layerzero_UltraLightNode.contract_class.json +1 -0
- package/target/dev/lz_utils.sierra.json +1 -0
- package/target/dev/multisig.sierra.json +1 -0
- package/tools/update_contracts.sh +19 -0
- package/tsconfig.json +20 -0
- package/tsup.config.ts +7 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ultra-light-node.d.ts","sourceRoot":"","sources":["../../src/abis/ultra-light-node.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAm9kB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"ultra-light-node.js"}
|
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var ORE6VBZ4_cjs = require('./ORE6VBZ4.cjs');
|
|
4
|
+
var DFXLWHYP_cjs = require('./DFXLWHYP.cjs');
|
|
5
|
+
var UPJTM7BR_cjs = require('./UPJTM7BR.cjs');
|
|
6
|
+
var MUEN6AWV_cjs = require('./MUEN6AWV.cjs');
|
|
7
|
+
var Y5JFPCYJ_cjs = require('./Y5JFPCYJ.cjs');
|
|
8
|
+
var FFDPTOWG_cjs = require('./FFDPTOWG.cjs');
|
|
9
|
+
var VNVNX2P3_cjs = require('./VNVNX2P3.cjs');
|
|
10
|
+
var _5NEZDLVQ_cjs = require('./5NEZDLVQ.cjs');
|
|
11
|
+
var XYNBDBBV_cjs = require('./XYNBDBBV.cjs');
|
|
12
|
+
var _7C4PFMIZ_cjs = require('./7C4PFMIZ.cjs');
|
|
13
|
+
var ARHOGUYH_cjs = require('./ARHOGUYH.cjs');
|
|
14
|
+
var _4XD3ZRZ4_cjs = require('./4XD3ZRZ4.cjs');
|
|
15
|
+
var WU5L7YIQ_cjs = require('./WU5L7YIQ.cjs');
|
|
16
|
+
var DB7CQSED_cjs = require('./DB7CQSED.cjs');
|
|
17
|
+
require('./YJF4D23A.cjs');
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
Object.defineProperty(exports, "oftAdapterAbi", {
|
|
22
|
+
enumerable: true,
|
|
23
|
+
get: function () { return ORE6VBZ4_cjs.oftAdapterAbi; }
|
|
24
|
+
});
|
|
25
|
+
Object.defineProperty(exports, "oftAbi", {
|
|
26
|
+
enumerable: true,
|
|
27
|
+
get: function () { return DFXLWHYP_cjs.oftAbi; }
|
|
28
|
+
});
|
|
29
|
+
Object.defineProperty(exports, "omniCounterAbi", {
|
|
30
|
+
enumerable: true,
|
|
31
|
+
get: function () { return UPJTM7BR_cjs.omniCounterAbi; }
|
|
32
|
+
});
|
|
33
|
+
Object.defineProperty(exports, "priceFeedAbi", {
|
|
34
|
+
enumerable: true,
|
|
35
|
+
get: function () { return MUEN6AWV_cjs.priceFeedAbi; }
|
|
36
|
+
});
|
|
37
|
+
Object.defineProperty(exports, "simpleMessageLibAbi", {
|
|
38
|
+
enumerable: true,
|
|
39
|
+
get: function () { return Y5JFPCYJ_cjs.simpleMessageLibAbi; }
|
|
40
|
+
});
|
|
41
|
+
Object.defineProperty(exports, "treasuryAbi", {
|
|
42
|
+
enumerable: true,
|
|
43
|
+
get: function () { return FFDPTOWG_cjs.treasuryAbi; }
|
|
44
|
+
});
|
|
45
|
+
Object.defineProperty(exports, "ultraLightNodeAbi", {
|
|
46
|
+
enumerable: true,
|
|
47
|
+
get: function () { return VNVNX2P3_cjs.ultraLightNodeAbi; }
|
|
48
|
+
});
|
|
49
|
+
Object.defineProperty(exports, "blockedMessageLibAbi", {
|
|
50
|
+
enumerable: true,
|
|
51
|
+
get: function () { return _5NEZDLVQ_cjs.blockedMessageLibAbi; }
|
|
52
|
+
});
|
|
53
|
+
Object.defineProperty(exports, "dvnFeeLibAbi", {
|
|
54
|
+
enumerable: true,
|
|
55
|
+
get: function () { return XYNBDBBV_cjs.dvnFeeLibAbi; }
|
|
56
|
+
});
|
|
57
|
+
Object.defineProperty(exports, "dvnAbi", {
|
|
58
|
+
enumerable: true,
|
|
59
|
+
get: function () { return _7C4PFMIZ_cjs.dvnAbi; }
|
|
60
|
+
});
|
|
61
|
+
Object.defineProperty(exports, "endpointV2Abi", {
|
|
62
|
+
enumerable: true,
|
|
63
|
+
get: function () { return ARHOGUYH_cjs.endpointV2Abi; }
|
|
64
|
+
});
|
|
65
|
+
Object.defineProperty(exports, "executorFeeLibAbi", {
|
|
66
|
+
enumerable: true,
|
|
67
|
+
get: function () { return _4XD3ZRZ4_cjs.executorFeeLibAbi; }
|
|
68
|
+
});
|
|
69
|
+
Object.defineProperty(exports, "executorAbi", {
|
|
70
|
+
enumerable: true,
|
|
71
|
+
get: function () { return WU5L7YIQ_cjs.executorAbi; }
|
|
72
|
+
});
|
|
73
|
+
Object.defineProperty(exports, "oAppAbi", {
|
|
74
|
+
enumerable: true,
|
|
75
|
+
get: function () { return DB7CQSED_cjs.oAppAbi; }
|
|
76
|
+
});
|
|
77
|
+
//# sourceMappingURL=index.cjs.map
|
|
78
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.cjs"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export * from "./abis/blocked-message-lib.js";
|
|
2
|
+
export * from "./abis/dvn.js";
|
|
3
|
+
export * from "./abis/dvn-fee-lib.js";
|
|
4
|
+
export * from "./abis/endpoint-v2.js";
|
|
5
|
+
export * from "./abis/executor.js";
|
|
6
|
+
export * from "./abis/executor-fee-lib.js";
|
|
7
|
+
export * from "./abis/o-app.js";
|
|
8
|
+
export * from "./abis/oft.js";
|
|
9
|
+
export * from "./abis/oft-adapter.js";
|
|
10
|
+
export * from "./abis/omni-counter.js";
|
|
11
|
+
export * from "./abis/price-feed.js";
|
|
12
|
+
export * from "./abis/simple-message-lib.js";
|
|
13
|
+
export * from "./abis/treasury.js";
|
|
14
|
+
export * from "./abis/ultra-light-node.js";
|
|
15
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,+BAA+B,CAAC;AAC9C,cAAc,eAAe,CAAC;AAC9B,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,oBAAoB,CAAC;AACnC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,uBAAuB,CAAC;AACtC,cAAc,wBAAwB,CAAC;AACvC,cAAc,sBAAsB,CAAC;AACrC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,oBAAoB,CAAC;AACnC,cAAc,4BAA4B,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export { oftAdapterAbi } from './EOLZCMCK.js';
|
|
2
|
+
export { oftAbi } from './CRCRIUFX.js';
|
|
3
|
+
export { omniCounterAbi } from './IWIUMVGB.js';
|
|
4
|
+
export { priceFeedAbi } from './X3B5JDMZ.js';
|
|
5
|
+
export { simpleMessageLibAbi } from './OUFKWPZ7.js';
|
|
6
|
+
export { treasuryAbi } from './Z2NIUZMW.js';
|
|
7
|
+
export { ultraLightNodeAbi } from './7ZSGGZUE.js';
|
|
8
|
+
export { blockedMessageLibAbi } from './6JYCOKDE.js';
|
|
9
|
+
export { dvnFeeLibAbi } from './YEHL7IYO.js';
|
|
10
|
+
export { dvnAbi } from './WISWRTDG.js';
|
|
11
|
+
export { endpointV2Abi } from './FOJGEAIO.js';
|
|
12
|
+
export { executorFeeLibAbi } from './4Z5IPBC3.js';
|
|
13
|
+
export { executorAbi } from './T2QTYQXJ.js';
|
|
14
|
+
export { oAppAbi } from './YTS44OEA.js';
|
|
15
|
+
import './VUOMXK5T.js';
|
|
16
|
+
//# sourceMappingURL=index.js.map
|
|
17
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var YJF4D23A_cjs = require('../YJF4D23A.cjs');
|
|
4
|
+
var promises = require('fs/promises');
|
|
5
|
+
var path = require('path');
|
|
6
|
+
|
|
7
|
+
var targetDirectory = "target/dev";
|
|
8
|
+
var buildKebabCase = /* @__PURE__ */ YJF4D23A_cjs.__name((name) => name.replaceAll(/[A-Z]/g, (character) => `-${character.toLowerCase()}`).replace(/^-/, ""), "buildKebabCase");
|
|
9
|
+
var buildCamelCase = /* @__PURE__ */ YJF4D23A_cjs.__name((name) => name.replace(/^[A-Z]/, (character) => character.toLowerCase()), "buildCamelCase");
|
|
10
|
+
var main = /* @__PURE__ */ YJF4D23A_cjs.__name(async () => {
|
|
11
|
+
await promises.mkdir("src/abis", {
|
|
12
|
+
recursive: true
|
|
13
|
+
});
|
|
14
|
+
const contracts = (await promises.readdir(targetDirectory)).filter((path) => path.endsWith(".contract_class.json") && !path.includes("_tests_") && !path.includes("_unittest_")).map((path) => ({
|
|
15
|
+
name: path.replace("layerzero_", "").replace(".contract_class.json", "").replace("Endpoint", "EndpointV2").replace("OFT", "Oft"),
|
|
16
|
+
path
|
|
17
|
+
}));
|
|
18
|
+
for (const { name, path: path$1 } of contracts) {
|
|
19
|
+
const { abi } = JSON.parse(await promises.readFile(path.join(targetDirectory, path$1), "utf-8"));
|
|
20
|
+
await promises.writeFile(`src/abis/${buildKebabCase(name)}.ts`, `export const ${buildCamelCase(name)}Abi = ${JSON.stringify(abi)} as const`);
|
|
21
|
+
}
|
|
22
|
+
await promises.writeFile("src/index.ts", contracts.map(({ name }) => `export * from "./abis/${buildKebabCase(name)}.js";`).join("\n"));
|
|
23
|
+
}, "main");
|
|
24
|
+
main().catch((error) => {
|
|
25
|
+
throw error;
|
|
26
|
+
});
|
|
27
|
+
//# sourceMappingURL=build-abi.cjs.map
|
|
28
|
+
//# sourceMappingURL=build-abi.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/scripts/build-abi.ts"],"names":["targetDirectory","buildKebabCase","__name","name","replaceAll","character","toLowerCase","replace","buildCamelCase","main","mkdir","recursive","contracts","readdir","filter","path","endsWith","includes","map","abi","JSON","parse","readFile","join","writeFile","stringify","catch","error"],"mappings":";;;;;;AAGA,IAAMA,eAAAA,GAAkB,YAAA;AAExB,IAAMC,iCAAiBC,mBAAA,CAAA,CAACC,IAAAA,KACpBA,IAAAA,CAAKC,UAAAA,CAAW,UAAU,CAACC,SAAAA,KAAc,CAAA,CAAA,EAAIA,SAAAA,CAAUC,aAAW,CAAA,CAAI,EAAEC,OAAAA,CAAQ,IAAA,EAAM,EAAA,CAAA,EADnE,gBAAA,CAAA;AAGvB,IAAMC,cAAAA,mBAAiBN,mBAAA,CAAA,CAACC,IAAAA,KACpBA,IAAAA,CAAKI,OAAAA,CAAQ,QAAA,EAAU,CAACF,SAAAA,KAAcA,SAAAA,CAAUC,WAAAA,EAAW,CAAA,EADxC,gBAAA,CAAA;AAGvB,IAAMG,uBAAOP,mBAAA,CAAA,YAAA;AACT,EAAA,MAAMQ,eAAM,UAAA,EAAY;IAAEC,SAAAA,EAAW;GAAK,CAAA;AAE1C,EAAA,MAAMC,SAAAA,GAAAA,CAAa,MAAMC,gBAAAA,CAAQb,eAAAA,CAAAA,EAC5Bc,OACG,CAACC,IAAAA,KACGA,IAAAA,CAAKC,QAAAA,CAAS,sBAAA,CAAA,IACd,CAACD,IAAAA,CAAKE,QAAAA,CAAS,SAAA,CAAA,IACf,CAACF,IAAAA,CAAKE,QAAAA,CAAS,YAAA,CAAA,CAAA,CAEtBC,GAAAA,CAAI,CAACH,IAAAA,MAAU;AACZZ,IAAAA,IAAAA,EAAMY,IAAAA,CACDR,OAAAA,CAAQ,YAAA,EAAc,EAAA,EACtBA,OAAAA,CAAQ,sBAAA,EAAwB,EAAA,CAAA,CAChCA,QAAQ,UAAA,EAAY,YAAA,CAAA,CAEpBA,OAAAA,CAAQ,OAAO,KAAA,CAAA;AACpBQ,IAAAA;GACJ,CAAA,CAAA;AAEJ,EAAA,KAAA,MAAW,EAAEZ,IAAAA,QAAMY,MAAAA,EAAI,IAAMH,SAAAA,EAAW;AACpC,IAAA,MAAM,EAAEO,GAAAA,EAAG,GAAKC,IAAAA,CAAKC,KAAAA,CAAM,MAAMC,iBAAAA,CAASC,SAAAA,CAAKvB,eAAAA,EAAiBe,MAAAA,CAAAA,EAAO,OAAA,CAAA,CAAA;AAEvE,IAAA,MAAMS,kBAAAA,CACF,CAAA,SAAA,EAAYvB,cAAAA,CAAeE,IAAAA,CAAAA,CAAAA,GAAAA,CAAAA,EAC3B,CAAA,aAAA,EAAgBK,cAAAA,CAAeL,IAAAA,CAAAA,CAAAA,MAAAA,EAAciB,IAAAA,CAAKK,SAAAA,CAAUN,GAAAA,CAAAA,CAAAA,SAAAA,CAAe,CAAA;AAEnF,EAAA;AAEA,EAAA,MAAMK,mBACF,cAAA,EACAZ,SAAAA,CACKM,GAAAA,CAAI,CAAC,EAAEf,IAAAA,EAAI,KAAO,CAAA,sBAAA,EAAyBF,cAAAA,CAAeE,IAAAA,CAAAA,CAAAA,KAAAA,CAAY,CAAA,CACtEoB,IAAAA,CAAK,IAAA,CAAA,CAAA;AAElB,CAAA,EAnCa,MAAA,CAAA;AAqCbd,IAAAA,EAAAA,CAAOiB,KAAAA,CAAM,CAACC,KAAAA,KAAAA;AACV,EAAA,MAAMA,KAAAA;AACV,CAAA,CAAA","file":"build-abi.cjs","sourcesContent":["import { mkdir, readdir, readFile, writeFile } from 'node:fs/promises';\nimport { join } from 'node:path';\n\nconst targetDirectory = 'target/dev';\n\nconst buildKebabCase = (name: string): string =>\n name.replaceAll(/[A-Z]/g, (character) => `-${character.toLowerCase()}`).replace(/^-/, '');\n\nconst buildCamelCase = (name: string): string =>\n name.replace(/^[A-Z]/, (character) => character.toLowerCase());\n\nconst main = async () => {\n await mkdir('src/abis', { recursive: true });\n\n const contracts = (await readdir(targetDirectory))\n .filter(\n (path) =>\n path.endsWith('.contract_class.json') &&\n !path.includes('_tests_') &&\n !path.includes('_unittest_'),\n )\n .map((path) => ({\n name: path\n .replace('layerzero_', '')\n .replace('.contract_class.json', '')\n .replace('Endpoint', 'EndpointV2')\n // TODO Fix the Cairo code?\n .replace('OFT', 'Oft'),\n path,\n }));\n\n for (const { name, path } of contracts) {\n const { abi } = JSON.parse(await readFile(join(targetDirectory, path), 'utf-8'));\n\n await writeFile(\n `src/abis/${buildKebabCase(name)}.ts`,\n `export const ${buildCamelCase(name)}Abi = ${JSON.stringify(abi)} as const`,\n );\n }\n\n await writeFile(\n 'src/index.ts',\n contracts\n .map(({ name }) => `export * from \"./abis/${buildKebabCase(name)}.js\";`)\n .join('\\n'),\n );\n};\n\nmain().catch((error) => {\n throw error;\n});\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build-abi.d.ts","sourceRoot":"","sources":["../../src/scripts/build-abi.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { __name } from '../VUOMXK5T.js';
|
|
2
|
+
import { mkdir, readdir, readFile, writeFile } from 'node:fs/promises';
|
|
3
|
+
import { join } from 'node:path';
|
|
4
|
+
|
|
5
|
+
var targetDirectory = "target/dev";
|
|
6
|
+
var buildKebabCase = /* @__PURE__ */ __name((name) => name.replaceAll(/[A-Z]/g, (character) => `-${character.toLowerCase()}`).replace(/^-/, ""), "buildKebabCase");
|
|
7
|
+
var buildCamelCase = /* @__PURE__ */ __name((name) => name.replace(/^[A-Z]/, (character) => character.toLowerCase()), "buildCamelCase");
|
|
8
|
+
var main = /* @__PURE__ */ __name(async () => {
|
|
9
|
+
await mkdir("src/abis", {
|
|
10
|
+
recursive: true
|
|
11
|
+
});
|
|
12
|
+
const contracts = (await readdir(targetDirectory)).filter((path) => path.endsWith(".contract_class.json") && !path.includes("_tests_") && !path.includes("_unittest_")).map((path) => ({
|
|
13
|
+
name: path.replace("layerzero_", "").replace(".contract_class.json", "").replace("Endpoint", "EndpointV2").replace("OFT", "Oft"),
|
|
14
|
+
path
|
|
15
|
+
}));
|
|
16
|
+
for (const { name, path } of contracts) {
|
|
17
|
+
const { abi } = JSON.parse(await readFile(join(targetDirectory, path), "utf-8"));
|
|
18
|
+
await writeFile(`src/abis/${buildKebabCase(name)}.ts`, `export const ${buildCamelCase(name)}Abi = ${JSON.stringify(abi)} as const`);
|
|
19
|
+
}
|
|
20
|
+
await writeFile("src/index.ts", contracts.map(({ name }) => `export * from "./abis/${buildKebabCase(name)}.js";`).join("\n"));
|
|
21
|
+
}, "main");
|
|
22
|
+
main().catch((error) => {
|
|
23
|
+
throw error;
|
|
24
|
+
});
|
|
25
|
+
//# sourceMappingURL=build-abi.js.map
|
|
26
|
+
//# sourceMappingURL=build-abi.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/scripts/build-abi.ts"],"names":["targetDirectory","buildKebabCase","name","replaceAll","character","toLowerCase","replace","buildCamelCase","main","mkdir","recursive","contracts","readdir","filter","path","endsWith","includes","map","abi","JSON","parse","readFile","join","writeFile","stringify","catch","error"],"mappings":";;;;AAGA,IAAMA,eAAAA,GAAkB,YAAA;AAExB,IAAMC,iCAAiB,MAAA,CAAA,CAACC,IAAAA,KACpBA,IAAAA,CAAKC,UAAAA,CAAW,UAAU,CAACC,SAAAA,KAAc,CAAA,CAAA,EAAIA,SAAAA,CAAUC,aAAW,CAAA,CAAI,EAAEC,OAAAA,CAAQ,IAAA,EAAM,EAAA,CAAA,EADnE,gBAAA,CAAA;AAGvB,IAAMC,cAAAA,mBAAiB,MAAA,CAAA,CAACL,IAAAA,KACpBA,IAAAA,CAAKI,OAAAA,CAAQ,QAAA,EAAU,CAACF,SAAAA,KAAcA,SAAAA,CAAUC,WAAAA,EAAW,CAAA,EADxC,gBAAA,CAAA;AAGvB,IAAMG,uBAAO,MAAA,CAAA,YAAA;AACT,EAAA,MAAMC,MAAM,UAAA,EAAY;IAAEC,SAAAA,EAAW;GAAK,CAAA;AAE1C,EAAA,MAAMC,SAAAA,GAAAA,CAAa,MAAMC,OAAAA,CAAQZ,eAAAA,CAAAA,EAC5Ba,OACG,CAACC,IAAAA,KACGA,IAAAA,CAAKC,QAAAA,CAAS,sBAAA,CAAA,IACd,CAACD,IAAAA,CAAKE,QAAAA,CAAS,SAAA,CAAA,IACf,CAACF,IAAAA,CAAKE,QAAAA,CAAS,YAAA,CAAA,CAAA,CAEtBC,GAAAA,CAAI,CAACH,IAAAA,MAAU;AACZZ,IAAAA,IAAAA,EAAMY,IAAAA,CACDR,OAAAA,CAAQ,YAAA,EAAc,EAAA,EACtBA,OAAAA,CAAQ,sBAAA,EAAwB,EAAA,CAAA,CAChCA,QAAQ,UAAA,EAAY,YAAA,CAAA,CAEpBA,OAAAA,CAAQ,OAAO,KAAA,CAAA;AACpBQ,IAAAA;GACJ,CAAA,CAAA;AAEJ,EAAA,KAAA,MAAW,EAAEZ,IAAAA,EAAMY,IAAAA,EAAI,IAAMH,SAAAA,EAAW;AACpC,IAAA,MAAM,EAAEO,GAAAA,EAAG,GAAKC,IAAAA,CAAKC,KAAAA,CAAM,MAAMC,QAAAA,CAASC,IAAAA,CAAKtB,eAAAA,EAAiBc,IAAAA,CAAAA,EAAO,OAAA,CAAA,CAAA;AAEvE,IAAA,MAAMS,SAAAA,CACF,CAAA,SAAA,EAAYtB,cAAAA,CAAeC,IAAAA,CAAAA,CAAAA,GAAAA,CAAAA,EAC3B,CAAA,aAAA,EAAgBK,cAAAA,CAAeL,IAAAA,CAAAA,CAAAA,MAAAA,EAAciB,IAAAA,CAAKK,SAAAA,CAAUN,GAAAA,CAAAA,CAAAA,SAAAA,CAAe,CAAA;AAEnF,EAAA;AAEA,EAAA,MAAMK,UACF,cAAA,EACAZ,SAAAA,CACKM,GAAAA,CAAI,CAAC,EAAEf,IAAAA,EAAI,KAAO,CAAA,sBAAA,EAAyBD,cAAAA,CAAeC,IAAAA,CAAAA,CAAAA,KAAAA,CAAY,CAAA,CACtEoB,IAAAA,CAAK,IAAA,CAAA,CAAA;AAElB,CAAA,EAnCa,MAAA,CAAA;AAqCbd,IAAAA,EAAAA,CAAOiB,KAAAA,CAAM,CAACC,KAAAA,KAAAA;AACV,EAAA,MAAMA,KAAAA;AACV,CAAA,CAAA","file":"build-abi.js","sourcesContent":["import { mkdir, readdir, readFile, writeFile } from 'node:fs/promises';\nimport { join } from 'node:path';\n\nconst targetDirectory = 'target/dev';\n\nconst buildKebabCase = (name: string): string =>\n name.replaceAll(/[A-Z]/g, (character) => `-${character.toLowerCase()}`).replace(/^-/, '');\n\nconst buildCamelCase = (name: string): string =>\n name.replace(/^[A-Z]/, (character) => character.toLowerCase());\n\nconst main = async () => {\n await mkdir('src/abis', { recursive: true });\n\n const contracts = (await readdir(targetDirectory))\n .filter(\n (path) =>\n path.endsWith('.contract_class.json') &&\n !path.includes('_tests_') &&\n !path.includes('_unittest_'),\n )\n .map((path) => ({\n name: path\n .replace('layerzero_', '')\n .replace('.contract_class.json', '')\n .replace('Endpoint', 'EndpointV2')\n // TODO Fix the Cairo code?\n .replace('OFT', 'Oft'),\n path,\n }));\n\n for (const { name, path } of contracts) {\n const { abi } = JSON.parse(await readFile(join(targetDirectory, path), 'utf-8'));\n\n await writeFile(\n `src/abis/${buildKebabCase(name)}.ts`,\n `export const ${buildCamelCase(name)}Abi = ${JSON.stringify(abi)} as const`,\n );\n }\n\n await writeFile(\n 'src/index.ts',\n contracts\n .map(({ name }) => `export * from \"./abis/${buildKebabCase(name)}.js\";`)\n .join('\\n'),\n );\n};\n\nmain().catch((error) => {\n throw error;\n});\n"]}
|
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
# LayerZero V2 - Starknet Implementation
|
|
2
|
+
|
|
3
|
+
## Background & Motivation
|
|
4
|
+
|
|
5
|
+
The LayerZero V2-Starknet implementation maintains the same core architecture and functionality as LayerZero V2-EVM while adapting to Starknet's unique features and constraints. The protocol preserves LayerZero's core values of permissionlessness, immutability and censorship-resistance.
|
|
6
|
+
|
|
7
|
+
Starknet supports dynamic inter-contract calls via dispatcher interfaces, allowing LayerZero V2 to maintain its modular, runtime-configurable architecture. By using Dynamic Dispatchers we can allow pluggable message libs, independent workers and minimal protocol surface without needing complex workarounds or fundamental architectural changes.
|
|
8
|
+
|
|
9
|
+
The Starknet LayerZero implementation is architecturally very close to the EVM implementation, maintaining the same three-step messaging flow:
|
|
10
|
+
|
|
11
|
+
1. **Send**: OApp calls Endpoint with message parameters
|
|
12
|
+
2. **Verify**: DVNs verify messages and submit their validation to the message lib
|
|
13
|
+
3. **Commit**: Via a permissionless call, the message library asserts commitment requirements and commits payload hash to the endpoint
|
|
14
|
+
4. **Execute**: Via a permissionless call, the Endpoint delivers verified message to receiver
|
|
15
|
+
|
|
16
|
+
## Starknet Specific Changes
|
|
17
|
+
|
|
18
|
+
### Starknet Components vs EVM Abstract Contracts
|
|
19
|
+
|
|
20
|
+
Unlike EVM abstract contracts that function as inheritance-based blueprints allowing multiple implementations and complex inheritance hierarchies, Starknet components operate as modular add-ons that are directly embedded into a contract's bytecode at compile-time. While EVM abstract contracts can be inherited multiple times and combined in various ways, Starknet enforces a strict "one instance per component type per contract" limitation—meaning you cannot embed the same component multiple times within a single contract. Also note that the external interface of a component can be directly exposed on the contract integrating it by using the `#[abi(embed_v0)]` macro.
|
|
21
|
+
|
|
22
|
+
### Contract Upgrades
|
|
23
|
+
|
|
24
|
+
Starknet provides native upgradeability through the `replace_class_syscall` mechanism, where contract addresses remain stable while the underlying class implementation can be swapped via `replace_class`. Unlike Ethereum's proxy pattern that requires complex delegation logic, Starknet's approach directly updates the class hash associated with a contract instance. While our Endpoint and UltraLightNode contracts are intentionally immutable for security and stability, we've implemented upgradability in worker contracts (Pricefeed, DVN, and Executor). However, the upgrade mechanism in Starknet comes with critical storage layout constraints: since Starknet calculates storage slot locations by hashing variable names, renaming existing storage variables will cause them to map to entirely different storage slots, potentially leading to data loss or corruption. Additionally, reordering storage variables can disrupt the expected memory layout. To maintain upgrade safety, existing storage variables must never be renamed or reordered—new variables should only be appended to the storage structure, and deprecated variables should be left in place (though unused) to preserve the storage layout integrity across upgrades. This is why we have prefixes for the names of storage items of our upgradable components. (You can see an example of this at: `layerzero/src/workers/base/base.cairo`)
|
|
25
|
+
|
|
26
|
+
### Type/Serialization Compatibility
|
|
27
|
+
|
|
28
|
+
Cairo's type system is built on 252-bit field elements (felt252) as the fundamental storage unit, with all data types ultimately serialized to sequences of felt252 values. For cross-chain interoperability, we strategically maintain u256 types, which Cairo represents as structs containing two felt252 elements: the lower 128 bits in the first element and the upper 128 bits in the second. We utilize the ByteArray struct from the Alexandria Bytes package instead of `Array<felt252>` for string and byte sequence handling because ByteArray provides structured encoding with 31-byte chunks (bytes31) packed into felt252 elements, plus a pending word for remaining bytes and length metadata. This ensures matching serialization/deserialization that maintains data integrity across different blockchain environments, whereas raw `Array<felt252>` lacks the structured byte boundaries necessary for reliable cross-chain string encoding.
|
|
29
|
+
|
|
30
|
+
### Fee Handling
|
|
31
|
+
|
|
32
|
+
Starknet has no native value (equivalent of msg.value on Ethereum) attached to transactions, so we implement an allowance-based system using ERC20 tokens (STRK) for worker payments. The Endpoint validates allowances before processing and automatically refunds excess amounts to prevent misplacement of user funds.
|
|
33
|
+
|
|
34
|
+
## Motivation for LayerZero-Starknet Architecture
|
|
35
|
+
|
|
36
|
+
### Native Dynamic Dispatch
|
|
37
|
+
|
|
38
|
+
Starknet's built-in dispatcher system enables the protocol to call libraries and receivers directly by address through typed dispatchers, eliminating the need for complex proxy patterns or unsafe low-level calls. Starknet also enables developers to use SafeDispatchers to gracefully handle the possible errors thrown on inter-contracts calls.
|
|
39
|
+
|
|
40
|
+
### Component-Based Modularity
|
|
41
|
+
|
|
42
|
+
Components are the Starknet equivalent of adding abstract contracts, they have a modular approach where you can add the components you need, expose their entry points, and they can have their own storage variables.
|
|
43
|
+
|
|
44
|
+
The MessageLibManager Component maintains per-path send/receive library selections, enabling upgrades and library diversification without changing the Endpoint or OApps. This provides clean separation of concerns:
|
|
45
|
+
|
|
46
|
+
- **MessagingChannelComponent**: Manages nonces and payload tracking, provides skip-burn-nillify functionality
|
|
47
|
+
- **MessageLibManagerComponent**: Handles message library selection and configuration
|
|
48
|
+
- **MessagingComposerComponent**: Supports multi-step message composition (lzCompose)
|
|
49
|
+
- **OwnableComponent**: Provides access control (from OpenZeppelin)
|
|
50
|
+
- **ReentrancyGuardComponent**: Prevents reentrancy attacks (from OpenZeppelin)
|
|
51
|
+
|
|
52
|
+
### Worker Integration
|
|
53
|
+
|
|
54
|
+
DVNs and Executors integrate through standard interfaces and fee libraries, driving quoting and payment logic at the message library/worker layers, maintaining the same flexibility as the EVM implementation.
|
|
55
|
+
|
|
56
|
+
### Compose Support
|
|
57
|
+
|
|
58
|
+
Multi-step application flows (e.g., OFT compose) are supported through optional, standardized interfaces via the Endpoint, providing the same composability features as other LayerZero implementations while leveraging Starknet's type safety.
|
|
59
|
+
|
|
60
|
+
## Architecture Overview
|
|
61
|
+
|
|
62
|
+
### High-Level Architecture
|
|
63
|
+
|
|
64
|
+
The Starknet implementation of LayerZero V2 enables crosschain messaging with the core values of immutability, censorship resistance, and permissionless access. It allows configurable messaging with changeable message libraries and customized security with Decentralized Verifier Networks (DVNs), and facilitates crosschain execution of messages with permissionless Executors.
|
|
65
|
+
|
|
66
|
+
### Central Hub — Endpoint
|
|
67
|
+
|
|
68
|
+
**Files**: `src/endpoint/endpoint.cairo`, `src/endpoint/interfaces/endpoint.cairo`
|
|
69
|
+
|
|
70
|
+
**Responsibilities**: The Endpoint acts as the central router for messages, handling nonces, managing fees, emitting events, and coordinating delivery across various stages (send, quote, commit, lz_receive, send_compose).
|
|
71
|
+
|
|
72
|
+
**Components**:
|
|
73
|
+
|
|
74
|
+
- **message_lib_manager**: Responsible for selecting the appropriate send and receive libraries for each communication path.
|
|
75
|
+
- **messaging_channel**: Manages nonces and Endpoint IDs (EIDs).
|
|
76
|
+
- **composer**: Facilitates the composition of multi-step messages.
|
|
77
|
+
|
|
78
|
+
**Token Management**: The Endpoint also manages the LayerZero (LZ) token address, which enables users to pay the treasury fee in the LZ-token. This feature is currently implemented but disabled.
|
|
79
|
+
|
|
80
|
+
### Message Libraries
|
|
81
|
+
|
|
82
|
+
Message Libraries are crucial for defining the security characteristics of cross-chain communication.
|
|
83
|
+
|
|
84
|
+
#### ULN (Production): `src/message_lib/uln/ultra_light_node.cairo`
|
|
85
|
+
|
|
86
|
+
- Handles quoting, sending, verification by DVNs, and committing messages based on defined thresholds and confirmations.
|
|
87
|
+
- Manages per-path configurations, including required/optional DVNs, thresholds, confirmations, executor assignments, and parsing the worker options passed by the OApp.
|
|
88
|
+
- It also protects the amount of payment the Treasury can receive per message, making it impossible for the treasury contract to censor through high fees, and it doesn't allow the owner of the message lib contract to change Treasury to prevent future change of treasury that could gas bomb censor messages
|
|
89
|
+
|
|
90
|
+
#### SML (Testing): `src/message_lib/sml/simple_message_lib.cairo`
|
|
91
|
+
|
|
92
|
+
- A minimal security library primarily used for testing purposes, which emits PacketSent events.
|
|
93
|
+
|
|
94
|
+
### Treasury
|
|
95
|
+
|
|
96
|
+
The protocol's treasury is designed to receive payments for user messages and must remain immutable to prevent censorship through "gas bombing" on the native payment path. This design ensures future payment compatibility with LZ tokens and allows for a configurable ZRO (LZ-token) token fee address.
|
|
97
|
+
|
|
98
|
+
### Workers
|
|
99
|
+
|
|
100
|
+
Workers are an abstract entity that have an on-chain send/receive part, and an off-chain part which handles the connection between the source and destination blockchains. Here we lay out the details of their on-chain contracts.
|
|
101
|
+
|
|
102
|
+
#### DVN: `src/workers/dvn/`
|
|
103
|
+
|
|
104
|
+
- Offchain listeners of DVNs monitor source chains for outbound messages.
|
|
105
|
+
- On the receive side, each DVN independently verifies the message actually exists and adds current confirmations by calling `ULN.verify()`.
|
|
106
|
+
- ULN stores verification in a Verification struct: `{submitted: bool, confirmations: u64}`.
|
|
107
|
+
- **Fee Library**: On the send side, the DVN makes a cost calculation based on gas prices and configuration to charge the user for the delivery of the message.
|
|
108
|
+
|
|
109
|
+
#### Executor: `src/workers/executor/`
|
|
110
|
+
|
|
111
|
+
- Delivers messages by calling `endpoint.lz_receive()`, manages ERC20 (=native) value, and handles retry mechanisms and alerts.
|
|
112
|
+
- Apply native drop in the source chain (mechanism where you pay extra in source chain native to receive on destination chain native)
|
|
113
|
+
|
|
114
|
+
#### Price Feed: `src/workers/price_feed/`
|
|
115
|
+
|
|
116
|
+
- Provides gas and price quotes for fee calculations.
|
|
117
|
+
|
|
118
|
+
#### Treasury: `src/treasury/`
|
|
119
|
+
|
|
120
|
+
- Quotes fees for the protocol. Also allows future payment in lz token by calling a configurable contract address called the lzTokenFeeLibrary
|
|
121
|
+
|
|
122
|
+
### OApps (Application Layer)
|
|
123
|
+
|
|
124
|
+
OApps represent the application layer built on top of LayerZero V2.
|
|
125
|
+
|
|
126
|
+
#### OApp Core: `src/oapps/oapp/oapp_core.cairo`
|
|
127
|
+
|
|
128
|
+
- Provides integration with the Endpoint, manages peer mappings, defines standardized lz_receive hooks, and handles access control.
|
|
129
|
+
|
|
130
|
+
#### OFTs (Omnichain Fungible Tokens): `src/oapps/oft/`
|
|
131
|
+
|
|
132
|
+
- Supports native mint/burn model (`oft.cairo`) or adapter-based lock/unlock model (`oft_adapter.cairo`), including shared-decimal handling in `oft_core.cairo`.
|
|
133
|
+
|
|
134
|
+
#### Options Type 3: `src/oapps/common/oapp_options_type_3/`
|
|
135
|
+
|
|
136
|
+
- Defines execution options and compose functionality.
|
|
137
|
+
|
|
138
|
+
### Common Primitives
|
|
139
|
+
|
|
140
|
+
- `src/common/`: Contains fundamental components such as packet encoding/decoding (`packet_v1_codec.cairo`), generating Global Unique Identifiers (GUIDs), type conversions, constants, and core data structures (`packet.cairo`, `messaging.cairo`).
|
|
141
|
+
|
|
142
|
+
### Utils `libs/`
|
|
143
|
+
|
|
144
|
+
- `libs/`: Contains Multisig, Error, Big endian keccak related logic that is reused in Onesig Starknet and Layerzero endpoint (identical code between OneSig-Starknet and LayerZero V2-Starknet, will soon be moved to a common package)
|
|
145
|
+
|
|
146
|
+
## End-to-End Flow (High Level)
|
|
147
|
+
|
|
148
|
+
### Send Flow (Source Chain)
|
|
149
|
+
|
|
150
|
+
1. User -> OApp quote for worker native fees
|
|
151
|
+
2. User -> Native Token / LZ token ERC20 approve amount quoted to OApp
|
|
152
|
+
3. User -> OApp -> Endpoint -> Message lib -> Workers
|
|
153
|
+
4. User calls send.
|
|
154
|
+
5. OApp receives token and gives allowance to Endpoint calls send
|
|
155
|
+
6. The Endpoint forwards it to a Message Library (e.g., ULN).
|
|
156
|
+
7. The Message Library quotes and emits a `DvnFeesPaid`, `ExecutorFeePaid`, `TreasuryFeePaid` events
|
|
157
|
+
8. The Endpoint pays the workers based on receipts returned by the ULN and emits `PacketSent` which is observed and acted upon offchain
|
|
158
|
+
|
|
159
|
+
### Receive Flow (Destination Chain)
|
|
160
|
+
|
|
161
|
+
1. DVN -> ULN, verify independently the message.
|
|
162
|
+
2. ULN -> Endpoint , commit Executor permissionless calls commit on ULN
|
|
163
|
+
3. Executor -> Endpoint -> OApp, execute calls lz_receive
|
|
164
|
+
4. The OApp processes the received message.
|
|
165
|
+
|
|
166
|
+
### Compose flow (Optional)
|
|
167
|
+
|
|
168
|
+
1. During lz_receive, the OApp may enqueue a compose via `MessagingComposer.send_compose(to, guid, index, message)`.
|
|
169
|
+
2. Later, the Executor calls `MessagingComposer.lz_compose(from, to, guid, index, message, extra_data, value)`.
|
|
170
|
+
3. Composer verifies the message hash, marks it received, optionally transfers compose-token value, and calls target `ILayerZeroComposer.lz_compose(...)`.
|
|
171
|
+
4. Target contract executes compose logic; `ComposeDelivered` or `LzComposeAlert` is emitted.
|
|
172
|
+
5. The compose flow is complete after the target contract executes its logic and an event is emitted.
|
|
173
|
+
|
|
174
|
+
### Native Drop (Executor)
|
|
175
|
+
|
|
176
|
+
- User adds native drop options and pays extra on source chain
|
|
177
|
+
- Executor on destination chain pays in native to specified addresses
|
|
178
|
+
|
|
179
|
+
### Skip (OApp)
|
|
180
|
+
|
|
181
|
+
- **Purpose**: Increment inbound nonce without execution (recover from stuck messages)
|
|
182
|
+
- **Process**: `MessagingChannel.skip()` → updates `lazy_inbound_nonce` → emits `InboundNonceSkipped`
|
|
183
|
+
- **Use**: Stuck messages, unwanted messages, nonce gaps
|
|
184
|
+
- **Security**: Must be sequential, authorized only
|
|
185
|
+
|
|
186
|
+
### Burn (OApp)
|
|
187
|
+
|
|
188
|
+
- **Purpose**: Mark verified message as unexecutable
|
|
189
|
+
- **Process**: Sets payload hash to `NIL_PAYLOAD_HASH` → prevents execution but preserves verification
|
|
190
|
+
- **Use**: Vulnerable payloads, incident response, malicious messages
|
|
191
|
+
- **Security**: Requires current payload hash, cannot nillify executed messages, authorized only
|
|
192
|
+
|
|
193
|
+
### Nilify (OApp)
|
|
194
|
+
|
|
195
|
+
- **Purpose**: Permanently destroy message (irreversible)
|
|
196
|
+
- **Process**: Sets payload hash to `EMPTY_PAYLOAD_HASH` → never re-verifiable/executable
|
|
197
|
+
- **Use**: Malicious messages, compromised scenarios, storage cleanup
|
|
198
|
+
- **Security**: Irreversible, requires current payload hash, authorized only
|
|
199
|
+
|
|
200
|
+
## Payments
|
|
201
|
+
|
|
202
|
+
### Quote and Pay
|
|
203
|
+
|
|
204
|
+
Message Libraries return the payees for workers. The Endpoint pulls fees from the OApp's allowance and pays the workers, refunding any excess.
|
|
205
|
+
|
|
206
|
+
### Native vs. LZ Token
|
|
207
|
+
|
|
208
|
+
The native token payment path is fully functional, while the LZ token path requires a contract for LZ token fee payment logic which is set on Treasury
|
|
209
|
+
|
|
210
|
+
## Data Model
|
|
211
|
+
|
|
212
|
+
- **Packet**: Contains essential information about a message, including nonce, source/destination EIDs, sender/receiver addresses, GUID, and payload.
|
|
213
|
+
- **MessagingParams**: Defines parameters for message sending, such as destination EID, receiver, message content, options, and a flag for LZ-token payments.
|
|
214
|
+
- **Origin**: Specifies the source EID, sender address, and nonce for a message.
|
|
215
|
+
|
|
216
|
+
## Extensibility and Configuration
|
|
217
|
+
|
|
218
|
+
- **Per-Path Libraries**: The message_lib_manager dynamically selects send/receive libraries based on the peer EID and OApp address.
|
|
219
|
+
- **ULN Configurations**: The ULN allows for granular configuration, including DVN sets, verification thresholds, confirmation requirements, and executor assignments per receiver or source path.
|
|
220
|
+
- **Options**: Message options are split into executor and DVN sub-options and support message composition.
|
|
221
|
+
|
|
222
|
+
## Directory Structure
|
|
223
|
+
|
|
224
|
+
```text
|
|
225
|
+
├── endpoint/ # Endpoint contract and components
|
|
226
|
+
│ ├── interfaces/ # Interfaces related to endpoint
|
|
227
|
+
│ ├── message_lib_manager/ # Message lib managing component
|
|
228
|
+
│ ├── messaging_channel/ # Messaging Channel component
|
|
229
|
+
│ └── messaging_composer/ # Messaging Composer component
|
|
230
|
+
├── message_lib/ # Message libs
|
|
231
|
+
│ ├── sml/ # Simple Message Library (testing)
|
|
232
|
+
│ └── uln/ # Ultra Light Node (production)
|
|
233
|
+
├── oapps/ # Omnichain application framework
|
|
234
|
+
│ ├── counter/ # Example counter app
|
|
235
|
+
│ ├── oapp/ # Base omnichain applications
|
|
236
|
+
│ └── oft/ # Omnichain fungible tokens
|
|
237
|
+
├── workers/ # Off-chain infrastructure contracts
|
|
238
|
+
│ ├── base/ # Base worker components
|
|
239
|
+
│ ├── dvn/ # Data verification networks
|
|
240
|
+
│ ├── executor/ # Message execution & delivery
|
|
241
|
+
│ └── price_feed/ # Gas price estimation
|
|
242
|
+
├── treasury/ # Fee collection & worker payments
|
|
243
|
+
└── common/ # Shared utilities & data structures
|
|
244
|
+
```
|