Skip to content

Latest commit

 

History

History
148 lines (115 loc) · 8.94 KB

REPORT.md

File metadata and controls

148 lines (115 loc) · 8.94 KB

Weekend Project 3

Project instructions

This is a group activity for at least 3 students:

  • Develop and run scripts for “TokenizedBallot.sol” within your group to give voting tokens, delegating voting power, casting votes, checking vote power and querying results
  • Write a report with each function execution and the transaction hash, if successful, or the revert reason, if failed
  • Submit your weekend project by filling the form provided in Discord
  • Submit your code in a github repository in the form

Group 2

Unique id Discord username Name Wallet address
RAAzLF @GRAVER 👾 Mike Mendoza 0x8152ae0BE775eE8C530b5b13f229D75ADc9291b0
2SyBp0 @wackozacco Zach 0x8f4db4F817BB198895320d03A0629a69e6bE13B8
10exgX @δαλλασκατ Chris Adams 0x117556e746eED7053dD99dEb9fae019CbaC2013E
r5YSqY @imchrismayfield Chris Mayfield
HhHAQw @swooz Bryan Suarez 0x55631F259DE138bCaccfd54D17C6597C58241bE4
Pok9XD @Timster Tim Liner 0x61dd404c7afdeec54ac246c1e1d92b23d1b9f594 0x99940beacb5fc1d87b7df18736559c66a0f98b23
T5zGzt @Carl Youngblood Carl Youngblood 0x822d80ecd89b2aae0c52590c7f1351351e720eaa

List of interactions

  1. 💫 [Pass]: Tim deployed TokenizedBallot.sol smart contract on Sepolia testnet

    1. npx ts-node --files scripts/DeployMyToken.ts
    2. TokenizedBallot.sol contract deployed on Sepolia testnet
    3. Script ↗
  2. 💫 [Pass]: Tim granted minter role to Zach

    1. npx ts-node --files scripts/GrantMinterRole.ts 0x3c9d658a9b358cf1985bc52c5476229e8b186f1f 0x8f4db4f817bb198895320d03a0629a69e6be13b8
    2. TxHash (0xd5a...2ba)
    3. Script ↗
  3. 💫 [Pass]: Tim granted minter role to Graver

    1. npx ts-node --files scripts/GrantMinterRole.ts 0x3c9d658a9b358cf1985bc52c5476229e8b186f1f 0x8152ae0be775ee8c530b5b13f229d75adc9291b0
    2. TxHash (0x424...194)
    3. Script ↗
  4. 💫 [Pass]: Zach minted 100n to himself

    1. npx ts-node --files scripts/MintTokens.ts 0x3c9d658a9b358cf1985bc52c5476229e8b186f1f 0x8f4db4f817bb198895320d03a0629a69e6be13b8 1000
    2. TxHash (0x05d...a6f)
    3. Script ↗
  5. 💫 [Pass]: Tim minted 1000n to Carl

    1. npx ts-node --files scripts/MintTokens.ts 0x3c9d658a9b358cf1985bc52c5476229e8b186f1f 0x822d80ecd89b2aae0c52590c7f1351351e720eaa 1000
    2. TxHash (0x0f0...d9b)
    3. Script ↗
  6. 💫 [Pass]: Tim minted 1000n to Bryan

    1. npx ts-node --files scripts/MintTokens.ts 0x3c9d658a9b358cf1985bc52c5476229e8b186f1f 0x55631f259de138bcaccfd54d17c6597c58241be4 1000
    2. TxHash (0xc31...d47)
    3. Script ↗
  7. 💫 [Pass]: Carl delegated his votes to himself

    1. npx ts-node --files scripts/DelegateVotes.ts 0x3c9d658a9b358cf1985bc52c5476229e8b186f1f 0x822D80eCd89b2aae0c52590c7f1351351E720EAa
    2. TxHash (0x403...d44)
    3. Script ↗
  8. 💫 [Pass]: Tim minted 1000n to Chris Adams

    1. npx ts-node --files scripts/MintTokens.ts 0x3c9d658a9b358cf1985bc52c5476229e8b186f1f 0x117556e746eED7053dD99dEb9fae019CbaC2013E 1000
    2. TxHash (0xe39...04d)
    3. Script ↗
  9. 💫 [Pass]: Zach minted 900n to himself

    1. npx ts-node --files scripts/MintTokens.ts 0x3c9d658a9b358cf1985bc52c5476229e8b186f1f 0x8f4db4F817BB198895320d03A0629a69e6bE13B8 900
    2. TxHash (0xdb...5df)
    3. Script ↗
  10. 💫 [Pass]: Tim minted 1000n to another account of his own

    1. npx ts-node --files scripts/MintTokens.ts 0x3c9d658a9b358cf1985bc52c5476229e8b186f1f 0x99940BeaCB5FC1d87b7Df18736559c66A0f98b23 1000
    2. TxHash (0x7fa...648)
    3. Script ↗
  11. 💫 [Pass]: Zach delegated his votes to himself

    1. npx ts-node --files scripts/DelegateVotes.ts 0x3c9d658a9b358cf1985bc52c5476229e8b186f1f 0x8f4db4F817BB198895320d03A0629a69e6bE13B8
    2. TxHash (0xa45...8c0)
    3. Script ↗
  12. 💫 [Pass]: Tim delegated his second account's votes to his first account

    1. npx ts-node --files scripts/DelegateVotes.ts 0x3c9d658a9b358cf1985bc52c5476229e8b186f1f 0x8071527946235eF9Ca115bd409C8487496BEbF9B
    2. TxHash (0x9cc...425)
    3. Script ↗
  13. 💫 [Pass]: Graver minted 1000n to himself

    1. npx ts-node --files scripts/MintTokens.ts 0x3c9d658a9b358cf1985bc52c5476229e8b186f1f 0x8152ae0BE775eE8C530b5b13f229D75ADc9291b0 1000
    2. TxHash (0x556...3b5)
    3. Script ↗
  14. 💫 [Pass]: Graver delegated his votes to himself

    1. npx ts-node --files scripts/DelegateVotes.ts 0x3c9d658a9b358cf1985bc52c5476229e8b186f1f 0x8152ae0BE775eE8C530b5b13f229D75ADc9291b0
    2. TxHash (0x8f6...990)
    3. Script ↗
  15. 💫 [Pass]: Bryan delegated his votes to himself

    1. npx ts-node --files scripts/DelegateVotes.ts 0x3c9d658a9b358cf1985bc52c5476229e8b186f1f 0x55631F259DE138bCaccfd54D17C6597C58241bE4
    2. TxHash (0x312...195)
    3. Script ↗
  16. 💫 [Pass]: Carl deployed a tokenized ballot. Later on we discovered this contract was old and was missing some error checks.

    1. npx ts-node --files ./scripts/DeployTokenizedBallot.ts 0x3C9d658a9B358cf1985bc52C5476229E8b186F1f 6564572 Apple Pear Orange Strawberry
    2. TxHash (0xe69...cca)
    3. Script ↗
    4. Output:
