Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ function createProposal(string memory _description) public {

```
function voteYes(uint _proposalId, uint _tokenAmount) public {
require(isMember[msg.sender] == true, "You should be a memeber to vote");
require(isMember[msg.sender] == true, "You should be a member to vote");
require(balances[msg.sender] >= _tokenAmount, "Not enough tokens to vote");
require(votes[msg.sender][_proposalId] == false, "You have already voted for this proposal");
votes[msg.sender][_proposalId] = true;
Expand Down Expand Up @@ -57,7 +57,7 @@ function voteYes(uint _proposalId, uint _tokenAmount) public {

```
function voteNo(uint _proposalId, uint _tokenAmount) public {
require(isMember[msg.sender] == true, "You should be a memeber to vote");
require(isMember[msg.sender] == true, "You should be a member to vote");
require(balances[msg.sender] >= _tokenAmount, "Not enough tokens to vote");
require(votes[msg.sender][_proposalId] == false, "You have already voted for this proposal");
votes[msg.sender][_proposalId] = true;
Expand Down Expand Up @@ -188,7 +188,7 @@ contract DAO {

// Function for a member to vote on a proposal
function voteYes(uint _proposalId, uint _tokenAmount) public {
require(isMember[msg.sender] == true, "You should be a memeber to vote");
require(isMember[msg.sender] == true, "You should be a member to vote");
require(balances[msg.sender] >= _tokenAmount, "Not enough tokens to vote");
require(votes[msg.sender][_proposalId] == false, "You have already voted for this proposal");
votes[msg.sender][_proposalId] = true;
Expand All @@ -199,7 +199,7 @@ contract DAO {
}

function voteNo(uint _proposalId, uint _tokenAmount) public {
require(isMember[msg.sender] == true, "You should be a memeber to vote");
require(isMember[msg.sender] == true, "You should be a member to vote");
require(balances[msg.sender] >= _tokenAmount, "Not enough tokens to vote");
require(votes[msg.sender][_proposalId] == false, "You have already voted for this proposal");
votes[msg.sender][_proposalId] = true;
Expand All @@ -221,6 +221,6 @@ contract DAO {

## That’s a wrap

You did great! You have learnt the basics of writing an `DAO` contract in Solidity programming language.
You did great! You have learned the basics of writing a `DAO` contract in Solidity programming language.

In the next lesson, we'll compile and deploy this `DAO` contract and see what we get!
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ async function main() {
const GeneralDAOVotingFactory = await ethers.getContractFactory("GeneralDAOVoting");
const VotingContract = GeneralDAOVotingFactory.attach(VOTING_CONTRACT_ADDRESS);

// Merkle Root; Chnage the address accordingly, make sure there are at least two
// Merkle Root; Change the address accordingly, make sure there are at least two
let addresses = [
{
addr: "0xABe215Fb79fB827978C82379d5974831E2FB5E0d",
Expand Down Expand Up @@ -78,4 +78,4 @@ async function main() {
console.log("Proposal Created");
}

main();
main();