Skip to content

A simple yet powerful Ethereum smart contract to manage your daily tasks directly on the blockchain! Built using Solidity by a passionate beginner learning through YouTube tutorials and ChatGPT guidance. πŸŽ₯πŸ€–

Notifications You must be signed in to change notification settings

KenidoesCode/TodoList

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 
Β 
Β 

Repository files navigation

βœ… TodoList Smart Contract

A simple yet powerful Ethereum smart contract to manage your daily tasks directly on the blockchain! Built using Solidity by a passionate beginner learning through YouTube tutorials and ChatGPT guidance. πŸŽ₯πŸ€–


🧠 What I Learned in My Second Solidity Project

After building my first wallet, I wanted to take it one step further. This TodoList taught me about structs, arrays, and more real-world logic. Here's what I picked up:

πŸ” Key Concepts Understood

  • βœ… How to define and use struct for creating task objects
  • βœ… Storing multiple items using a Task[] dynamic array
  • βœ… How public lets you view contract variables from outside
  • βœ… Writing functions to add new tasks and read specific ones
  • βœ… Using for loops in Solidity to search for tasks by ID
  • βœ… Toggling boolean values (true ↔ false) with ! operator
  • βœ… Error handling using revert()

πŸ› οΈ Contract Features

πŸ”§ Function πŸ’‘ What It Does
addTask() Add a new task with description and ID
getTask() Fetch a task’s details using its unique ID
toggleTask() Flip task status between completed and not completed

πŸ§ͺ How to Use It (via Remix)

  1. Go to Remix IDE
  2. Create a new file TodoList.sol and paste the contract code
  3. Compile using version 0.8.0 or above
  4. Deploy to local VM or Injected Web3 (MetaMask)
  5. Use the UI to:
    • πŸ†• Add a task
    • πŸ” Get a task by ID
    • πŸ” Toggle a task's status (complete/incomplete)

πŸ“¦ Contract Code Snapshot

Task[] public alltasks;
uint public currentId = 1;

function addTask(string memory description) public {
    alltasks.push(Task(currentId, description, false));
    currentId++;
}

About

A simple yet powerful Ethereum smart contract to manage your daily tasks directly on the blockchain! Built using Solidity by a passionate beginner learning through YouTube tutorials and ChatGPT guidance. πŸŽ₯πŸ€–

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published