@layerzerolabs/oft-adapter-starknet 0.2.26 → 0.2.28

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.
@@ -0,0 +1,12 @@
1
+ import { oft_adapter_default } from './WMW4KKMN.js';
2
+ import { __export } from './3UUTAAI4.js';
3
+
4
+ // src/generated/verification/index.ts
5
+ var verification_exports = {};
6
+ __export(verification_exports, {
7
+ oftAdapterVerificationArtifact: () => oft_adapter_default
8
+ });
9
+
10
+ export { verification_exports };
11
+ //# sourceMappingURL=MQXU5KAF.js.map
12
+ //# sourceMappingURL=MQXU5KAF.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/generated/verification/index.ts"],"names":[],"mappings":";;;;AAAA,IAAA,oBAAA,GAAA","file":"MQXU5KAF.js","sourcesContent":["export { default as oftAdapterVerificationArtifact } from './oft_adapter';\n"]}
@@ -1,14 +1,14 @@
1
1
  'use strict';
2
2
 
3
- var HRRTIIZM_cjs = require('./HRRTIIZM.cjs');
3
+ var IYO6UMZC_cjs = require('./IYO6UMZC.cjs');
4
4
  var E63KEOR5_cjs = require('./E63KEOR5.cjs');
5
5
 
6
6
  // src/generated/verification/index.ts
7
7
  var verification_exports = {};
8
8
  E63KEOR5_cjs.__export(verification_exports, {
9
- oftAdapterVerificationInfo: () => HRRTIIZM_cjs.oft_adapter_default
9
+ oftAdapterVerificationArtifact: () => IYO6UMZC_cjs.oft_adapter_default
10
10
  });
11
11
 
12
12
  exports.verification_exports = verification_exports;
13
- //# sourceMappingURL=JNHB3COG.cjs.map
14
- //# sourceMappingURL=JNHB3COG.cjs.map
13
+ //# sourceMappingURL=QDBK4F77.cjs.map
14
+ //# sourceMappingURL=QDBK4F77.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/generated/verification/index.ts"],"names":[],"mappings":";;;;;;AAAA,IAAA,oBAAA,GAAA","file":"QDBK4F77.cjs","sourcesContent":["export { default as oftAdapterVerificationArtifact } from './oft_adapter';\n"]}
@@ -1,5 +1,5 @@
1
1
  // src/generated/verification/oft_adapter.ts
