Our project, the Animal Welfare Dapp, is designed to facilitate donations for animal feeding through a decentralized platform. The app allows users to create and manage donation posts, where Feeders can list their needs for feeding animals, and Donors can contribute funds to these posts. By leveraging Stellar smart contracts, our app ensures transparency and security when managing donations and posts.
In order to deploy the smartcontract you will need an account. You can either use the an account from the Freighter Wallet or can configure an account named alice in the testnet using the command
soroban keys generate --global alice --network testnet
Smart Contract Design:
The core of our implementation is a Stellar smart contract written in Rust, using the soroban-sdk. The contract includes several key functionalities:
Post Management:
add_post: Allows Feeders to create new posts, including details such as title, description, wallet address, and donation goals.
delete_post: Permits the deletion of posts if needed.
update_post: Enables updates to existing posts, including changing the title and description.
get_posts: Retrieves all posts available in the system.
view_post_by_id: Fetches a specific post by its ID.
Donation Management:
donate: Allows Donors to contribute funds to a feeder post.
Motivation:
The motivation behind this project is to create a transparent and user-friendly platform for animal welfare. By using Stellar smart contracts, we aim to provide a decentralized solution that ensures the integrity of donation data and the proper management of posts.
Learning Experience:
Working with Stellar's smart contracts and the soroban-sdk has been a valuable learning experience. It provided insights into Rust programming for blockchain applications and the intricacies of smart contract development on Stellar. We gained hands-on experience in handling data storage, managing state, and implementing secure donation mechanisms.
Pride Points:
We are particularly proud of the following aspects of our project:
Transparency: The use of smart contracts ensures that all interactions (posts and donations) are recorded and immutable, providing complete transparency.
Ease of Use: The intuitive design of the app and the straightforward interaction with the smart contract make it easy for both Feeders and Donors to use.
Error Handling and Logging: Comprehensive error handling and detailed logging help maintain the contract's reliability and make debugging easier.
Next Steps
In the future, we hope to expand the functionality of the app by adding features such as:
Advanced Analytics: Provide Feeders with analytics on donation trends and donor engagement.
Enhanced User Interface: Improve the UI/UX to make the app more engaging and accessible.
Invoking the Smart Contract
Certainly! Here are the commands to invoke the functions from the new smart contract:
Create Post
stellar contract invoke --id YOUR_CONTRACT_ID --network testnet --source YOUR_KEYNAME -- create_post --title"Feed the Cats"--description"Donation to feed stray cats"--amount_requested 500 --image_url"https://example.com/cat_food.jpg"--feeder_address"GA3F45EXAMPLEWALLET"