@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,152 @@
|
|
|
1
|
+
//! DVN Fee Library contract implementation
|
|
2
|
+
|
|
3
|
+
/// DVN Fee Library contract
|
|
4
|
+
///
|
|
5
|
+
/// This contract handles fee calculations for DVN operations, separated from the main DVN logic
|
|
6
|
+
/// to provide modularity and easier maintenance of fee-related functionality.
|
|
7
|
+
#[starknet::contract]
|
|
8
|
+
pub mod DvnFeeLib {
|
|
9
|
+
use openzeppelin::access::ownable::OwnableComponent;
|
|
10
|
+
use openzeppelin::token::erc20::interface::{IERC20Dispatcher, IERC20DispatcherTrait};
|
|
11
|
+
use starknet::ContractAddress;
|
|
12
|
+
use starknet::storage::StoragePointerWriteAccess;
|
|
13
|
+
use starkware_utils::errors::assert_with_byte_array;
|
|
14
|
+
use crate::workers::common::apply_premium_and_floor_margin;
|
|
15
|
+
use crate::workers::dvn::constants::{EXECUTE_FIXED_BYTES, SIGNATURE_RAW_BYTES, VERIFY_BYTES};
|
|
16
|
+
use crate::workers::dvn::errors;
|
|
17
|
+
use crate::workers::dvn::fee_lib::interface::{FeeParams, IDvnFeeLib};
|
|
18
|
+
use crate::workers::dvn::structs::DstConfig;
|
|
19
|
+
use crate::workers::price_feed::interface::{
|
|
20
|
+
ILayerZeroPriceFeedDispatcher, ILayerZeroPriceFeedDispatcherTrait,
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
////////////////
|
|
24
|
+
// Components //
|
|
25
|
+
////////////////
|
|
26
|
+
|
|
27
|
+
component!(path: OwnableComponent, storage: ownable, event: OwnableEvent);
|
|
28
|
+
|
|
29
|
+
////////////////
|
|
30
|
+
// Embeddings //
|
|
31
|
+
////////////////
|
|
32
|
+
|
|
33
|
+
#[abi(embed_v0)]
|
|
34
|
+
impl OwnableImpl = OwnableComponent::OwnableImpl<ContractState>;
|
|
35
|
+
impl OwnableInternalImpl = OwnableComponent::InternalImpl<ContractState>;
|
|
36
|
+
|
|
37
|
+
#[storage]
|
|
38
|
+
struct Storage {
|
|
39
|
+
#[substorage(v0)]
|
|
40
|
+
ownable: OwnableComponent::Storage,
|
|
41
|
+
/// Local endpoint ID v2
|
|
42
|
+
local_eid_v2: u32,
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
#[event]
|
|
46
|
+
#[derive(Drop, starknet::Event)]
|
|
47
|
+
pub enum Event {
|
|
48
|
+
#[flat]
|
|
49
|
+
OwnableEvent: OwnableComponent::Event,
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
#[constructor]
|
|
53
|
+
fn constructor(ref self: ContractState, local_eid_v2: u32, owner: ContractAddress) {
|
|
54
|
+
// Initialize ownable component
|
|
55
|
+
self.ownable.initializer(owner);
|
|
56
|
+
|
|
57
|
+
// Set immutable values
|
|
58
|
+
self.local_eid_v2.write(local_eid_v2);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
#[abi(embed_v0)]
|
|
62
|
+
impl DvnFeeLibImpl of IDvnFeeLib<ContractState> {
|
|
63
|
+
// ================================== Only Owner =====================================
|
|
64
|
+
|
|
65
|
+
fn withdraw_token(
|
|
66
|
+
ref self: ContractState,
|
|
67
|
+
token_address: ContractAddress,
|
|
68
|
+
to: ContractAddress,
|
|
69
|
+
amount: u256,
|
|
70
|
+
) {
|
|
71
|
+
self.ownable.assert_only_owner();
|
|
72
|
+
let token_dispatcher = IERC20Dispatcher { contract_address: token_address };
|
|
73
|
+
|
|
74
|
+
// NOTE: (from https://docs.openzeppelin.com/contracts-cairo/1.0.0/erc20)
|
|
75
|
+
// transfer, transfer_from and approve will never return anything different from true
|
|
76
|
+
// because they will revert on any error.
|
|
77
|
+
token_dispatcher.transfer(to, amount);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
// ================================== External =====================================
|
|
81
|
+
|
|
82
|
+
fn get_fee_on_send(
|
|
83
|
+
ref self: ContractState, params: FeeParams, dst_config: DstConfig, options: ByteArray,
|
|
84
|
+
) -> u256 {
|
|
85
|
+
self.get_fee(params, dst_config, options)
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
// ================================== View =====================================
|
|
89
|
+
|
|
90
|
+
fn get_fee(
|
|
91
|
+
self: @ContractState, params: FeeParams, dst_config: DstConfig, options: ByteArray,
|
|
92
|
+
) -> u256 {
|
|
93
|
+
// Check if destination is supported
|
|
94
|
+
assert_with_byte_array(
|
|
95
|
+
dst_config.gas > 0, errors::err_eid_not_supported(params.dst_eid),
|
|
96
|
+
);
|
|
97
|
+
|
|
98
|
+
// Validate options (currently just check it's empty like in original DVN)
|
|
99
|
+
assert_with_byte_array(options.len() == 0, errors::err_invalid_dvn_options(0));
|
|
100
|
+
|
|
101
|
+
// NOTE: Deviation from EVM spec, we don't parse the DVN options here because
|
|
102
|
+
// They're only used in pre-crime and the value is not actually used.
|
|
103
|
+
// Therefore don't currently see the value in implementing the parsing logic here.
|
|
104
|
+
|
|
105
|
+
// Calculate call data size
|
|
106
|
+
let calldata_size = self._get_calldata_size(params.quorum);
|
|
107
|
+
|
|
108
|
+
// Get price feed estimate
|
|
109
|
+
let price_feed = ILayerZeroPriceFeedDispatcher { contract_address: params.price_feed };
|
|
110
|
+
let estimated_fee = price_feed
|
|
111
|
+
.estimate_fee_on_send(params.dst_eid, calldata_size, dst_config.gas.into());
|
|
112
|
+
|
|
113
|
+
// Apply premium and return
|
|
114
|
+
apply_premium_and_floor_margin(
|
|
115
|
+
estimated_fee.gas_fee,
|
|
116
|
+
dst_config.multiplier_bps,
|
|
117
|
+
params.default_multiplier_bps,
|
|
118
|
+
dst_config.floor_margin_usd,
|
|
119
|
+
estimated_fee.native_price_usd,
|
|
120
|
+
)
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
fn version(self: @ContractState) -> (u64, u8) {
|
|
124
|
+
(1, 1)
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
#[generate_trait]
|
|
129
|
+
impl InternalImpl of InternalTrait {
|
|
130
|
+
/// Get the call data size for the quote function
|
|
131
|
+
///
|
|
132
|
+
/// # Arguments
|
|
133
|
+
///
|
|
134
|
+
/// * `quorum` - The quorum for the multisig
|
|
135
|
+
///
|
|
136
|
+
/// # Returns
|
|
137
|
+
///
|
|
138
|
+
/// * `u32` - The call data size given the quorum amount of signatures
|
|
139
|
+
fn _get_calldata_size(self: @ContractState, quorum: u32) -> u32 {
|
|
140
|
+
const NUM_BYTES: u32 = 32;
|
|
141
|
+
let mut total_signatures_bytes = quorum * SIGNATURE_RAW_BYTES.into();
|
|
142
|
+
|
|
143
|
+
if total_signatures_bytes % NUM_BYTES != 0 {
|
|
144
|
+
total_signatures_bytes = total_signatures_bytes
|
|
145
|
+
- (total_signatures_bytes % NUM_BYTES)
|
|
146
|
+
+ NUM_BYTES;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
EXECUTE_FIXED_BYTES + VERIFY_BYTES + total_signatures_bytes + NUM_BYTES
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
//! DVN Fee Lib interface
|
|
2
|
+
|
|
3
|
+
use starknet::ContractAddress;
|
|
4
|
+
use crate::workers::dvn::structs::DstConfig;
|
|
5
|
+
|
|
6
|
+
/// Fee parameters for DVN fee calculation
|
|
7
|
+
#[derive(Drop, Clone, Serde)]
|
|
8
|
+
pub struct FeeParams {
|
|
9
|
+
pub price_feed: ContractAddress,
|
|
10
|
+
pub dst_eid: u32,
|
|
11
|
+
pub confirmations: u64,
|
|
12
|
+
pub sender: ContractAddress,
|
|
13
|
+
pub quorum: u32,
|
|
14
|
+
pub default_multiplier_bps: u16,
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/// Interface for DVN Fee Library
|
|
18
|
+
#[starknet::interface]
|
|
19
|
+
pub trait IDvnFeeLib<TContractState> {
|
|
20
|
+
// ================================== Only Owner =====================================
|
|
21
|
+
|
|
22
|
+
/// Withdraw tokens from the fee lib
|
|
23
|
+
/// Enables recovery of funds accidentally sent
|
|
24
|
+
fn withdraw_token(
|
|
25
|
+
ref self: TContractState, token_address: ContractAddress, to: ContractAddress, amount: u256,
|
|
26
|
+
);
|
|
27
|
+
|
|
28
|
+
// ================================== External =====================================
|
|
29
|
+
|
|
30
|
+
/// Get fee function that can change state (e.g. paying price feed)
|
|
31
|
+
fn get_fee_on_send(
|
|
32
|
+
ref self: TContractState, params: FeeParams, dst_config: DstConfig, options: ByteArray,
|
|
33
|
+
) -> u256;
|
|
34
|
+
|
|
35
|
+
// ================================== View =====================================
|
|
36
|
+
|
|
37
|
+
/// Get fee view function
|
|
38
|
+
fn get_fee(
|
|
39
|
+
self: @TContractState, params: FeeParams, dst_config: DstConfig, options: ByteArray,
|
|
40
|
+
) -> u256;
|
|
41
|
+
|
|
42
|
+
/// Get version
|
|
43
|
+
/// Returns (major, minor)
|
|
44
|
+
fn version(self: @TContractState) -> (u64, u8);
|
|
45
|
+
}
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
//! DVN interface
|
|
2
|
+
|
|
3
|
+
use lz_utils::bytes::Bytes32;
|
|
4
|
+
use starknet::ClassHash;
|
|
5
|
+
use starknet::account::Call;
|
|
6
|
+
use crate::workers::dvn::structs::{DstConfig, ExecuteParam, SetDstConfigParams};
|
|
7
|
+
|
|
8
|
+
/// Interface for the DVN contract
|
|
9
|
+
#[starknet::interface]
|
|
10
|
+
pub trait IDvn<TContractState> {
|
|
11
|
+
// ================================== Only Admin =====================================
|
|
12
|
+
|
|
13
|
+
/// Set the destination configurations for multiple EIDs
|
|
14
|
+
///
|
|
15
|
+
/// # Arguments
|
|
16
|
+
///
|
|
17
|
+
/// * `params` - Array of parameters for setting the destination configuration
|
|
18
|
+
///
|
|
19
|
+
/// # Access Control
|
|
20
|
+
///
|
|
21
|
+
/// * Only admins can call this function
|
|
22
|
+
///
|
|
23
|
+
/// # Events
|
|
24
|
+
///
|
|
25
|
+
/// * `DstConfigSet` - Emitted when the destination configuration is set
|
|
26
|
+
fn set_dst_config(ref self: TContractState, params: Array<SetDstConfigParams>);
|
|
27
|
+
|
|
28
|
+
/// Execute jobs
|
|
29
|
+
///
|
|
30
|
+
/// # Arguments
|
|
31
|
+
///
|
|
32
|
+
/// * `params` - Array of parameters for executing the jobs
|
|
33
|
+
///
|
|
34
|
+
/// # Access Control
|
|
35
|
+
///
|
|
36
|
+
/// * Only admins can call this function
|
|
37
|
+
///
|
|
38
|
+
/// # Events
|
|
39
|
+
///
|
|
40
|
+
/// * `VerifySignaturesFailed` - Emitted when the signatures verification fails
|
|
41
|
+
/// * `HashAlreadyUsed` - Emitted when the hash is already used
|
|
42
|
+
/// * `ExecuteFailed` - Emitted when the job execution fails
|
|
43
|
+
fn execute(ref self: TContractState, params: Array<ExecuteParam>);
|
|
44
|
+
|
|
45
|
+
// ================================== Only Quorum =====================================
|
|
46
|
+
|
|
47
|
+
/// Function for quorum to change the admin without going through the execute function
|
|
48
|
+
///
|
|
49
|
+
/// # Arguments
|
|
50
|
+
///
|
|
51
|
+
/// * `param` - Parameter for changing the admin
|
|
52
|
+
///
|
|
53
|
+
/// # Access Control
|
|
54
|
+
///
|
|
55
|
+
/// * Anyone can call this function, but it will only succeed with a quorum of signatures
|
|
56
|
+
///
|
|
57
|
+
/// # Events
|
|
58
|
+
///
|
|
59
|
+
/// * `RoleGranted` - Emitted when the admin role is granted (from OpenZeppelin's
|
|
60
|
+
/// [`AccessControlComponent`])
|
|
61
|
+
fn quorum_change_admin(ref self: TContractState, param: ExecuteParam);
|
|
62
|
+
|
|
63
|
+
// ================================== Only Self =====================================
|
|
64
|
+
|
|
65
|
+
/// Upgrade the contract
|
|
66
|
+
///
|
|
67
|
+
/// # Arguments
|
|
68
|
+
///
|
|
69
|
+
/// * `new_class_hash` - The new class hash to upgrade to
|
|
70
|
+
///
|
|
71
|
+
/// # Events
|
|
72
|
+
///
|
|
73
|
+
/// * `Upgraded` - Emitted when the contract is upgraded (from OpenZeppelin's
|
|
74
|
+
/// [`UpgradeableComponent`])
|
|
75
|
+
///
|
|
76
|
+
/// @dev Only the contract itself can call this function (enforced by multisig)
|
|
77
|
+
fn upgrade(ref self: TContractState, new_class_hash: ClassHash);
|
|
78
|
+
|
|
79
|
+
/// Upgrade the contract and call a function
|
|
80
|
+
///
|
|
81
|
+
/// # Arguments
|
|
82
|
+
///
|
|
83
|
+
/// * `new_class_hash` - The new class hash to upgrade to
|
|
84
|
+
/// * `selector` - The selector to call
|
|
85
|
+
/// * `data` - The data to pass to the function
|
|
86
|
+
///
|
|
87
|
+
/// # Returns
|
|
88
|
+
///
|
|
89
|
+
/// * `Span<felt252>` - The response data from the function call
|
|
90
|
+
///
|
|
91
|
+
/// # Events
|
|
92
|
+
///
|
|
93
|
+
/// * `Upgraded` - Emitted when the contract is upgraded (from OpenZeppelin's
|
|
94
|
+
/// [`UpgradeableComponent`])
|
|
95
|
+
///
|
|
96
|
+
/// @dev Only the contract itself can call this function (enforced by multisig)
|
|
97
|
+
fn upgrade_and_call(
|
|
98
|
+
ref self: TContractState,
|
|
99
|
+
new_class_hash: ClassHash,
|
|
100
|
+
selector: felt252,
|
|
101
|
+
calldata: Span<felt252>,
|
|
102
|
+
) -> Span<felt252>;
|
|
103
|
+
|
|
104
|
+
// ================================== View ==========================================
|
|
105
|
+
|
|
106
|
+
/// Get the destination configuration
|
|
107
|
+
///
|
|
108
|
+
/// # Arguments
|
|
109
|
+
///
|
|
110
|
+
/// * `dst_eid` - The destination EID
|
|
111
|
+
///
|
|
112
|
+
/// # Returns
|
|
113
|
+
///
|
|
114
|
+
/// * `DstConfig` - The destination configuration
|
|
115
|
+
fn get_dst_config(self: @TContractState, dst_eid: u32) -> DstConfig;
|
|
116
|
+
|
|
117
|
+
/// Hash the call data
|
|
118
|
+
///
|
|
119
|
+
/// # Arguments
|
|
120
|
+
///
|
|
121
|
+
/// * `vid` - The VID of the call data
|
|
122
|
+
/// * `call_data` - The call data
|
|
123
|
+
/// * `expiration` - The expiration of the call data
|
|
124
|
+
///
|
|
125
|
+
/// # Returns
|
|
126
|
+
///
|
|
127
|
+
/// * `Bytes32` - The keccak hash of the arguments
|
|
128
|
+
fn hash_call_data(
|
|
129
|
+
self: @TContractState, vid: u32, call_data: Call, expiration: u256,
|
|
130
|
+
) -> Bytes32;
|
|
131
|
+
}
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
//! DVN options
|
|
2
|
+
|
|
3
|
+
use alexandria_bytes::byte_array_ext::ByteArrayTraitExt;
|
|
4
|
+
use core::byte_array::ByteArray;
|
|
5
|
+
use core::dict::{Felt252Dict, Felt252DictEntryTrait};
|
|
6
|
+
use core::nullable::{FromNullableResult, NullableTrait, match_nullable};
|
|
7
|
+
use starkware_utils::errors::assert_with_byte_array;
|
|
8
|
+
use crate::workers::dvn::errors::err_invalid_dvn_options;
|
|
9
|
+
use crate::workers::dvn::structs::DvnOption;
|
|
10
|
+
|
|
11
|
+
// Constants
|
|
12
|
+
pub const DVN_WORKER_ID: u8 = 2;
|
|
13
|
+
pub const OPTION_TYPE_PRECRIME: u8 = 1;
|
|
14
|
+
|
|
15
|
+
/// Group DVN options by their index
|
|
16
|
+
///
|
|
17
|
+
/// # Arguments
|
|
18
|
+
/// * `options` - The DVN options in format: [worker_id][dvn_option][worker_id][dvn_option]...
|
|
19
|
+
/// where dvn_option = [option_size][dvn_idx][option_type][option]
|
|
20
|
+
/// option_size = len(dvn_idx) + len(option_type) + len(option)
|
|
21
|
+
/// worker_id: u8, dvn_idx: u8, option_size: u16, option_type: u8, option: bytes
|
|
22
|
+
///
|
|
23
|
+
/// # Returns
|
|
24
|
+
/// * `Felt252Dict<Nullable<ByteArray>>` - The grouped options and their indices
|
|
25
|
+
pub fn group_dvn_options_by_idx(options: @ByteArray) -> Felt252Dict<Nullable<ByteArray>> {
|
|
26
|
+
let mut ret: Felt252Dict<Nullable<ByteArray>> = Default::default();
|
|
27
|
+
if options.len() == 0 {
|
|
28
|
+
return ret;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
let mut cursor: usize = 0;
|
|
32
|
+
|
|
33
|
+
while cursor != options.len() {
|
|
34
|
+
let DvnOption {
|
|
35
|
+
option_size, dvn_index, option_type, option_data, cursor: new_cursor,
|
|
36
|
+
} = next_dvn_option(options, cursor);
|
|
37
|
+
let option = post_process_option(option_size, dvn_index, option_type, @option_data);
|
|
38
|
+
|
|
39
|
+
// Get the existing entry for this dvn_index
|
|
40
|
+
let (entry, prev_value) = ret.entry(dvn_index.into());
|
|
41
|
+
|
|
42
|
+
// Combine the new option with any existing options for this dvn_index
|
|
43
|
+
let combined_options = match match_nullable(prev_value) {
|
|
44
|
+
FromNullableResult::Null => option,
|
|
45
|
+
FromNullableResult::NotNull(existing) => {
|
|
46
|
+
let mut result = existing.unbox();
|
|
47
|
+
result.append(@option);
|
|
48
|
+
result
|
|
49
|
+
},
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
// Store the combined options back in the dictionary
|
|
53
|
+
ret = entry.finalize(NullableTrait::new(combined_options));
|
|
54
|
+
cursor = new_cursor;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
ret
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/// Post-process the option - prefixes other args to the option data
|
|
61
|
+
///
|
|
62
|
+
/// # Arguments
|
|
63
|
+
///
|
|
64
|
+
/// * `option_size` - The size of the option
|
|
65
|
+
///
|
|
66
|
+
/// * `dvn_index` - The index of the DVN
|
|
67
|
+
///
|
|
68
|
+
/// * `option_type` - The type of the option (e.g. PRECRIME)
|
|
69
|
+
///
|
|
70
|
+
/// * `option_data` - The data of the option
|
|
71
|
+
///
|
|
72
|
+
/// # Returns
|
|
73
|
+
///
|
|
74
|
+
/// * [`ByteArray`] - The post-processed option
|
|
75
|
+
pub fn post_process_option(
|
|
76
|
+
option_size: u16, dvn_index: u8, option_type: u8, option_data: @ByteArray,
|
|
77
|
+
) -> ByteArray {
|
|
78
|
+
let mut result: ByteArray = Default::default();
|
|
79
|
+
|
|
80
|
+
result.append_byte(DVN_WORKER_ID);
|
|
81
|
+
result.append_u16(option_size);
|
|
82
|
+
result.append_byte(dvn_index);
|
|
83
|
+
result.append_byte(option_type);
|
|
84
|
+
result.append(option_data);
|
|
85
|
+
|
|
86
|
+
result
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/// Decode the next DVN option from options starting from the specified cursor
|
|
90
|
+
///
|
|
91
|
+
/// # Arguments
|
|
92
|
+
///
|
|
93
|
+
/// * `options` - The DVN options byte array
|
|
94
|
+
///
|
|
95
|
+
/// * `cursor` - The cursor position to start decoding from
|
|
96
|
+
///
|
|
97
|
+
/// # Returns
|
|
98
|
+
///
|
|
99
|
+
/// * [`DvnOption`] - The decoded option type, option data, and new cursor position
|
|
100
|
+
pub fn next_dvn_option(options: @ByteArray, cursor: usize) -> DvnOption {
|
|
101
|
+
// Ensure we have enough bytes to read worker id
|
|
102
|
+
assert_with_byte_array(cursor < options.len(), err_invalid_dvn_options(cursor));
|
|
103
|
+
|
|
104
|
+
// skip dvn_id, always equal to DVN_WORKER_ID here = 2;
|
|
105
|
+
let cursor = cursor + 1;
|
|
106
|
+
|
|
107
|
+
let (cursor, option_size) = options.read_u16(cursor);
|
|
108
|
+
assert_with_byte_array(option_size > 2, err_invalid_dvn_options(cursor));
|
|
109
|
+
|
|
110
|
+
let (cursor, dvn_index) = options.read_u8(cursor);
|
|
111
|
+
let (cursor, option_type) = options.read_u8(cursor);
|
|
112
|
+
|
|
113
|
+
// Calculate the length of just the option data (excluding dvn_index and option_type)
|
|
114
|
+
// option_length includes dvn_index (1 byte) + option_type (1 byte) + option data
|
|
115
|
+
let option_data_length = option_size - 2; // subtract 2 bytes for dvn_index and option_type
|
|
116
|
+
|
|
117
|
+
// Extract the option data
|
|
118
|
+
// let option = slice_byte_array(options, new_cursor, option_data_length.into());
|
|
119
|
+
let (_, option) = options.read_bytes(cursor, option_data_length.into());
|
|
120
|
+
|
|
121
|
+
// Calculate the final cursor position
|
|
122
|
+
let final_cursor = cursor + option_data_length.into();
|
|
123
|
+
|
|
124
|
+
DvnOption { option_size, dvn_index, option_type, option_data: option, cursor: final_cursor }
|
|
125
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
//! DVN structs
|
|
2
|
+
|
|
3
|
+
use starknet::account::Call;
|
|
4
|
+
use starknet::secp256_trait::Signature;
|
|
5
|
+
|
|
6
|
+
/// DVN option
|
|
7
|
+
pub struct DvnOption {
|
|
8
|
+
/// Size of the option
|
|
9
|
+
pub option_size: u16,
|
|
10
|
+
/// Index of the DVN
|
|
11
|
+
pub dvn_index: u8,
|
|
12
|
+
/// Type of the option
|
|
13
|
+
pub option_type: u8,
|
|
14
|
+
/// Data of the option
|
|
15
|
+
pub option_data: ByteArray,
|
|
16
|
+
/// Cursor position
|
|
17
|
+
pub cursor: u32,
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/// Destination config
|
|
21
|
+
#[derive(Copy, Default, Drop, Serde, starknet::Store, PartialEq, Debug)]
|
|
22
|
+
pub struct DstConfig {
|
|
23
|
+
/// Gas for the destination
|
|
24
|
+
pub gas: u64,
|
|
25
|
+
/// Multiplier basis points
|
|
26
|
+
pub multiplier_bps: u16,
|
|
27
|
+
/// Floor margin in USD - uses priceFeed PRICE_RATIO_DENOMINATOR
|
|
28
|
+
pub floor_margin_usd: u128,
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/// Parameters for setting the destination config
|
|
32
|
+
#[derive(Copy, Default, Drop, Serde, PartialEq, Debug)]
|
|
33
|
+
pub struct SetDstConfigParams {
|
|
34
|
+
/// Destination endpoint ID
|
|
35
|
+
pub dst_eid: u32,
|
|
36
|
+
/// Destination config
|
|
37
|
+
pub config: DstConfig,
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/// Parameters for executing a job
|
|
41
|
+
#[derive(Drop, Serde, Clone)]
|
|
42
|
+
pub struct ExecuteParam {
|
|
43
|
+
/// Verifier ID
|
|
44
|
+
pub vid: u32,
|
|
45
|
+
/// Call data
|
|
46
|
+
pub call_data: Call,
|
|
47
|
+
/// Expiration of the instruction
|
|
48
|
+
pub expiration: u256,
|
|
49
|
+
/// Signatures for the instruction
|
|
50
|
+
pub signatures: Span<Signature>,
|
|
51
|
+
}
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
//! Executor errors
|
|
2
|
+
|
|
3
|
+
use core::byte_array::ByteArray;
|
|
4
|
+
use lz_utils::error::{Error, format_error};
|
|
5
|
+
|
|
6
|
+
#[derive(Drop)]
|
|
7
|
+
pub enum ExecutorError {
|
|
8
|
+
/// The endpoint ID is not supported.
|
|
9
|
+
EidNotSupported,
|
|
10
|
+
/// The `lz_compose` option is invalid.
|
|
11
|
+
InvalidLzComposeOption,
|
|
12
|
+
/// The `lz_read` option is invalid.
|
|
13
|
+
InvalidLzReadOption,
|
|
14
|
+
/// The `lz_receive` option is invalid.
|
|
15
|
+
InvalidLzReceiveOption,
|
|
16
|
+
/// The native drop option is invalid.
|
|
17
|
+
InvalidNativeDropOption,
|
|
18
|
+
/// The options are invalid.
|
|
19
|
+
InvalidOptions,
|
|
20
|
+
/// The options are malformed.
|
|
21
|
+
MalformedOptions,
|
|
22
|
+
/// The native amount exceeds the cap.
|
|
23
|
+
NativeAmountExceedsCap,
|
|
24
|
+
/// No options were provided.
|
|
25
|
+
NoOptions,
|
|
26
|
+
/// The price feed is not set.
|
|
27
|
+
PriceFeedNotSet,
|
|
28
|
+
/// The `lz_compose` option is not supported.
|
|
29
|
+
UnsupportedOptionLzCompose,
|
|
30
|
+
/// The `lz_read` option is not supported.
|
|
31
|
+
UnsupportedOptionLzRead,
|
|
32
|
+
/// The `lz_receive` option is not supported.
|
|
33
|
+
UnsupportedOptionLzReceive,
|
|
34
|
+
/// The native drop option is not supported.
|
|
35
|
+
UnsupportedOptionNativeDrop,
|
|
36
|
+
/// The option type is not supported.
|
|
37
|
+
UnsupportedOptionType,
|
|
38
|
+
/// Receive with value is not supported.
|
|
39
|
+
UnsupportedReceiveWithValue,
|
|
40
|
+
/// The worker fee library is not set.
|
|
41
|
+
WorkerFeeLibNotSet,
|
|
42
|
+
/// The calldata size is zero.
|
|
43
|
+
ZeroCalldataSize,
|
|
44
|
+
/// The `lz_compose` gas is zero.
|
|
45
|
+
ZeroLzComposeGas,
|
|
46
|
+
/// The `lz_receive` gas is zero.
|
|
47
|
+
ZeroLzReceiveGas,
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
impl ErrorNameImpl of Error<ExecutorError> {
|
|
51
|
+
fn prefix() -> ByteArray {
|
|
52
|
+
"LZ_EXECUTOR"
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
fn name(self: ExecutorError) -> ByteArray {
|
|
56
|
+
match self {
|
|
57
|
+
ExecutorError::EidNotSupported => "EID_NOT_SUPPORTED",
|
|
58
|
+
ExecutorError::InvalidLzComposeOption => "INVALID_LZ_COMPOSE_OPTION",
|
|
59
|
+
ExecutorError::InvalidLzReadOption => "INVALID_LZ_READ_OPTION",
|
|
60
|
+
ExecutorError::InvalidLzReceiveOption => "INVALID_LZ_RECEIVE_OPTION",
|
|
61
|
+
ExecutorError::InvalidNativeDropOption => "INVALID_NATIVE_DROP_OPTION",
|
|
62
|
+
ExecutorError::InvalidOptions => "INVALID_OPTIONS",
|
|
63
|
+
ExecutorError::MalformedOptions => "MALFORMED_OPTIONS",
|
|
64
|
+
ExecutorError::NativeAmountExceedsCap => "NATIVE_AMOUNT_EXCEEDS_CAP",
|
|
65
|
+
ExecutorError::NoOptions => "NO_OPTIONS",
|
|
66
|
+
ExecutorError::PriceFeedNotSet => "PRICE_FEED_NOT_SET",
|
|
67
|
+
ExecutorError::UnsupportedOptionLzCompose => "UNSUPPORTED_OPTION_LZ_COMPOSE",
|
|
68
|
+
ExecutorError::UnsupportedOptionLzRead => "UNSUPPORTED_OPTION_LZ_READ",
|
|
69
|
+
ExecutorError::UnsupportedOptionLzReceive => "UNSUPPORTED_OPTION_LZ_RECEIVE",
|
|
70
|
+
ExecutorError::UnsupportedOptionNativeDrop => "UNSUPPORTED_OPTION_NATIVE_DROP",
|
|
71
|
+
ExecutorError::UnsupportedOptionType => "UNSUPPORTED_OPTION_TYPE",
|
|
72
|
+
ExecutorError::UnsupportedReceiveWithValue => "UNSUPPORTED_RECEIVE_WITH_VALUE",
|
|
73
|
+
ExecutorError::WorkerFeeLibNotSet => "WORKER_FEELIB_NOT_SET",
|
|
74
|
+
ExecutorError::ZeroCalldataSize => "ZERO_CALLDATA_SIZE",
|
|
75
|
+
ExecutorError::ZeroLzComposeGas => "ZERO_LZ_COMPOSE_GAS",
|
|
76
|
+
ExecutorError::ZeroLzReceiveGas => "ZERO_LZ_RECEIVE_GAS",
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
pub fn err_eid_not_supported() -> ByteArray {
|
|
82
|
+
format_error(ExecutorError::EidNotSupported, "")
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
pub fn err_price_feed_not_set() -> ByteArray {
|
|
86
|
+
format_error(ExecutorError::PriceFeedNotSet, "")
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
pub fn err_worker_fee_lib_not_set() -> ByteArray {
|
|
90
|
+
format_error(ExecutorError::WorkerFeeLibNotSet, "")
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
pub fn err_no_options() -> ByteArray {
|
|
94
|
+
format_error(ExecutorError::NoOptions, "")
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
pub fn err_malformed_options() -> ByteArray {
|
|
98
|
+
format_error(ExecutorError::MalformedOptions, "")
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
pub fn err_unsupported_option_lz_receive() -> ByteArray {
|
|
102
|
+
format_error(ExecutorError::UnsupportedOptionLzReceive, "")
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
pub fn err_unsupported_receive_with_value() -> ByteArray {
|
|
106
|
+
format_error(ExecutorError::UnsupportedReceiveWithValue, "")
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
pub fn err_unsupported_option_native_drop() -> ByteArray {
|
|
110
|
+
format_error(ExecutorError::UnsupportedOptionNativeDrop, "")
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
pub fn err_unsupported_option_lz_compose() -> ByteArray {
|
|
114
|
+
format_error(ExecutorError::UnsupportedOptionLzCompose, "")
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
pub fn err_zero_lz_compose_gas() -> ByteArray {
|
|
118
|
+
format_error(ExecutorError::ZeroLzComposeGas, "")
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
pub fn err_unsupported_option_lz_read() -> ByteArray {
|
|
122
|
+
format_error(ExecutorError::UnsupportedOptionLzRead, "")
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
pub fn err_unsupported_option_type() -> ByteArray {
|
|
126
|
+
format_error(ExecutorError::UnsupportedOptionType, "")
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
pub fn err_invalid_options() -> ByteArray {
|
|
130
|
+
format_error(ExecutorError::InvalidOptions, "")
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
pub fn err_native_amount_exceeds_cap() -> ByteArray {
|
|
134
|
+
format_error(ExecutorError::NativeAmountExceedsCap, "")
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
pub fn err_zero_lz_receive_gas() -> ByteArray {
|
|
138
|
+
format_error(ExecutorError::ZeroLzReceiveGas, "")
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
pub fn err_zero_calldata_size() -> ByteArray {
|
|
142
|
+
format_error(ExecutorError::ZeroCalldataSize, "")
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
pub fn err_invalid_lz_receive_option() -> ByteArray {
|
|
146
|
+
format_error(ExecutorError::InvalidLzReceiveOption, "")
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
pub fn err_invalid_native_drop_option() -> ByteArray {
|
|
150
|
+
format_error(ExecutorError::InvalidNativeDropOption, "")
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
pub fn err_invalid_lz_compose_option() -> ByteArray {
|
|
154
|
+
format_error(ExecutorError::InvalidLzComposeOption, "")
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
pub fn err_invalid_lz_read_option() -> ByteArray {
|
|
158
|
+
format_error(ExecutorError::InvalidLzReadOption, "")
|
|
159
|
+
}
|