Skip to content

23f3004491/Charity-Support-Platform

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

alt text

Charity Support Platform

A decentralized charity donation platform built on Aptos blockchain where users can donate to charity campaigns with all transactions tracked on-chain.

Overview

This smart contract enables:

  • Charity organizers to create fundraising campaigns with target amounts
  • Donors to contribute APT coins transparently
  • On-chain tracking of total donations and donor count per campaign

Features

  • Create Campaign: Initialize a new charity campaign with a fundraising target
  • Donate to Charity: Contribute APT coins to any registered charity campaign
  • On-Chain Tracking: All donations, donors, and campaign progress are recorded immutably on the blockchain

Project Structure

Aptos-meetup/
├── sources/
│   └── project.move           # Smart contract code
├── Move.toml                  # Project configuration
└── README.md                  # This file

Smart Contract Details

Module Name: CharityModule::CharityPlatform

Module Address: f9ac9420e52ca2ffb2b157cb0340ed8ec2b4ba4bb9b73666422ad64e42287b71

Functions

1. create_campaign(organizer: &signer, target_amount: u64)

Creates a new charity campaign.

Parameters:

  • organizer: The account creating the campaign
  • target_amount: The fundraising goal in APT tokens

Example:

create_campaign(organizer, 1000000000); // 10 APT

2. donate_to_charity(donor: &signer, charity_address: address, amount: u64)

Donate APT tokens to a charity campaign.

Parameters:

  • donor: The account making the donation
  • charity_address: Address of the charity organizer
  • amount: Amount to donate in APT tokens

Example:

donate_to_charity(donor, 0xf9ac9420..., 100000000); // 1 APT

Data Structures

CharityCampaign

struct CharityCampaign {
    total_donations: u64,   // Total funds raised
    target_amount: u64,     // Fundraising goal
    donor_count: u64,       // Number of donors
}

Prerequisites

  • Aptos CLI installed
  • Aptos wallet with testnet APT tokens
  • Move knowledge (basic understanding of the Move language)

Installation & Setup

  1. Clone/Navigate to project:
cd Aptos-meetup
  1. Create an Aptos profile (if not already created):
aptos init --profile tarun1
  1. Fund your account with testnet APT from the Aptos Faucet

Compilation

Compile the smart contract:

aptos move compile

Expected output:

BUILDING Charity_app
Result: f9ac9420e52ca2ffb2b157cb0340ed8ec2b4ba4bb9b73666422ad64e42287b71::CharityPlatform

Deployment

Deploy the contract to Aptos testnet:

aptos move publish --profile tarun1

This will:

  1. Compile your contract
  2. Create a publish transaction
  3. Sign with your tarun1 profile
  4. Submit to the Aptos testnet

Usage Examples

1. Create a Campaign (Command Line)

aptos move run --function-id f9ac9420e52ca2ffb2b157cb0340ed8ec2b4ba4bb9b73666422ad64e42287b71::CharityPlatform::create_campaign --args 1000000000 --profile tarun1

2. Donate to Campaign

aptos move run --function-id f9ac9420e52ca2ffb2b157cb0340ed8ec2b4ba4bb9b73666422ad64e42287b71::CharityPlatform::donate_to_charity --args @<CHARITY_ADDRESS> 100000000 --profile tarun1

Replace <CHARITY_ADDRESS> with the actual charity address.

Verification

Check deployed modules:

aptos account list --query modules --profile tarun1

Configuration

Move.toml settings:

[package]
name = "Charity_app"
version = "0.1.0"

[dependencies]
AptosFramework = { git = "https://github.com/aptos-labs/aptos-core.git", subdir = "aptos-move/framework/aptos-framework", rev = "mainnet" }

[addresses]
aptos_framework = "0x1"
CharityModule = "0xf9ac9420e52ca2ffb2b157cb0340ed8ec2b4ba4bb9b73666422ad64e42287b71"

Testing

To test locally without deploying:

aptos move test

Troubleshooting

Compilation Errors

Error: "address 'aptos_framework' is not assigned a value"

  • Solution: Ensure Move.toml has the correct [addresses] section with aptos_framework = "0x1"

Error: "Name of dependency declared does not match"

  • Solution: Change dependency name to AptosFramework in Move.toml

Deployment Issues

Error: "insufficient balance"

Security Considerations

  • All donations are irreversible (by design)
  • Only the campaign creator's address stores the campaign data
  • APT tokens are transferred directly on-chain

Future Enhancements

  • Multi-sig approval for campaign creation
  • Withdrawal mechanisms for organizers
  • Campaign expiration dates
  • Refund logic if target not met
  • Campaign categorization/tags

Resources

License

MIT

Author

Tarun Gangwar


Questions? Refer to the Aptos official documentation or community Discord.

About

Decentralized charity donation platform on Aptos blockchain. Organizers create campaigns, donors contribute APT tokens, all transactions tracked on-chain transparently. Built with Move smart contracts for secure, immutable charitable giving.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages