---
title: "vrunishkajo (@vrunishkajo) | Hashnode"
description: "vrunishkajo (@vrunishkajo) writes on Hashnode. Read their latest articles and follow their work."
url: "https://hashnode.com/@vrunishkajo"
---

@vrunishkajo

# vrunishkajo

@vrunishkajo · Joined November 2021

## Comments

[Let me be a bore a little more ;) solidity ^0.8.10 posts\[postCount\] = Post(postCount, \_content, 0, msg.sender); to posts\[postCount\] = Post(postCount, \_content, 0, payable(msg.sender)); emit PostCreated(postCount, \_content, 0, msg.sender); to emit PostCreated(postCount, \_content, 0, payable(msg.sender)); address(\_author).transfer(msg.value); to \_author.transfer(msg.value); Possible reentrancy vulnerabilities. Avoid state changes after transfer. I think you can do this: function tipPost(uint \_id) public payable { //Ensure the id is not invalid require(\_id > 0 && \_id <= postCount, "Valid id required"); //fetch post Post memory \_post = posts\[\_id\]; address payable \_author = \_post.author; //fetch the author address(\_author).transfer(msg.value); //transfer Ether to the author //We increment the tip amount \_post.tipAmount += msg.value; posts\[\_id\] = \_post; // let's trigger a post tipped event emit PostTipped(\_id, \_post.content, \_post.tipAmount, \_author ); } to function tipPost(uint256 \_id) public payable { require(\_id > 0 && \_id <= postCount, "Valid id required"); posts\[\_id\].tipAmount += msg.value; posts\[\_id\].author.transfer(msg.value); emit PostTipped(\_id, posts\[\_id\].content, posts\[\_id\].tipAmount, posts\[\_id\].author); }](https://hashnode.com/posts/write-your-first-dapp-in-10mins/6189dbc6ce9e5f6dfd785c23/comment/61a2c3d1d51d1f4e7e1c68c4)

Comment · Article · Nov 27, 2021 · [Write Your First DAPP in 10mins](https://hashnode.com/posts/write-your-first-dapp-in-10mins/6189dbc6ce9e5f6dfd785c23)

[Hello, thx. posts\[postCount\] = Post(postCount, kids, \_content,0, msg.sender); remove kids =)](https://hashnode.com/posts/write-your-first-dapp-in-10mins/6189dbc6ce9e5f6dfd785c23/comment/61a16e4cf0cb2e37690c5a1a)

Comment · Article · Nov 26, 2021 · [Write Your First DAPP in 10mins](https://hashnode.com/posts/write-your-first-dapp-in-10mins/6189dbc6ce9e5f6dfd785c23)

[Thx, nice modules.](https://hashnode.com/posts/top-10-vscode-extensions-for-react/619f2ba65993b91bb7d1f4ce/comment/619faaed9829fb749bcbec1d)

Comment · Article · Nov 25, 2021 · [Top 10 VSCode Extensions for React](https://hashnode.com/posts/top-10-vscode-extensions-for-react/619f2ba65993b91bb7d1f4ce)