2
- var verificationInfo = {
2
+ var verificationArtifact = {
3
3
  "sources": {
4
4
  "contracts/oft_adapter/src/lib.cairo": "pub mod oft_adapter;\n",
5
5
  "contracts/oft_adapter/src/oft_adapter.cairo": "/// OFT Adapter Contract\n/// Wraps an existing ERC20 token for cross-chain transfers using lock/unlock mechanism\n#[starknet::contract]\npub mod OFTAdapter {\n use layerzero::oapps::common::oapp_options_type_3::oapp_options_type_3::OAppOptionsType3Component;\n use layerzero::oapps::oapp::oapp_core::OAppCoreComponent;\n use layerzero::oapps::oft::errors::err_oft_transfer_failed;\n use layerzero::oapps::oft::oft_core::default_oapp_hooks::OFTCoreOAppHooksDefaultImpl;\n use layerzero::oapps::oft::oft_core::oft_core::OFTCoreComponent;\n use layerzero::oapps::oft::structs::OFTDebit;\n use lz_utils::error::assert_with_byte_array;\n use openzeppelin::access::ownable::OwnableComponent;\n use openzeppelin::token::erc20::interface::{\n IERC20Dispatcher, IERC20DispatcherTrait, IERC20MetadataDispatcher,\n IERC20MetadataDispatcherTrait,\n };\n use starknet::storage::{StoragePointerReadAccess, StoragePointerWriteAccess};\n use starknet::{ContractAddress, get_contract_address};\n\n // Component declarations\n component!(path: OwnableComponent, storage: ownable, event: OwnableEvent);\n component!(path: OAppCoreComponent, storage: oapp_core, event: OAppCoreEvent);\n component!(path: OFTCoreComponent, storage: oft_core, event: OFTCoreEvent);\n component!(\n path: OAppOptionsType3Component, storage: oapp_options_type_3, event: OAppOptionsType3Event,\n );\n\n // Ownable Mixin\n #[abi(embed_v0)]\n impl OwnableMixinImpl = OwnableComponent::OwnableMixinImpl<ContractState>;\n impl OwnableInternalImpl = OwnableComponent::InternalImpl<ContractState>;\n\n // OApp Core\n #[abi(embed_v0)]\n impl OAppCoreImpl = OAppCoreComponent::OAppCoreImpl<ContractState>;\n impl OAppCoreInternalImpl = OAppCoreComponent::InternalImpl<ContractState>;\n\n\n // OApp Receiver\n #[abi(embed_v0)]\n impl IOAppReceiverImpl = OAppCoreComponent::OAppReceiverImpl<ContractState>;\n #[abi(embed_v0)]\n impl ILayerZeroReceiverImpl =\n OAppCoreComponent::LayerZeroReceiverImpl<ContractState>;\n\n // OFT Core - embed the implementation\n #[abi(embed_v0)]\n impl OFTCoreImpl = OFTCoreComponent::OFTCoreImpl<ContractState>;\n impl OFTCoreInternalImpl = OFTCoreComponent::InternalImpl<ContractState>;\n\n const SHARED_DECIMALS: u8 = 6;\n\n // OApp Options Type 3\n #[abi(embed_v0)]\n impl OAppOptionsType3Impl =\n OAppOptionsType3Component::OAppOptionsType3Impl<ContractState>;\n impl OAppOptionsType3InternalImpl = OAppOptionsType3Component::InternalImpl<ContractState>;\n\n #[storage]\n struct Storage {\n #[substorage(v0)]\n ownable: OwnableComponent::Storage,\n #[substorage(v0)]\n oapp_core: OAppCoreComponent::Storage,\n #[substorage(v0)]\n oft_core: OFTCoreComponent::Storage,\n #[substorage(v0)]\n oapp_options_type_3: OAppOptionsType3Component::Storage,\n erc20_token: ContractAddress,\n }\n\n #[event]\n #[derive(Drop, starknet::Event)]\n enum Event {\n #[flat]\n OwnableEvent: OwnableComponent::Event,\n #[flat]\n OAppCoreEvent: OAppCoreComponent::Event,\n #[flat]\n OFTCoreEvent: OFTCoreComponent::Event,\n #[flat]\n OAppOptionsType3Event: OAppOptionsType3Component::Event,\n }\n\n #[constructor]\n fn constructor(\n ref self: ContractState,\n erc20_token: ContractAddress,\n lz_endpoint: ContractAddress,\n owner: ContractAddress,\n native_token: ContractAddress,\n ) {\n // Initialize Ownable\n self.ownable.initializer(owner);\n\n // Initialize OApp Core\n self.oapp_core.initializer(lz_endpoint, owner, native_token);\n\n // Initialize token address\n self.erc20_token.write(erc20_token);\n\n // OFT Core needs to read local decimals from already deployed ERC20 token\n let token_dispatcher = IERC20MetadataDispatcher { contract_address: erc20_token };\n\n // Initialize OFT Core with local decimals\n self.oft_core.initializer(token_dispatcher.decimals(), SHARED_DECIMALS);\n }\n\n // Implement OFTHooks to provide the specific token operations\n impl OFTHooks of OFTCoreComponent::OFTHooks<ContractState> {\n fn _debit(\n ref self: OFTCoreComponent::ComponentState<ContractState>,\n from: ContractAddress,\n amount: u256,\n min_amount: u256,\n dst_eid: u32,\n ) -> OFTDebit {\n let oft_debit = self._debit_view(amount, min_amount, dst_eid);\n\n // Lock tokens by transferring them from the caller to this contract\n let success = IERC20Dispatcher { contract_address: self._token() }\n .transfer_from(from, get_contract_address(), oft_debit.amount_sent_ld);\n assert_with_byte_array(success, err_oft_transfer_failed());\n\n oft_debit\n }\n\n fn _credit(\n ref self: OFTCoreComponent::ComponentState<ContractState>,\n to: ContractAddress,\n amount: u256,\n src_eid: u32,\n ) -> u256 {\n // Unlock tokens by transferring them from this contract to the recipient\n let success = IERC20Dispatcher { contract_address: self._token() }.transfer(to, amount);\n assert_with_byte_array(success, err_oft_transfer_failed());\n\n // Return the actual amount received (same as input in default implementation)\n amount\n }\n\n fn _token(self: @OFTCoreComponent::ComponentState<ContractState>) -> ContractAddress {\n self.get_contract().erc20_token.read()\n }\n\n fn _approval_required(self: @OFTCoreComponent::ComponentState<ContractState>) -> bool {\n true\n }\n }\n}\n",
@@ -1273,8 +1273,8 @@ pub fn err_not_enough_native(msg_value: u256) -> ByteArray {
1273
1273
  "projectDirPath": ".",
1274
1274
  "contractFilePath": "contracts/oft_adapter/src/lib.cairo"
1275
1275
  };
1276
- var oft_adapter_default = verificationInfo;
1276
+ var oft_adapter_default = verificationArtifact;
1277
1277
 
1278
1278
  export { oft_adapter_default };
1279
- //# sourceMappingURL=KGI5KEFS.js.map
1280
- //# sourceMappingURL=KGI5KEFS.js.map
1279
+ //# sourceMappingURL=WMW4KKMN.js.map
1280
+ //# sourceMappingURL=WMW4KKMN.js.map