From d34dae04d213ed520fa21af333fbca7280c49b03 Mon Sep 17 00:00:00 2001 From: emizzle Date: Sun, 5 Aug 2018 17:51:26 +1000 Subject: [PATCH] DTwitter contract update Also update the DTwitter contract to correctly include a require statement ensuring only existing users can tweet. --- contracts/DTwitter.sol | 2 ++ 1 file changed, 2 insertions(+) diff --git a/contracts/DTwitter.sol b/contracts/DTwitter.sol index 1c10066..faa52e2 100644 --- a/contracts/DTwitter.sol +++ b/contracts/DTwitter.sol @@ -121,6 +121,8 @@ contract DTwitter { * {string} content - the tweet content */ function tweet(string content) public { + // ensure the sender has an account + require(owners[msg.sender].length > 0); // get the username hash of the sender's account bytes32 usernameHash = owners[msg.sender];