Tweeter DAPPS - skanakakorn/eth-nonode GitHub Wiki
Here we are going to implement tweeter using Ethereum contract. Tweeter Contract The file is named tweet_storage.sol.
Exercise
- Tweet at least 3 messages
- Read the latest tweet
- Read tweet id 0
- Read tweet id 1
Now we want to associate sender's address with some name. Therefore we need name registration system. Please take a look at name registry contract name_registry.sol.
Exercise
- Register at least 3 names.
- Try to unregister 2 names. How do you execute contract? (Hint) Who is the sender of the transaction?
- Use adminUnregister to unregister someone. Execute contract as admin and not admin.
With name registration we need new contract tweet_storage2.sol
Exercise with tweet_storage2
- Tweet some messages from accounts registered with the name registry.
- Read tweet index 1. Show the message.
- Show the owner of the message.
Programming exercise
- Modify TweetStorage.sol to allow admin to be different from contract creator.
- Modify TweetStorage.sol to allow admin to ban only one address from tweeting.
- Inspect your code to make sure only admin would have privileges to ban or change admin.
- Modify TweetStorage.sol to allow admin to ban certain address from using the contract. Hint: Use mapping(address => bool) _ban_address