{"id":20002815,"url":"https://github.com/codewithmide/solana_deposit_withdraw","last_synced_at":"2026-05-13T03:33:34.331Z","repository":{"id":254936761,"uuid":"848020802","full_name":"codewithmide/solana_deposit_withdraw","owner":"codewithmide","description":null,"archived":false,"fork":false,"pushed_at":"2024-08-27T01:37:50.000Z","size":15,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-12T13:23:36.212Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/codewithmide.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-08-27T01:36:11.000Z","updated_at":"2024-08-27T01:37:53.000Z","dependencies_parsed_at":null,"dependency_job_id":"7ba42b11-accf-4795-b73b-910f285141ea","html_url":"https://github.com/codewithmide/solana_deposit_withdraw","commit_stats":null,"previous_names":["codewithmide/solana_deposit_withdraw"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codewithmide%2Fsolana_deposit_withdraw","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codewithmide%2Fsolana_deposit_withdraw/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codewithmide%2Fsolana_deposit_withdraw/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codewithmide%2Fsolana_deposit_withdraw/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codewithmide","download_url":"https://codeload.github.com/codewithmide/solana_deposit_withdraw/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241441053,"owners_count":19963344,"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":[],"created_at":"2024-11-13T05:23:10.372Z","updated_at":"2026-05-13T03:33:34.268Z","avatar_url":"https://github.com/codewithmide.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Solana Deposit and Withdraw Program\n\n## Overview\n\nThis project implements a native Solana program that allows users to initialize an account, deposit SOL into it, and withdraw 10% of the deposited SOL at a given time. It serves as a basic example of how to create and interact with Solana programs.\n\n## Table of Contents\n\n1. [Features](#features)\n2. [Prerequisites](#prerequisites)\n3. [Installation](#installation)\n4. [Usage](#usage)\n   - [Deploying the Program](#deploying-the-program)\n   - [Interacting with the Program](#interacting-with-the-program)\n5. [Program Structure](#program-structure)\n6. [Client Application](#client-application)\n7. [Testing](#testing)\n8. [Security Considerations](#security-considerations)\n9. [Contributing](#contributing)\n\n## Features\n\n- Initialize a new account\n- Deposit SOL into the account\n- Withdraw 10% of the deposited SOL\n- Rust-based Solana program\n- Client application for easy interaction\n\n## Prerequisites\n\nBefore you begin, ensure you have the following installed:\n\n- [Rust](https://www.rust-lang.org/tools/install) (latest stable version)\n- [Solana CLI Tools](https://docs.solana.com/cli/install-solana-cli-tools) (version 1.18.4 or compatible)\n- [Git](https://git-scm.com/downloads)\n\n## Installation\n\n1. Clone the repository:\n\n   ```bash\n   git clone https://github.com/codewithmide/solana_deposit_withdraw.git\n   cd solana_deposit_withdraw\n   ```\n\n2. Build the program:\n\n   ```bash\n   cargo build-bpf\n   ```\n\n## Usage\n\n### Deploying the Program\n\n1. Ensure you have a Solana keypair set up:\n\n   ```bash\n   solana-keygen new\n   ```\n\n2. Set your Solana configuration to a test network (e.g., devnet):\n\n   ```bash\n   solana config set --url https://api.devnet.solana.com\n   ```\n\n3. Airdrop some SOL to your account (if on devnet):\n\n   ```bash\n   solana airdrop 2\n   ```\n\n4. Deploy the program:\n\n   ```bash\n   solana program deploy target/deploy/solana_deposit_withdraw.so\n   ```\n\n5. Save the program ID output after deployment.\n\n### Interacting with the Program\n\nUse the provided client application to interact with the deployed program. See the [Client Application](#client-application) section for details.\n\n## Program Structure\n\nThe Solana program consists of three main functions:\n\n1. `initialize_account`: Sets up a new account with zero balance.\n2. `deposit`: Allows depositing SOL into the account.\n3. `withdraw`: Enables withdrawing 10% of the account's balance.\n\nThe program uses the Borsh serialization format for account data.\n\n## Client Application\n\nA Rust-based client application is provided to interact with the deployed program. To use it:\n\n1. Navigate to the client directory:\n\n   ```bash\n   cd client\n   ```\n\n2. Update the program ID in `src/main.rs` with your deployed program ID.\n\n3. Run the client:\n\n   ```bash\n   cargo run\n   ```\n\nThe client demonstrates account initialization, SOL deposit, and withdrawal.\n\n## Testing\n\nTo run the program tests:\n\n```bash\ncargo test-bpf\n```\n\nThis will execute the test suite and verify the program's functionality.\n\n## Security Considerations\n\n- This program is for educational purposes and not audited for production use.\n- Ensure proper access controls and input validation in a real-world scenario.\n- Be cautious with handling user funds and implement necessary safety checks.\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodewithmide%2Fsolana_deposit_withdraw","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodewithmide%2Fsolana_deposit_withdraw","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodewithmide%2Fsolana_deposit_withdraw/lists"}