DEV Community

Cover image for I Built TalknDo over the Weekend
Bello Bambo
Bello Bambo

Posted on

I Built TalknDo over the Weekend

DEV Weekend Challenge: Passion Edition Submission

This is a submission for Weekend Challenge: Passion Edition

What I Built

I love working out, yet I still find ways to skip it. That experience taught me that passion alone does not always lead to action, sometimes we need accountability and real consequences to follow through.
This inspired me to build TalknDo, a Solana-based accountability platform that turns personal goals into challenges you commit to overcoming. Users create a challenge, set a deadline, and stake SOL on completing it, giving them an extra push when motivation fades.

To activate a challenge, the user provides a title, description or supporting file, stake amount, and deadline, then signs a Solana transaction. Once the challenge is completed, the user uploads proof, reclaims the staked SOL, and receives a non-transferable NFT achievement badge minted with Metaplex Core. If the deadline is missed, the challenge
expires and the staked SOL is transferred to a charity escrow account, where only authorized treasury members can withdraw it for charitable causes.

Although TalknDo was inspired by my passion for fitness, it is built for everyone. It can be used to stay committed to studying, learning a new skill, completing a side project, pursuing a creative goal, or achieving anything else that matters. Whatever your passion, TalknDo helps you turn your intention into a challenge, your commitment into action, and your progress into an achievement.

Live Project: https://talkndo-fe.vercel.app

Demo

Video Demo For TalknDo

Code

Smart Contract Function to create a Challenge/Goal:

Smart Contract Function to complete a challenge:

Function to Expire an ended/uncompleted challenge:

Function to Withdraw Charity Funds:

Function to Give User Charity Funds Withdrawal Access:

Function to Remove a User From Charity Funds Withdrawal Access:

Frontend Required Imports to sign transactions on-chain:

IDL JSON file:

Deployed Program ID(Devnet):

Github (Smart Contract): https://github.com/bellobambo/talk-do
Github (Frontend): https://github.com/bellobambo/talkndo-fe

How I Built It

  1. I built the TalknDo smart contract on Solana using Rust and the Anchor framework. The program is deployed with the Program ID (Solana Devnet): 9CLYHqqCBfDsuDrwooBbzV8FuvVzsZwadUCZ2NLWSURE, which identifies the contract on the Solana network.

  2. I used Program Derived Addresses (PDAs) to create secure and deterministic accounts for challenges, program configuration, treasury members, and charity funds. Each challenge PDA is derived from the challenge seed, the creator’s wallet address, and a unique challenge ID.

  3. I built the frontend with Next.js, React, TypeScript, Tailwind CSS, and Ant Design. Solana Wallet Adapter connects the user’s wallet, while Web3.js and the Anchor TypeScript client handle account addresses, transaction construction, signing, and submission.

  4. The frontend imports the generated Anchor IDL, which describes the program’s instructions, accounts, arguments, and data structures. It uses the IDL, connected wallet, RPC connection, and Program ID to create an Anchor Program instance. This allows the frontend to call the Rust smart contract through methods such as initializeChallenge(), completeChallenge(), and expireChallenge().

  5. When a user creates a challenge, the frontend uploads any supporting file to IPFS through Pinata and receives a metadata URI. It then converts the stake from SOL to lamports, converts the deadline to a Unix timestamp, derives the challenge PDA, and calls initializeChallenge(). The smart contract validates the title, deadline, metadata URI, and stake before transferring the SOL into the challenge PDA, which acts as an on-chain escrow account.

  6. The frontend reads challenge accounts from the program and uses their on-chain status and deadlines to organize them into active, completed, and expired challenges.

  7. To complete a challenge, the user uploads a PDF or image as proof. The frontend stores the file on IPFS, generates and uploads the NFT badge metadata, creates a new badge asset keypair, and calls completeChallenge(). The wallet signs the transaction before it is submitted to the Solana network.

  8. The completeChallenge() instruction verifies that the challenge is active, the deadline has not passed, and the proof and badge URIs are valid. It then records the proof URI, returns the staked SOL to the creator, and updates the challenge status to completed.

  9. After successful completion, the smart contract uses a Cross-Program Invocation to Metaplex Core to mint an NFT achievement badge. A permanent freeze delegate makes the badge non-transferable, allowing it to serve as permanent proof that the user completed the challenge.

  10. If a user misses the deadline, the frontend can call expireChallenge(). The smart contract confirms that the challenge is overdue, changes its status to failed, and transfers the staked SOL from the challenge escrow to the charity escrow. Authorized treasury members can call
    withdrawCharityFunds() to send funds from the charity account to a selected recipient. The contract validates their treasury membership, checks the available balance, and preserves the account’s minimum rent reserve.

  11. I included account constraints, signer checks, deadline and status validation, checked arithmetic, custom errors, and PDA verification to improve the security and reliability of the program.

  12. The smart contract emits events for challenge creation, proof submission, NFT badge issuance, challenge expiration, treasury membership changes, and charity withdrawals, helping the frontend track and display on-chain activity.

NFT Completion Badge & Badge Details:

Prize Categories

Best Use of Solana: TalknDo uses Solana for on-chain goal setting, SOL staking through PDA-based escrow accounts, proof-of-completion records, and charity fund management. Successful users also receive non-transferable NFT badges minted with Metaplex Core.

Top comments (0)