Deploying ballot with proposals: Apple,Pear,Orange,Strawberry
Confirm? (Y/n)
Y
Last block number: 6564583n
Deployer address: 0x822D80eCd89b2aae0c52590c7f1351351E720EAa
Deployer balance: 0.029488483783847335 ETH

Deploying Ballot contract
Transaction hash: 0xe69b9c158a24cfa860c71843ba1b1671c083bc14abb604d19ef73faec8904cca
Waiting for confirmations...
Ballot contract deployed to: 0xb79fbbc37d131667de31ad68501e02a5bb897286
  1. Several votes were cast on the contract that Carl deployed. We soon discovered that there was a bug in the contract that did not prevent voters from casting more votes than their allotted number. We guessed that this happened because Carl hadn't recompiled the contracts after doing a git pull to bring in updates to the code. The final results of the vote looked like this:
∴ npx ts-node --files ./scripts/ViewProposalStatus.ts 0xb79fbbc37d131667de31ad68501e02a5bb897286


4 proposals found:
{ index: 0, name: 'Apple', votes: 13500n }
{ index: 1, name: 'Pear', votes: 10000000000000004700n }
{ index: 2, name: 'Orange', votes: 800n }
{ index: 3, name: 'Strawberry', votes: 301300n }

Winner: Pear
  1. Bryan then deployed a new contract with the fixes preventing invalid votes. Several new votes were cast. The final proposal status was as follows:
$ npx ts-node --files scripts/ViewProposalStatus.ts 0x877d2806e0421233d3a0553c3aaab7d88f3616af


4 proposals found:
{ index: 0, name: 'pizza, votes: 0n }
{ index: 1, name: 'tacos', votes: 1100n }
{ index: 2, name: 'donuts', votes: 600n }
{ index: 3, name: 'wings', votes: 2200n }

Winner: wings