The Charity Donation Tracking System is a decentralized smart contract module designed to ensure transparency, accountability, and traceability in charitable giving. Built on the SUI blockchain, this system allows donors, recipients, and authorities to participate in secure, verifiable donation flows — from contribution to validation and final delivery.
This module enables:
- Transparent donation tracking
- Validation of funds by trusted authorities
- Secure fund transfers to recipients
- Smart contract-enforced rules for cancellations, updates, and auditing
| Field | Description |
|---|---|
id |
Unique donation identifier |
donor_address |
Address of the donor |
purpose_id |
Identifier for the donation's intended purpose |
amount |
Total donation amount |
balance |
SUI token balance representing available funds |
recipient_is_pending |
true if the recipient hasn't yet claimed the donation |
authority_validation |
true if the donation is validated by an authority |
Administrative capability token for managing core module functions.
| Field | Description |
|---|---|
id |
Unique identifier for the donation receipt |
donation |
ID of the associated donation |
amount_donated |
Amount recorded in the receipt |
Creates a new donation with a specified purpose and amount. Returns a capability for managing the donation.
Allows the donor to deposit additional SUI into the donation, generating a receipt.
Updates the purpose_id of a pending donation. Restricted to the donor.
Withdraws the balance of a donation. Only permitted for the donation's owner.
Cancels a donation (if not yet received), returning the balance to the donor.
validate_donation— Authorities can validate a donationmark_donation_received— Recipient confirms donation receiptget_donation_details— Fetch complete donation metadataupdate_donation_amount— Adjust the donation amountupdate_donation_purpose_id— Modify donation purpose IDis_donation_pending— Check if donation is awaiting recipientis_donation_validated— Check if validated by an authorityupdate_receipt_amount_donated— Update donation amount in a receiptis_cap_owner_of_donation— Verify if capability owns the donationis_cap_owner_of_receipt— Verify receipt ownershipget_donation_purpose_id— Retrieve donation's purposeget_receipt_donation_id— Get associated donation ID from receiptget_receipt_amount_donated— Fetch recorded amount from receiptget_donation_donor_address— Get donor addressget_donation_recipient_pending_status— Check recipient pending statusget_donation_authority_validation_status— Check validation status
- Rust and Cargo
- SUI Blockchain — Set up a local SUI node for development
-
Clone the repository:
git clone <your-repo-url> cd charity-donation-tracking
-
Build the smart contracts:
cargo build --release
-
Deploy to SUI blockchain (using CLI or deployment scripts):
- Note the deployed contract address and any relevant object IDs for interaction
- Call
newwith desiredpurpose_idandamount - Fund the donation using
deposit
- Authorities call
validate_donationto approve donations
- Recipients use
mark_donation_receivedafter authority validation
- Donors may cancel unclaimed donations with
cancel_donation
- Use
update_donation_purpose_idorupdate_donation_amountbefore validation
- Use the SUI command-line interface to call contract functions
- Monitor transaction hashes and event logs for status updates
- Integrate with web apps using JavaScript libraries like
Web3.js,Ethers.js, or SUI-compatible libraries - Build UIs for donation tracking, validation dashboards, or NGO portals
- End-to-End Transparency
- Donor Control & Receipts
- Immutable Audit Trails
- Authority-Based Validation
- Decentralized & Trustless Infrastructure
The Charity Donation Tracking Smart Contract enables a verifiable, decentralized donation process that protects donors, empowers recipients, and ensures compliance through transparent validation. Built on the SUI blockchain, it serves as a model for trust-based charitable systems in the web3 era.