---
title: "Discussion on \"Write Your First DAPP in 10mins\" | Hashnode"
description: "Discussion on \"Write Your First DAPP in 10mins\". Part 1 of 3. This guide gets you started with Solidity and partly React"
url: "https://hashnode.com/posts/write-your-first-dapp-in-10mins/6189dbc6ce9e5f6dfd785c23"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Write Your First DAPP in 10mins](https://scribbletons.hashnode.dev/write-your-first-dapp-in-10mins?utm_source=hashnode&utm_medium=feed)

Part 1 of 3. This guide gets you started with Solidity and partly React

Oct 26, 2021 · 11 min read · scribbletons.hashnode.dev  
Updated Nov 27, 2021  
Read the article

-   [#solidity](https://hashnode.com/tag/solidity)
-   [#blockchain](https://hashnode.com/tag/blockchain)
-   [#testing](https://hashnode.com/tag/testing)
-   [#javascript](https://hashnode.com/tag/javascript)
-   [#beginners](https://hashnode.com/tag/beginners)

## Written by

[Emmanuel Ugwuoke](https://hashnode.com/@ScribbleTons)

@ScribbleTons · Lagos, Nigeria

  
[View profile](https://hashnode.com/@ScribbleTons)

Full stack developer and Blockchain enthusiast

I am a self-taught developer from Nigeria and have three years experience in software engineering space. With two years working with Vue and React on frontend application projects. I want to get actively involved in web3 projects and I'm open to opportunities in web3 space.

## Responses 2

Markdown supported · ⌘↵ to post

[vrunishkajo](https://hashnode.com/@vrunishkajo)

[Nov 27, 2021](https://hashnode.com/posts/write-your-first-dapp-in-10mins/6189dbc6ce9e5f6dfd785c23/comment/61a2c3d1d51d1f4e7e1c68c4)

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);
  }
```

[Emmanuel Ugwuoke](https://hashnode.com/@ScribbleTons)

[Nov 28, 2021](https://hashnode.com/posts/write-your-first-dapp-in-10mins/6189dbc6ce9e5f6dfd785c23/comment/61a2c3d1d51d1f4e7e1c68c4#reply-61a343f5d51d1f4e7e1c6d13)

I am grateful for you corrections so far. I like the refactored tipPost method, it is clean and direct. My next post on web3 project will sure be better with your corrections. Thanks man.

[vrunishkajo](https://hashnode.com/@vrunishkajo)

[Nov 26, 2021](https://hashnode.com/posts/write-your-first-dapp-in-10mins/6189dbc6ce9e5f6dfd785c23/comment/61a16e4cf0cb2e37690c5a1a)

Hello, thx.

```
        posts[postCount] = Post(postCount, kids, _content,0, msg.sender);
```

remove `kids` =)

[Emmanuel Ugwuoke](https://hashnode.com/@ScribbleTons)

[Nov 27, 2021](https://hashnode.com/posts/write-your-first-dapp-in-10mins/6189dbc6ce9e5f6dfd785c23/comment/61a16e4cf0cb2e37690c5a1a#reply-61a1e3f1a707ae38156d5a1e)

Oh o, yes I will now. Thank you.
