{"id":17946538,"url":"https://github.com/kunaldhongade/stellar-token-builder","last_synced_at":"2025-08-08T06:08:23.162Z","repository":{"id":259098024,"uuid":"876310565","full_name":"kunaldhongade/stellar-token-builder","owner":"kunaldhongade","description":" stellar Token Builder is a smart contract project built using Soroban SDK on the Stellar blockchain. It enables users to create custom tokens, manage liquidity pools, and perform token swaps efficiently. This project offers a powerful toolset for decentralized finance (DeFi) applications and token-based ecosystems","archived":false,"fork":false,"pushed_at":"2024-10-26T19:15:50.000Z","size":27,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-09T03:41:14.633Z","etag":null,"topics":["cargo","rust","smart-contracts","soroban","stellar","stellar-tokens","token","token-management","token-manager","tokens"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kunaldhongade.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-10-21T18:50:16.000Z","updated_at":"2024-10-26T19:21:43.000Z","dependencies_parsed_at":"2024-12-16T16:05:55.246Z","dependency_job_id":"7ecd4ffa-d762-4eba-ac8c-1f4d349ae8ca","html_url":"https://github.com/kunaldhongade/stellar-token-builder","commit_stats":null,"previous_names":["kunaldhongade/stellar-token-builder"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kunaldhongade%2Fstellar-token-builder","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kunaldhongade%2Fstellar-token-builder/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kunaldhongade%2Fstellar-token-builder/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kunaldhongade%2Fstellar-token-builder/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kunaldhongade","download_url":"https://codeload.github.com/kunaldhongade/stellar-token-builder/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247024067,"owners_count":20870935,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cargo","rust","smart-contracts","soroban","stellar","stellar-tokens","token","token-management","token-manager","tokens"],"created_at":"2024-10-29T07:06:06.769Z","updated_at":"2025-04-03T14:44:24.331Z","avatar_url":"https://github.com/kunaldhongade.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# **Stellar Token Builder**\n\n## **Overview**\n\nLumiFi Token Builder is a smart contract project built using **Soroban SDK** on the Stellar blockchain. It enables users to create custom tokens, manage liquidity pools, and perform token swaps efficiently. This project offers a powerful toolset for decentralized finance (DeFi) applications and token-based ecosystems.\n\n---\n\n## 🎉 **Deployment Successful!**\n\n🔗 [Contract on Stellar Expert](https://stellar.expert/explorer/testnet/contract/CBSZTRZYLMZI4PMU34MBO5KRCBQ3P4CSLIPV3QSHUITO7TTXFYOVK3QO)\n\n✅ **Deployed Contract ID**: `CBSZTRZYLMZI4PMU34MBO5KRCBQ3P4CSLIPV3QSHUITO7TTXFYOVK3QO`\n\n---\n\n## **Features**\n\n- **Token Creation:** Easily create custom tokens with specified names, symbols, and decimals.\n- **Minting and Transfers:** Admins can mint tokens to users, and users can transfer tokens securely.\n- **Liquidity Pools:** Add and withdraw liquidity in pools to facilitate decentralized trading.\n- **Token Swaps:** Swap one token for another with minimal slippage, ensuring smooth transactions.\n- **Secure Authorization:** Ensures that only authorized users can perform specific actions, like minting or transfers.\n\n---\n\n## **Contract Architecture**\n\n1. **`Token` Contract:**\n   - Handles token creation, minting, and transferring.\n2. **`LiquidityPool` Contract:**\n   - Manages liquidity addition and removal, enabling decentralized trading.\n3. **`Swap` Contract:**\n   - Allows users to swap one token for another securely.\n\n---\n\n## **How to Use**\n\n### 1. **Setup Environment**\n\nMake sure you have the following installed:\n\n- **Rust**: [Install Rust](https://www.rust-lang.org/tools/install)\n- **Soroban CLI**: [Install Soroban CLI](https://soroban.stellar.org/docs/getting-started/setup)\n\nClone the repository:\n\n```bash\ngit clone https//www.github.com/kunaldhongade/stellar-token-builder\ncd stellar-token-builder\n```\n\n---\n\n### 2. **Build and Deploy Contracts**\n\nCompile the smart contracts:\n\n```bash\nsoroban contract build\n```\n\nDeploy the contracts using the Soroban CLI:\n\n```bash\nsoroban contract deploy --wasm target/wasm32-unknown-unknown/release/lumifi_token_laucher.wasm\n```\n\n---\n\n### 3. **Contract Functions**\n\n#### **Token Contract**\n\n- **Create Token**\n\n  ```rust\n  Token::create_token(env, admin_address, 18, \"MyToken\".into(), \"MTK\".into());\n  ```\n\n  - Creates a new token with specified name, symbol, and decimals.\n\n- **Mint Tokens**\n\n  ```rust\n  Token::mint(env, user_address, 1000);\n  ```\n\n  - Mints `1000` tokens to the specified user.\n\n- **Transfer Tokens**\n\n  ```rust\n  Token::transfer(env, from_address, to_address, 100);\n  ```\n\n  - Transfers `100` tokens from one user to another.\n\n- **Check Balance**\n  ```rust\n  let balance = Token::balance(env, user_address);\n  println!(\"User balance: {}\", balance);\n  ```\n  - Retrieves the balance of a specific user.\n\n#### **Liquidity Pool Contract**\n\n- **Initialize Pool**\n\n  ```rust\n  LiquidityPool::initialize_liquidity(env, token_a_address, token_b_address);\n  ```\n\n  - Sets up a new liquidity pool for two tokens.\n\n- **Deposit Liquidity**\n\n  ```rust\n  LiquidityPool::deposit(env, user_address, 500, 500);\n  ```\n\n  - Adds liquidity to the pool.\n\n- **Withdraw Liquidity**\n  ```rust\n  let (amount_a, amount_b) = LiquidityPool::withdraw(env, user_address, 100);\n  println!(\"Withdrawn: {} Token A, {} Token B\", amount_a, amount_b);\n  ```\n\n#### **Swap Contract**\n\n- **Perform Swap**\n  ```rust\n  Swap::swap(env, user_address, buy_token_address, sell_token_address, 100, 90);\n  ```\n  - Swaps `100` units of `sell_token` for `buy_token` with a minimum required `90`.\n\n---\n\n## **Example Workflow**\n\n1. **Create a Token**: Use the `Token::create_token()` function to deploy a new token.\n2. **Mint Tokens**: Mint tokens for yourself or users.\n3. **Add Liquidity**: Add liquidity to a pool for decentralized trading.\n4. **Swap Tokens**: Swap between tokens using the `Swap` contract.\n5. **Withdraw Liquidity**: Withdraw liquidity from the pool when needed.\n\n---\n\n## **Error Handling**\n\n- **Slippage Exceeded:** The buy amount is less than the minimum specified during the swap.\n- **Insufficient Balance:** The user doesn't have enough tokens to complete a transaction.\n- **Unauthorized Access:** The action requires admin authorization (e.g., minting tokens).\n\n---\n\n## **Security Considerations**\n\n- **Authorization:** Uses Stellar’s native `require_auth()` to ensure only authorized users can perform sensitive operations.\n- **Slippage Protection:** Prevents swaps that result in unfavorable rates for users.\n- **Safe Storage:** Token balances are stored securely using the Soroban SDK's storage.\n\n---\n\n## **Contributing**\n\nWe welcome contributions to enhance the LumiFi Token Builder! Feel free to submit a pull request or open an issue.\n\n---\n\n## **License**\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n---\n\n## **Acknowledgments**\n\nThanks to the Stellar Development Foundation for the amazing Soroban SDK, and the open-source community for their valuable contributions!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkunaldhongade%2Fstellar-token-builder","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkunaldhongade%2Fstellar-token-builder","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkunaldhongade%2Fstellar-token-builder/lists"}