Developing a ToDo list dApp in Ethereum

Photo by Roman Synkevych on Unsplash
Centralized System
You should now see this
  1. Installed and launched Ganache
  2. Launched a local Blockchain on a localhost port
  3. Changed Metamask to work on our local Blockchain
  4. And imported our private accounts
contract Todo {
uint public count = 0;
struct Task {
uint id;
string content;
bool completed;
mapping(uint => Task) public tasks;
function createTask(string memory _content) public {
count = count + 1;
tasks[count] = Task(taskCount, _content, false);
emit TaskCreated(taskCount, _content, false);
event TaskCreated(
uint id,
string content,
bool completed
event TaskCompleted(
uint id,
bool completed
function checkTask(uint _id) public {
Task memory _task = tasks[_id];
_task.completed = !_task.completed;
tasks[_id] = _task;
emit TaskCompleted(_id, _task.completed);
Code for the Solidity Smart Contract
var Todo = artifacts.require(“./Todo.sol”);
module.exports = function(deployer)
{ deployer.deploy(Todo);};
truffle migrate
truffle console
todo = await Todo.deployed()
todo.createTask(“Give me 50 claps!”)
task = await todo.tasks(1)




Building: Ignite Tournaments / Former: DeFi Alliance, Persistence, Eth India Co

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Writing your first Smart Contract

Swarming: The New Future of Data Storage

April 2021 Community Update

UniX Gaming Partners With Unvest To Distribute Its Project Tokens Through Innovative Blockchain…

#Buidl Ethereum dApp activity feed in a few lines of code!— Tutorial

AMA with Gem Hunters: Defining Edge Computing and Scaling the StrongNode Ecosystem with Original…

AMA Highlights with Polygon Mania: StrongNode CEO Daniel Saito and CPO Gil Bashan share details on…

Announcing our Partnership with Aleph Zero: a Peer-reviewed Public Blockchain with Private Smart…

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Abhinav Srivastava

Abhinav Srivastava

Building: Ignite Tournaments / Former: DeFi Alliance, Persistence, Eth India Co

More from Medium

NFT’s in Present Day

How is Africa Dealing With Sanitizing Water?

Kūsho and Overdrive join forces to bridge design and crypto

I learned about Subsquid in discord