Create a simple Voting DApp with Solidity 1/2
Vložit
- čas přidán 10. 07. 2023
- In this tutorial, you will learn how to build a basic decentralized voting application (DApp) using Solidity, a programming language for writing smart contracts on the Ethereum blockchain.
The tutorial will guide you through the step-by-step process of setting up the development environment, including installing necessary tools such as the Solidity compiler and the Ethereum development framework. You will also learn about the basic concepts of blockchain and smart contracts.
Next, you will dive into the implementation of the Voting DApp. Starting from the smart contract design, you will learn how to define the necessary data structures and functions for creating, managing, and tallying votes. You will explore concepts such as contract deployment, interacting with the contract using web3.js, and handling events.
As you progress through the tutorial, you will gain hands-on experience in writing Solidity code, deploying smart contracts to the Ethereum test network, and interacting with your DApp through a user-friendly web interface. You will also learn best practices for security and efficiency when designing and deploying smart contracts.
By the end of this tutorial, you will have a fully functional Voting DApp that enables users to create polls, cast votes, and view the results in a decentralized and transparent manner.
Whether you are a beginner looking to get started with blockchain development or an experienced developer interested in building decentralized applications, this tutorial will provide you with the knowledge and skills needed to create your own simple Voting DApp using Solidity. Get ready to embark on an exciting journey into the world of decentralized voting!
---------------------------------------
⭐ Follow us on Social Media ⭐
💻 LinkedIn/onecodecamp
🐦 Twiter/onecodecamp
📷 Instagram/onecodecamp
📱 Facebook/onecodecamp
so easy to understand with basic knowledge. Bravo.
how do we switch this from polygon mumbai to polygon amoy
code link?
Who did these subtitles? They were constantly messing up what you were saying lol, but I could still hear what you were saying even without them, thankfully
Thanks! can I have your github link?
Bro, in minute 12.27, you talked about getting an application as a prerequisite. Please which application is this?
He said you need to install Git. The subtitles are all messed up lol
there is no deploy.js after creating hardhat , instead getting iginition\modules folder under which it has Lock.js , and also another Lock.js uder test folder like seen in video
same issue i am having
@@loneewolf15 what did you do ? I just made a script folder and deploy. js on my own
@@shobika.g9462 same thing
in meta mask the network mumbai is not working ..can we use another network
Will it work in another network
yes you can! just make sure you get the right rpc url
@@user-xq4zg8tl1h all we need to change is the url? what about the mumbai installation he made?
bro, when i am deploying my contract it is showing "Contract Address deployed: undefined" it is showing undefined how to get my contract address now ????
Ur deployment was successful but you have a typo in your code that's why it doesn't show the contract address faced the same issue but I fixed it later
how you fixed it@@steveantony5775
I also have the same problem! Not sure what to do. Any ideas?
@@matthewhigginbottom2580 need to see the code
@@matthewhigginbottom2580 need to see the code
zhihai2
lknlkjnlnln
how do I fix these errors (the ones underlined)?
------------------------------------------------------------------------------------------------
First Error:
the code:
for (uint256 i = 0; i < _candidates.length; i++) {
candidates.push(
);
}
error message: Named argument "numberOfVotes" does not match function declaration.
------------------------------------------------------------------------------------------------
Second Error:
the code:
// to vote function
function voteTo(uint256 _id) public electionOngoing {
require(checkElectionPeriod(), "Election period has ended");
require(!voterStatus(msg.sender), "You already voted. You can only vote once.");
voters[msg.sender] = true;
listOfVoters.push(msg.sender);
}
error message: Member "numberOfVotes" not found or not visible after argument-dependent lookup in struct Voting.Candidate storage ref.