Momentum 백서

Momentum

원문

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

fiat currencies, which are regulated and backed by local governments and central banks, tokens are based only on technology and user consensus, which means that in cases of manipulations or market panic, central governments will not take any corrective actions or measures to achieve stability, maintain liquidity or protect their value. There is a possibility that certain transactions cannot be settled or may be difficult to settle, or can be completed only at significantly adverse prices depending on the market situation and/or market volume. Transactions may be irreversible, and, accordingly, potential losses due to fraudulent or accidental transactions are not recoverable. Some blockchain transactions are deemed to be completed when recorded on a public ledger, which is not necessarily the date or time when you or another party initiated the transaction. * The regulatory frameworks applicable to blockchain transactions in connection with tokens are still developing and evolving. It is possible that your transactions or funds are, or may be in the future, subject to various reporting, tax or other liabilities and obligations. Legislative and regulatory changes or actions at the country or international level may materially and adversely affect the use, transfer, exchange, and value of your tokens. * The Site and/or the Services may be entirely or partially suspended or terminated for any or no reason, which may limit your access to your Digital Assets. * You are solely responsible for understanding and complying with any and all Applicable Laws in connection with your acceptance of these Terms and your use of any part of the Site, including but not limited to those related to taxes as well as reporting and disclosure obligations. * This list of risk factors is non-exhaustive, and other risks, arising either now or in the future, could additionally be relevant and applicable to you in making an informed judgment to accept, or continue to accept, these Terms and/or use, or continue to use the Site. Accordingly, you expressly acknowledge and agree that: a. you assume all risk in connection with the specific risks identified above; b. you assume all risk in connection with your access to and use of the Site and the Services; c. that you expressly waive and release us from any and all liability, claims, causes of action, responsibility or damages arising from or in any way related to your use of the Site and the Services, including, without limitation, when your digital wallet is connected to our Services while any Digital Assets are in your custody; d. no individual or entity involved in creating the Services will be liable for any claims or damages whatsoever associated with your use, inability to use, or your interaction with other users of, the RIZE labs Inc products an services, including any direct, indirect, incidental, special, exemplary, punitive or consequential damages, or loss of profits, Digital Assets, cryptocurrencies, tokens, or anything else of value. 4\. Third-Party Content The Site may contain hyperlinks or references to third-party websites or content. Any such hyperlinks or references are provided for your information and convenience only. We have no control over third-party websites and accept no legal responsibility for any content, material or information contained in them. The display of any hyperlink and reference to any third-party website does not mean that we endorse that third party's website, products or services or opine on the accuracy or reliability of such information. Your use of a third-party site may be governed by the terms and conditions of that third-party site. We have not reviewed or vetted any third-party content. 5\. Intellectual Property Rights We are the owner of all intellectual property rights in the Site and the material published on them. To the extent practical, these works are protected by copyright laws and all such rights are reserved. <https://www.m-safe.io/maven/home> is our uniform resource locator (‘URL’). You will not make use of this URL (or any other URL owned by us) on another website or digital platform without our prior written consent. Any unauthorized use or reproduction may be prosecuted. You will retain ownership of all copyright in data you upload or submit by, through or to the Site. You grant us a worldwide, royalty-free, irrevocable license to use, copy, distribute or publish and send this data in any manner. 6\. Copyright Infringement We take claims of copyright infringement seriously. If you believe any materials accessible on or through the Site or any copyrighted materials posted to the Site by another user infringe your copyright, you may request removal of those materials (or access to them) by sending written notification to \[<team@m-safe.io>]\(mailto:<team@m-safe.io>). Please be aware that if you knowingly materially misrepresent that material or activity on the Site is infringing your copyright, you may be held liable for damages (including costs and attorneys’ fees) under United States Copyright Act. 7\. Indemnification You agree to indemnify and hold us and all of our officers, directors, employees, contractors, agents, affiliates, and subsidiaries harmless from any claim or demand, including attorneys’ fees and costs, made by any third-party due to or arising out of (a) your use of the Site or the Services, (b) this agreement, or (c) any illegal acts, including, without limitation, violations of civil or criminal laws of any jurisdiction, committed by you while using the Site or the Services, or in connection with such use. 8\. General We may perform any of our obligations, and exercise any of the rights granted to us under these Terms, through an affiliated or unaffiliated third-party. We may assign any or all our rights and obligations under these Terms to any third-party. If any clause or part of any clause of these Terms is found to be void, unenforceable or invalid, then it will be severed from these Terms, leaving the remainder in full force and effect, provided that the severance has not altered the basic nature of these Terms. No single or partial exercise, or failure or delay in exercising any right, power or remedy by us shall constitute a waiver by us of, or impair or preclude any further exercise of, that or any right, power or remedy arising under these terms and conditions or otherwise. If any of the provisions in these Terms are found to be illegal, invalid or unenforceable by any court of competent jurisdiction, the remainder shall continue in full force and effect. All disclaimers, indemnities and exclusions in these Terms shall survive termination of the Terms and shall continue to apply during any suspension or any period during which the Site is not available for you to use for any reason whatsoever. These Terms and the documents referred to in them set out the entire agreement between you and us with respect to your use of the Site, the Services, and the services provided via the Site and supersede any and all prior or contemporaneous representations, communications or agreements (written or oral) made between you or us. Any dispute, controversy, or claim arising out of or in relation to these Terms, including the validity, invalidity, breach or termination thereof, shall be settled by arbitration in accordance with laws of the State of California, United States of America. The number of arbitrators shall be one. The arbitration shall occur in Santa Clara County, California, according to the rules of Judicial Arbitration and Mediation Services, and the arbitral proceedings shall be conducted in English. With respect to all persons and entities, regardless of whether they have obtained or used the site for personal, commercial or other purposes, all disputes, controversies or claims must be brought in the parties’ individual capacity, and not as a plaintiff or class member in any purported class action, collective action or other representative proceeding. This waiver applies to class arbitration, and, unless we agree otherwise, the arbitrator may not consolidate more than one person’s claims. You agree that, by entering into this agreement, you and us are each waiving the right to a trial by jury or to participate in a class action, collective action, or other representative proceeding of any kind. 9\. Force Majeure There is a risk that transactions effected through the Site or through the Services may be affected by system failures resulting from adverse events, natural disasters, pandemics and other emergencies, as well as unforeseen significant changes in the external environment. With regard to opportunity loss (e.g., loss of opportunity to place a payment instruction, resulting in loss of profits which could have been obtained) due to occurrences such as emergency situations and force majeure events, we are under no obligation to take any corrective action or measure and shall no under circumstances be liable for any lost profits or other trading losses. # Developers {% content-ref url="/pages/J1u5thq31MoP1e6S2vNw" %} [MPay](/core-products/msafe/developers/mpay) {% endcontent-ref %} {% content-ref url="/pages/v2J3u0k35rwfRagchEQN" %} [DAPP Store Integration](/core-products/msafe/developers/dapp-store-integration) {% endcontent-ref %} # MPay ### Overview MPay is a decentralized stream payment application built on the SUI ecosystem. This application empowers users to seamlessly stream tokens to recipients over a predefined period, providing a versatile and automated payment solution. The key features of MPay include: 1. **Universal Token Support:** MPay supports all types of tokens on the SUI network, ensuring broad compatibility and flexibility for users. 2. **Stream Groups:** Users can create stream groups where multiple recipients share the same token release schedule, simplifying the management of large-scale payments. 3. **Auto Claim Feature:** With the auto claim feature enabled, MPay automatically facilitates the claiming process for recipients, ensuring timely and hassle-free token retrieval. 4. **Cliff:** Users can set a cliff period at the start date, defining an initial lock-up period before the streaming of tokens begins. 5. **Cancelable Streams:** Streams can be configured as cancelable at the time of creation. This allows the sender to cancel the stream and reclaim any unstreamed tokens, providing additional security and flexibility. 6. **MSafe Integration:** MPay integrates with MSafe, multi-sig wallet on SUI, to enhance the security of token management. This integration ensures that multiple approvals are required for critical transactions, providing an additional layer of protection for users' assets. MPay leverages the robust and secure infrastructure of the SUI ecosystem to deliver an efficient and user-friendly experience for decentralized token streaming. Whether for payroll, subscriptions, or other recurring payments, MPay offers a powerful solution to meet diverse financial needs. ### Useful Links * **UI Interface:** <https://pay.m-safe.io/> * **MSafe Integration:** <https://sui.m-safe.io/mpay?subpath=create> * **SDK Github:** <https://github.com/Momentum-Safe/mpay-sdk-sui> * **SDK Example:** <https://github.com/Momentum-Safe/mpay-example> * [**Auditing Report**](https://files.gitbook.com/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIN7L5n8sd0hbHBhdd20b%2Fuploads%2FK05i6wdmvOb1ZgTLa1aM%2FMSafe%20Audit%20Report.pdf?alt=media\&token=31a4109b-83d2-456e-acb5-e98e368932e5) # Key Concepts #### Stream A Stream is a shared object within the SUI ecosystem, uniquely identified by its stream ID, which corresponds to the object ID in the SUI system. Each stream facilitates a one-to-one relationship between a sender and a recipient. The tokens to be streamed are encapsulated within the object and are released based on a predefined configuration strategy. The stream's configuration parameters, as defined in the smart contract, include: 1. **CoinType:** The type of token to be streamed within the SUI system. 2. **Metadata:** JSON encoded data to enhance user experience. This may include the stream name for user identification and a group ID for backend indexing. 3. **Recipient:** The designated recipient of the stream. Only the recipient has the authority to claim the streamed tokens. 4. **TimeStart:** The Unix timestamp in milliseconds marking when the stream begins transferring assets to the recipient. 5. **Cliff:** The initial amount of tokens released at TimeStart. This feature is useful for streams that require an upfront token release. 6. **Interval:** The duration in milliseconds between each step of token release. 7. **Step:** The total number of intervals. For example, if the Interval is set to 1 hour and the Step is 5, the stream will complete in 5 hours. 8. **AmountPerStep:** The amount of tokens to be released in each step. 9. **Cancelable:** Indicates whether the stream can be canceled by the creator, allowing them to reclaim any unstreamed tokens. #### Stream Group A Stream Group simplifies the process of creating multiple streams with similar settings. It is a conceptual tool designed for user convenience and comprehension, aggregating several individual streams under a common configuration. On the blockchain, a Stream Group consists of multiple streams sharing similar settings such as StartTime, Interval, and other parameters. Each stream within the group is identified by the same group ID encoded in the metadata, though the token amounts to be sent can vary between streams. The group ID is utilized primarily for backend indexing. When a user queries a Stream Group using the group ID, the backend retrieves and returns a list of streams that were created with the same configuration parameters at the time of creation. Key features of a Stream Group include: * **Unified Settings:** Streams within a group share common settings, making management more straightforward. * **Group ID:** Encoded in the metadata for backend indexing, facilitating efficient querying and retrieval of streams. * **Flexibility in Token Amount:** While other settings remain consistent, the token amount to be sent can differ among the streams within the group. #### Payment process The payment process within the MPay application involves two primary actions: stream creation and token retrieval. 1. **Stream Creation:** The sender (creator) initiates the payment process by using the streaming token to create a stream. During this step, the sender must send all the tokens to be streamed at once to the stream. The stream's configuration, including the recipient, token type, and release schedule, is specified at this stage. 2. **Token Retrieval:** The recipient then claims the stream to retrieve the tokens. This process ensures that the recipient receives the tokens according to the predefined release schedule set by the sender. The streamlined payment process facilitates efficient and automated token distribution, ensuring both parties have a clear and secure method for handling decentralized payments. #### Claim Stream The recipient can claim the amount of tokens that have been released over time according to the stream's predefined schedule. Only the designated recipient has the authority to claim the streamed tokens, ensuring that the tokens are securely transferred to the intended party. #### Auto Claim The recipient can enable the auto-claim feature by setting auto-claim to true. When this feature is activated, a new interface, `claim_by_proxy`, becomes available in the smart contract for the stream. This allows anyone to claim the stream, with the streamed amount being sent directly to the recipient. This feature is designed for convenience, ensuring that the recipient receives the tokens without needing to manually claim them. By default, the MPay backend manages auto-claim streams and handles the claiming process for the user, ensuring timely and efficient retrieval of tokens. A certain fee will be charged for utilizing the auto-claim feature. #### Cancel Stream If a stream is created with the cancelable option set to true, the creator has the ability to cancel the stream. Upon cancellation, the unstreamed amount is returned to the creator. Any tokens that have been streamed but not yet claimed can still be claimed by the recipient. #### Backend Support MPay provides robust backend support to enhance the functionality and user experience. The backend support includes: 1. **Indexing Owner and Recipient's Stream Data:** Efficiently tracks and manages stream data for both creators and recipients, ensuring easy access and retrieval of information. 2. **Indexing Stream Group Data:** Maintains organized records of stream groups, facilitating streamlined queries and management of grouped streams. 3. **Auto Claim on Behalf of Users:** Automatically handles the auto-claim process for users, ensuring timely and efficient claiming of streamed tokens. #### Fee MPay implements a fee structure to support its operations: 1. **Streamed Token Fee:** A fee of 0.50% of the streamed token amount is charged. 2. **Stream Creation Fee:** A fee of 0.1 SUI is charged for each stream created. 3. **Auto Claim Fee:** An additional fee of 0.25% is charged for utilizing the auto-claim feature. # MPay SDK #### Installation ``` yarn add @msafe/mpay-sdk-sui ``` #### Use SDK For SDK integration code example, please check out Github repository [mpay-example](https://github.com/Momentum-Safe/mpay-example). **Initialize mpay client** ``` import {MPayClient} from "@msafe/mpay-sdk-sui"; // Env.prod refer to mainnet environment // Env.dev refer to testnet environment const client = new MPayClient(Env.prod) ``` **Connect a wallet** ``` client.connectSingleWallet(window.wallet); ``` **Create a stream or a stream group** ``` const txb = await client.createStreams(info); const res = await wallet.signAndExecuteTransactionBlock(txb); const streamIds = client.helper.getStreamIdsFromCreateStreamResponse(res); if (streamIds === 1) { const streams = Stream.new(client.globals, streamIds[0]); } else { const streamGroup = StreamGroup.new(client.globals, streamIds); const streams = streamGroup.streams; } ``` **View stream detail** ``` const info = await stream.info; console.log(info); const progress = await stream.progress; console.log(progress); ``` **Stream operation** ``` // Cancel stream const txb = await stream.cancel(); const res = await wallet.signAndExecuteTransactionBlock(txb); // Claim stream const txb = await stream.claim(); const res = await wallet.signAndExecuteTransactionBlock(txb); // Set auto claim const txb = await stream.setAutoClaim(true); const res = await wallet.signAndExecuteTransactionBlock(txb); // Claim by proxy const txb = await stream.claimByProxy(); const res = await wallet.signAndExecuteTransactionBlock(txb); ``` For detailed explanation of these operations, please check key-concepts. **Get stream list as recipient** ``` const it = await client.getIncomingStreams({ status: 'STREAMING' | 'STREAMED', sender: someSender, }); while (await it.hasNext()) { const sts = await it.next(); sts.forEach((st) => { if (st.type === 'Stream') { console.log((st as Stream).info); } else if (st.type === 'StreamGroup') { console.log((st as StreamGroup).info); } }) } ``` **Get stream list as sender** ``` const it = await client.getOutgoingStreams({ status: 'STREAMING' | 'STREAMED', recipient: someAddress, }); while (await it.hasNext()) { const sts = await it.next(); sts.forEach((st) => { if (st.type === 'Stream') { console.log((st as Stream).info); } else if (st.type === 'StreamGroup') { console.log((st as StreamGroup).info); } }) } ``` #### Deployed contracts and objects **Mainnet** <table><thead><tr><th width="188">Field</th><th>ID</th></tr></thead><tbody><tr><td>Package</td><td>0xc357c3985e8fb875d6b37141497af660779aa1bab0ec489b2213efd74067d1fa</td
프로젝트로 돌아가기