Zebec Network 백서

Zebec Network

원문

bitpro가 원문에서 글자만 모은 내용이에요. 표·그림·수식은 빠지거나 깨질 수 있어요. 전체 20쪽 중 19쪽

receivers, withdrawBulkCount ); const txnReceipt = await bulkClient.updateBulkTransfer( bulkName, bulkIndex, merkleRoot, startTimes, recurringFrequency, overrides ); console.log(txnReceipt); </code></pre> `updateBulkInstantTransferRoot` function is used to update an existing bulk instant transfer by recalculating the Merkle tree root based on new transfer data. `updateBulkTransfer` method updates a bulk transfer with new information such as a merkle root and start times. 3. **Withdraw Bulk Instant Transfer By Receiver** ```typescript const amount = "1"; const tokenAddress = "0xTokenAddress"; const sender = "0xSenderAddress"; const receiver = "0xReceiverAddress"; const proofs = ["0xProof1", "0xProof2"]; // Array of merkle proofs const zebecWalletTransfer = false; const overrides = {}; // Optional overrides const bulkIndex = await receiver1Client.getLatestBulkCount(sender.address).toNumber(); // get the latest bulk index const txnReceipt = await bulkClient.withdrawBulkInstantTransfer( bulkIndex, amount, tokenAddress, sender, receiver, proofs, zebecWalletTransfer, overrides ); console.log(txnReceipt); ``` This method allows a user to withdraw funds from a bulk instant transfer using merkle proofs.\ \ *Note: The purpose of the `getLatestBulkCount` function is to determine the number of bulk transfers that a user has created within the Zebec protocol. Bulk transfers are collections of individual token streams, and each bulk transfer has a unique index or identifier.* 4. **Cancel Bulk Instant Transfer** ```typescript const bulkIndex = 1; const overrides = {}; // Optional overrides const txnReceipt = await bulkClient.cancelBulkInstantTransfer(bulkIndex, overrides); console.log(txnReceipt); ``` This method cancels a bulk instant transfer. 5. **Calculate Latest Bulk Bytes** ```typescript const userAddress = "0xUserAddress"; const bulkBytes = await bulkClient.calculateLatestBulkBytes(userAddress); console.log(bulkBytes); ``` The `calculateLatestBulkBytes` function in the `ZebecBulkClient` class is used to calculate the byte representation of the latest bulk transfer associated with a specific user's address. This function allows you to obtain the byte representation of the most recent bulk transfer. 6. **Get Bulk Transfer Root** <pre class="language-typescript"><code class="lang-typescript">const bulkBytes = "0xabcdef123456..."; // Replace with the actual bulk transfer identifier <strong>// Retrieve the Merkle root of the specified bulk transfer </strong>const bulkTransferRoot = await bulkClient.getBulkTransferRoot(bulkTransferBytes); console.log(`Merkle Root of Bulk Transfer: ${bulkTransferRoot}`) </code></pre> The `getBulkTransferRoot` function is used to retrieve the Merkle root associated with a specific bulk transfer. 7. **Verify Bulk Transfer** ```javascript // Verify the bulk instant transfer const verified = await bulkClient.verifyBulkInstantTransfer( index, amount, tokenAddress, sender, receiver, proofs ); if (verified) { console.log("Bulk Instant Transfer is valid and verified."); } else { console.log("Bulk Instant Transfer is not valid."); } ``` The purpose of the `verifyBulkInstantTransfer` function is to perform verification checks on a bulk instant transfer to ensure that it matches the expected properties and has not been manipulated or tampered with. # Zebec Multisig Stream This class, `ZebecMultisigStream`, serves as a factory for generating data that can be used with the Gnosis Safe SDK to create and execute transactions on the Ethereum blockchain. Here's a brief overview of what this class does: 1. **Constructor**: Initializes an instance of the class by connecting to the `Core` contract using a provided signer or provider. The contract address can be optionally specified. 2. **Deposit**: * `depositToken`: Generates transaction data for depositing tokens into the contract, returning an array of data including approval data (for non-Ether tokens) and deposit data. 3. **Deposit to Safe**: * `depositToSafe`: Generates transaction data for depositing tokens or Ether into a specified safe address, and returns the transaction receipt. 4. **Withdraw Functions**: * `withdrawFromSafe`: Generates transaction data for withdrawing tokens from a safe. * `withdrawToken`: Generates transaction data for withdrawing tokens from the contract. 5. **Stream Management Functions**: * Functions for initiating, pausing, resuming, canceling, and updating streams, including generating transaction data for these actions. 6. **Instant Token Transfer Functions**: * `instantTokenTransfer`: Generates transaction data for instant token transfers. * `instantTokenTransferTNS`: Generates transaction data for instant token transfers with a Transaction Name Service (TNS) integration. 7. **Utility Functions**: * `initStreamTNS`: Generates transaction data for initiating a stream with TNS. * `drainAccountFromSafe`: Generates an array of transaction data for draining multiple tokens from a safe. * `drainAccountFromZebecWallet`: Generates an array of transaction data for transferring multiple tokens from a Zebec wallet to a receiver. Overall, this class simplifies the process of preparing transaction data for various actions related to token deposits, stream management, and token transfers within the Ethereum blockchain. Users can obtain this prepared data from the class and then use it with the Gnosis Safe SDK to create and execute transactions. {% embed url="<https://github.com/safe-global/safe-core-sdk>" %} # NFT You have the capability to oversee and control your BEP-721 and BEP-1155 standard non-fungible tokens (NFTs) through a Zebec safe. ### Usage #### Initializing the ZebecMultisigStream To use the `ZebecMultisigStream` class, you need to initialize an instance of it by providing a signer or provider and, optionally, the contract address. Here's how you can do that: ```javascript import { ZebecMultisigStream } from 'zebec-multisig-stream'; // Your Ethereum provider or signer const providerOrSigner = ...; // Optionally, specify the contract address (default is CORE_CONTRACT_ADDRESS) const contractAddress = ...; const zebecStream = new ZebecMultisigStream(providerOrSigner, contractAddress); ``` #### Depositing ERC-721 Tokens The `depositERC721` method allows you to deposit an ERC-721 token into a safe address. It takes the `tokenId`, `tokenAddress`, and `safeAddress` as parameters and returns a transaction response. ```javascript const tokenId = 123; // The ERC-721 token ID const tokenAddress = '0x...'; // The ERC-721 token contract address const safeAddress = '0x...'; // The destination safe address const transactionResponse = await zebecStream.depositERC721(tokenId, tokenAddress, safeAddress); console.log(transactionResponse); ``` #### Depositing ERC-1155 Tokens The `depositERC1155` method allows you to deposit ERC-1155 tokens into a safe address. It takes the `tokenId`, `tokenAddress`, `safeAddress`, and `amount` as parameters and returns a transaction Response. ```javascript const tokenId = 123; // The ERC-1155 token ID const tokenAddress = '0x...'; // The ERC-1155 token contract address const safeAddress = '0x...'; // The destination safe address const amount = 5; // The amount of tokens to deposit const transactionResponse = await zebecStream.depositERC1155(tokenId, tokenAddress, safeAddress, amount); console.log(transactionResponse); ``` #### Transferring ERC-721 Tokens The `transferERC721` method generates transaction data to transfer an ERC-721 token from a safe address to a recipient address. It takes the `tokenId`, `tokenAddress`, `to`, and `safeAddress` as parameters. ```javascript const tokenId = 123; // The ERC-721 token ID const tokenAddress = '0x...'; // The ERC-721 token contract address const to = '0x...'; // The recipient address const safeAddress = '0x...'; // The source safe address // The Safe SDK can utilize this transactionData to initiate and execute multi-signature transactions. const transactionData = zebecStream.transferERC721(tokenId, tokenAddress, to, safeAddress); console.log(transactionData); ``` #### Transferring ERC-1155 Tokens The `transferERC1155` method generates transaction data to transfer ERC-1155 tokens from a safe address to a recipient address. It takes the `tokenAddress`, `tokenIds`, `amounts`, `to`, and `safeAddress` as parameters. ```javascript const tokenAddress = '0x...'; // The ERC-1155 token contract address const tokenIds = [123, 456]; // An array of ERC-1155 token IDs const amounts = [5, 10]; // An array of corresponding token amounts const to = '0x...'; // The recipient address const safeAddress = '0x...'; // The source safe address // The Safe SDK can utilize this transactionData to initiate and execute multi-signature transactions. const transactionData = zebecStream.transferERC1155(tokenAddress, tokenIds, amounts, to, safeAddress); console.log(transactionData); ``` # Zapps Compatible This guide provides step-by-step instructions on how to make your existing application Zapps compatible. By following these steps, you can ensure that your app can be seamlessly used within both Safe Global ecosystem and Zapps Multisig as well. ### Prerequisites Before you begin, ensure you have the following packages installed in your project: * `@safe-global/safe-apps-react-sdk` * `@safe-global/safe-apps-provider` You can install these packages using npm or yarn: ```bash npm install @safe-global/safe-apps-react-sdk @safe-global/safe-apps-provider # or yarn add @safe-global/safe-apps-react-sdk @safe-global/safe-apps-provider ``` ### Step 1: Wrap Your App with Safe Provider You need to wrap your application with the `SafeProvider` component. This ensures that your app can interact with the Safe Global environment. ```javascript import SafeProvider from "@safe-global/safe-apps-provider"; const App = () => { // Your existing app code here return ( <SafeProvider> <YourApp> {/* Your app content */} </YourApp> </SafeProvider> ); }; ``` Make sure to insert this `SafeProvider` component at the root of your application component hierarchy. ### Step 2: Update manifest.json To provide essential information about your app, update the `manifest.json` file. This information is necessary to display your app correctly. ```json { "name": "YourAppName", "description": "A description of what your app does", "iconPath": "myAppIcon.svg" } ``` * `"name"`: Replace with your app's name. * `"description"`: Provide a concise description of your app's functionality. * `"iconPath"`: Specify the path to your app's icon image. ### Step 3: Implement Safe App Provider To integrate your app as zApps you need to use the `SafeAppProvider` from the `@safe-global/safe-apps-provider` package. ```javascript import React, { useMemo } from 'react'; import { ethers } from 'ethers'; import { useSafeAppsSDK } from '@safe-global/safe-apps-react-sdk'; import { SafeAppProvider } from '@safe-global/safe-apps-provider'; const App = () => { const { sdk, safe } = useSafeAppsSDK(); const web3Provider = useMemo(() => new ethers.providers.Web3Provider(new SafeAppProvider(safe, sdk)), [sdk, safe]); // Use the web3Provider to interact with blockchain contracts return ( // Your app's UI and functionality here ); }; export default App; ``` ### Step 4: Add Gnosis wallet connector/adapter We can setup the Gnosis Safe Connector using following method: For wagmi: ```javascript import { SafeConnector } from 'wagmi/connectors/safe' const connector = new SafeConnector({ chains, options: { allowedDomains: [/gnosis-safe.io$/, /app.safe.global$/], debug: false, }, }) ``` For third web: <pre class="language-javascript"><code class="lang-javascript">// npx thirdweb create --template gnosis-safe <strong>function MyApp({ Component, pageProps }: AppProps) { </strong> const gnosisSafeConnector = new GnosisSafeConnector({}); return ( &#x3C;ThirdwebProvider walletConnectors={[gnosisSafeConnector]}> &#x3C;Component {...pageProps} /> &#x3C;/ThirdwebProvider> ); } </code></pre> If you want to learn more about Safe Global's "safe-apps", it's advisable to visit their official [safe global website](https://safe.global/) or [documentation](https://docs.safe.global/safe-core-aa-sdk/safe-apps/get-started) portal. # ZBC to ZBCN Migration Guide The Zebec Protocol and its ZBC token have evolved into The Zebec Network with a corresponding ZBCN token ticker to better represent the business and the growing portfolio of products and the infrastructure network that powers it. #### Key Facts for the upcoming token swap from ZBC to ZBCN: * Swap period April 9th to May 10th * No new supply of tokens will be introduced into the market. * Tokenomics of ZBCN will mirror those of ZBC, maintaining the same governance, utility, vesting, and lock-up schedules. * Other than the new token name the primary change will be the token split 1:10 #### Token Split 1:10 — Network Expansion and Enhancing Accessibility Zebec is undergoing a significant transformation by consolidating multiple protocols and integrating our diverse blockchain-enabled payment and payroll products into a single interconnected network. This integration will substantially enhance our network’s utility, extending its support beyond payment flows to also encompass data and physical infrastructure (DePin). As we prepare for the launch of our Point of Sale (PoS) device, we anticipate a substantial increase in the volume of network transactions. This projected growth necessitates a reevaluation of our transaction fee structure to ensure efficiency and accessibility. To address these changes, we have initiated a token split at 1 ZBC to 10 ZBCN ratio. This approach mirrors the concept of a stock split in traditional finance, where a company increases the number of its shares to boost liquidity and make the stock more accessible to a broader range of investors. Similarly, by splitting our token, we aim to achieve several key objectives: **Expanded Use Cases**: The token split will facilitate a broader range of transactions on our network, accommodating the expanded services and increased transaction volume. This change will make our network more versatile and capable of handling diverse transaction types. **Ease of Transaction Fee Calculation**: Utilizing whole numbers for gas fees, such as 1 ZBCN per transaction instead of 0.1 ZBC, simplifies the fee calculation process. This simplicity is crucial for both users and network operators, as it makes transactions more straightforward and transparent. **Increased Accessibility:** Lowering the unit cost of tokens through a split makes our network more accessible to a wider audience. It reduces the financial barrier to entry, allowing smaller investors and users to participate more actively in the network. **Market Perception:** Token split represents Zebec’s team confidence and positive outlook for the prospects of the business. Splits often result in a positive perception in the market, signaling growth and accessibility. We anticipate this development to lead to increased interest and investment in the token, benefiting the ecosystem as a whole. #### Migration to ZBCN: Details and Key Conditions The token swap process will commence on April 10th, where ZBC tokens will be exchanged for ZBCN at a 1:10 ratio. This means that for every ZBC token, holders will receive 10 ZBCN tokens. It’s important to note that no new ZBCN tokens will be created during this swap. Instead, all ZBC tokens will be effectively burned via a smart contract as part of the swapping process. The swap period is set to last for one month, concluding on May 10th. During this 30-day window, both ZBC and ZBCN tokens will coexist, allowing for a smoother transition for token holders. The swap can be conducted through our dedicated migration portal at [migration.zebec.io](http://migration.zebec.io/) On Exchanges: For those holding ZBC tokens on exchanges, the transition has been coordinated with these platforms and swap happen automatically. Trading and withdrawal of $ZBC will be halted on April 8th, coinciding with the start of the swap process. In preparation for the ZBC to ZBCN migration, some CEX’s might begin swapping ZBC earlier, no action by holders is needed. Trading of the $ZBCN tokens will commence on April 10th. Additionally, $ZBC liquidity will be withdrawn from Decentralized Exchanges (DEXs) on April 8th, and the $ZBCN Liquidity Pool will be established concurrently to ensure market fluidity. In conclusion, the token migration and split is a strategic move to adapt to the Zebec expanding business, enhance its functionality, and ensure accessibility and attractiveness of the token to a wider range of users and investors. View Migration Demo here : {% embed url="<https://bit.ly/43WzmxB>" %} \ \ \ <br> # ZBCN Tokemonics Introduction ZBCN is the governance and utility token of the Zebec Network. Holders of ZBCN have voting rights in the governance system and vote on critical decisions that affect the network and the ecosystem. Their influence is proportional to the amount of ZBCN they hold or control. In addition to voting rights and influencing the priorities of Zebec business ventures, the ZBCN token unlocks a variety of benefits and incentives for holders. #### At its Core ZBCN is not a new token. It is the next generation of the original token of the Zebec Protocol — ZBC. The transition to the ZBCN ticker represents a strategic shift, better reflecting our business’s evolution, growth in our portfolio of products and the infrastructure that powers it. And better optimized for our decentralized network, as its utilization significantly expands from supporting payment flows to also include data and physical Infrastructure (DePin). The only difference in the new generation token is the split 1:10 to streamline the gas fee structure, at 1 ZBCN per transaction. No additional supply is minted and each ZBC in circulation is swapped for 10 ZBCN. Once the [migration](https://medium.com/zebec-protocol/migration-guide-zbc-to-zbcn-9592fd23a590) is completed, ZBCN becomes the exclusive native token of the Zebec Network, mirroring the token distribution and vesting schedule and the foundational tokenomics established by ZBC. (for reference: [Tokenomics of ZBC](https://medium.com/zebec-protocol/zbc-today-token-economics-update-2024-59f5f55bd58d)) <figure><img src="https://3427593773-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FYaTRWumFGJjYtG8IAVar%2Fuploads%2FIYTYjCch1hhEiJ7Z0qEd%2FScreenshot%202024-04-08%20at%209.38.16%E2%80%AFAM.png?alt=media&amp;token=1bd6b31e-f2c2-4fd3-a44a-a780bcad7b03" alt=""><figcaption><p>ZBCN Distribution &#x26; Vesting Schedule</p></figcaption></figure> #### ZBCN Governance Model — Hybrid The Zebec DAO operates under a hybrid governance model, merging on-chain and off-chain decision-making. This approach leverages blockchain’s transparency and immutability alongside the adaptability of traditional governance, reflecting a growing trend in the blockchain domain for a more nuanced and flexible governance structure. ZBCN governance combines ZBCN token holders’ direct on-chain voting on proposals with extensive off-chain consultations, proposal vetting and informal consensus building across various formats, forums and social channels. This allows for a thorough exploration of proposals before they are formalized through on-chain votes. Governance[ hub](https://governance.zebec.io/#/governance). #### Governance Process The governance process and vote works as follows: Community members initiate ideas for proposals on Zebec’s forum and social channels, or investors and partners put forward proposals for consideration. Off-chain activities such as briefings, discussions, debates and consultations are compiled into articles and reports, shared through Zebec’s channels and community boards. Proposals, which gain sig
프로젝트로 돌아가기