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
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 |
-
💫 [Pass]: Tim deployed
TokenizedBallot.sol
smart contract on Sepolia testnetnpx ts-node --files scripts/DeployMyToken.ts
- TokenizedBallot.sol contract deployed on Sepolia testnet
- Script ↗
-
💫 [Pass]: Tim granted minter role to Zach
npx ts-node --files scripts/GrantMinterRole.ts 0x3c9d658a9b358cf1985bc52c5476229e8b186f1f 0x8f4db4f817bb198895320d03a0629a69e6be13b8
- TxHash (0xd5a...2ba)
- Script ↗
-
💫 [Pass]: Tim granted minter role to Graver
npx ts-node --files scripts/GrantMinterRole.ts 0x3c9d658a9b358cf1985bc52c5476229e8b186f1f 0x8152ae0be775ee8c530b5b13f229d75adc9291b0
- TxHash (0x424...194)
- Script ↗
-
💫 [Pass]: Zach minted 100n to himself
npx ts-node --files scripts/MintTokens.ts 0x3c9d658a9b358cf1985bc52c5476229e8b186f1f 0x8f4db4f817bb198895320d03a0629a69e6be13b8 1000
- TxHash (0x05d...a6f)
- Script ↗
-
💫 [Pass]: Tim minted 1000n to Carl
npx ts-node --files scripts/MintTokens.ts 0x3c9d658a9b358cf1985bc52c5476229e8b186f1f 0x822d80ecd89b2aae0c52590c7f1351351e720eaa 1000
- TxHash (0x0f0...d9b)
- Script ↗
-
💫 [Pass]: Tim minted 1000n to Bryan
npx ts-node --files scripts/MintTokens.ts 0x3c9d658a9b358cf1985bc52c5476229e8b186f1f 0x55631f259de138bcaccfd54d17c6597c58241be4 1000
- TxHash (0xc31...d47)
- Script ↗
-
💫 [Pass]: Carl delegated his votes to himself
npx ts-node --files scripts/DelegateVotes.ts 0x3c9d658a9b358cf1985bc52c5476229e8b186f1f 0x822D80eCd89b2aae0c52590c7f1351351E720EAa
- TxHash (0x403...d44)
- Script ↗
-
💫 [Pass]: Tim minted 1000n to Chris Adams
npx ts-node --files scripts/MintTokens.ts 0x3c9d658a9b358cf1985bc52c5476229e8b186f1f 0x117556e746eED7053dD99dEb9fae019CbaC2013E 1000
- TxHash (0xe39...04d)
- Script ↗
-
💫 [Pass]: Zach minted 900n to himself
npx ts-node --files scripts/MintTokens.ts 0x3c9d658a9b358cf1985bc52c5476229e8b186f1f 0x8f4db4F817BB198895320d03A0629a69e6bE13B8 900
- TxHash (0xdb...5df)
- Script ↗
-
💫 [Pass]: Tim minted 1000n to another account of his own
npx ts-node --files scripts/MintTokens.ts 0x3c9d658a9b358cf1985bc52c5476229e8b186f1f 0x99940BeaCB5FC1d87b7Df18736559c66A0f98b23 1000
- TxHash (0x7fa...648)
- Script ↗
-
💫 [Pass]: Zach delegated his votes to himself
npx ts-node --files scripts/DelegateVotes.ts 0x3c9d658a9b358cf1985bc52c5476229e8b186f1f 0x8f4db4F817BB198895320d03A0629a69e6bE13B8
- TxHash (0xa45...8c0)
- Script ↗
-
💫 [Pass]: Tim delegated his second account's votes to his first account
npx ts-node --files scripts/DelegateVotes.ts 0x3c9d658a9b358cf1985bc52c5476229e8b186f1f 0x8071527946235eF9Ca115bd409C8487496BEbF9B
- TxHash (0x9cc...425)
- Script ↗
-
💫 [Pass]: Graver minted 1000n to himself
npx ts-node --files scripts/MintTokens.ts 0x3c9d658a9b358cf1985bc52c5476229e8b186f1f 0x8152ae0BE775eE8C530b5b13f229D75ADc9291b0 1000
- TxHash (0x556...3b5)
- Script ↗
-
💫 [Pass]: Graver delegated his votes to himself
npx ts-node --files scripts/DelegateVotes.ts 0x3c9d658a9b358cf1985bc52c5476229e8b186f1f 0x8152ae0BE775eE8C530b5b13f229D75ADc9291b0
- TxHash (0x8f6...990)
- Script ↗
-
💫 [Pass]: Bryan delegated his votes to himself
npx ts-node --files scripts/DelegateVotes.ts 0x3c9d658a9b358cf1985bc52c5476229e8b186f1f 0x55631F259DE138bCaccfd54D17C6597C58241bE4
- TxHash (0x312...195)
- Script ↗
-
💫 [Pass]: Carl deployed a tokenized ballot. Later on we discovered this contract was old and was missing some error checks.
npx ts-node --files ./scripts/DeployTokenizedBallot.ts 0x3C9d658a9B358cf1985bc52C5476229E8b186F1f 6564572 Apple Pear Orange Strawberry
- TxHash (0xe69...cca)
- Script ↗
- 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
- 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
- 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