<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Jakub Grzeszczyk</title>
    <description>The latest articles on DEV Community by Jakub Grzeszczyk (@dappscout).</description>
    <link>https://dev.to/dappscout</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2778820%2F4d398a25-b36e-4e4f-ba70-866b6b64cc5b.png</url>
      <title>DEV Community: Jakub Grzeszczyk</title>
      <link>https://dev.to/dappscout</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/dappscout"/>
    <language>en</language>
    <item>
      <title>How I Did a Shadow Audit (Start to Finish)</title>
      <dc:creator>Jakub Grzeszczyk</dc:creator>
      <pubDate>Sun, 27 Apr 2025 16:23:54 +0000</pubDate>
      <link>https://dev.to/dappscout/how-i-did-a-shadow-audit-start-to-finish-442i</link>
      <guid>https://dev.to/dappscout/how-i-did-a-shadow-audit-start-to-finish-442i</guid>
      <description>&lt;h2&gt;
  
  
  What is a shadow audit?
&lt;/h2&gt;

&lt;p&gt;One of my goals is to understand as many vulnerabilities as possible.&lt;br&gt;&lt;br&gt;
To do that, we can do many things like reading reports, watching courses, participating in contests, and reading articles.&lt;/p&gt;

&lt;p&gt;One great method is picking already finished contests, getting familiar with the codebase, finding some issues, and analyzing the report to understand the issues you missed.&lt;br&gt;&lt;br&gt;
It's a good practical way of studying not only vulnerabilities, but also you will be better at analyzing the code, learning Solidity, DeFi, and many other skills that a smart contract auditor needs to be good at.&lt;/p&gt;




&lt;h2&gt;
  
  
  How to do a shadow audit?
&lt;/h2&gt;

&lt;p&gt;To get the most out of it, I tried to imitate some aspects of real contests.&lt;br&gt;&lt;br&gt;
This plan was heavily inspired by suggestions I received from &lt;strong&gt;Bloqarl&lt;/strong&gt; on how to approach shadow auditing.&lt;/p&gt;

&lt;h3&gt;
  
  
  Preparation
&lt;/h3&gt;

&lt;p&gt;First, book yourself a ~week — this should help with training yourself to work under pressure and stick to deadlines.&lt;br&gt;&lt;br&gt;
Choose a protocol that will be in the topic you want to learn — in my case, it was &lt;strong&gt;BeedleFi&lt;/strong&gt;, because of the staking module.&lt;br&gt;&lt;br&gt;
After some trouble with finding the right versions of the libs, I went to the next step.&lt;/p&gt;




&lt;h3&gt;
  
  
  Get familiar with the codebase
&lt;/h3&gt;

&lt;p&gt;After preparations, I started to analyze the code line by line, which was a really slow process, because each line was at least one side quest to research — but man, it was a really great opportunity to learn Solidity.&lt;/p&gt;

&lt;p&gt;To understand why the code was written this way, I used &lt;strong&gt;Claude in my IDE&lt;/strong&gt; to explain things.&lt;br&gt;&lt;br&gt;
Also, one good thing I did was to create &lt;strong&gt;mermaid graphs&lt;/strong&gt; of flows in that protocol.&lt;/p&gt;

&lt;p&gt;Try to understand the protocol to the point where you know why the dev wanted to write a particular part of the code in that way.&lt;br&gt;&lt;br&gt;
Here, knowledge about DeFi and protocol docs would be great to have.&lt;br&gt;&lt;br&gt;
I didn't do good research before, so I was learning how some things like integration with Uniswap work on the go.&lt;br&gt;&lt;br&gt;
Next time, I will prepare myself better before diving into the codebase.&lt;/p&gt;

&lt;p&gt;While getting familiar with a codebase, try to find flaws in logic.&lt;br&gt;&lt;br&gt;
I found &lt;strong&gt;reentrancy vulnerability possibilities&lt;/strong&gt;, a &lt;strong&gt;lack of appropriate checks&lt;/strong&gt; that were actually the cause of a couple of &lt;strong&gt;high and medium findings&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;One of the things that I need to do next time is to go through the code with a checklist of common vulnerabilities — like &lt;a href="https://solodit.xyz/" rel="noopener noreferrer"&gt;this one from Solodit&lt;/a&gt;.&lt;/p&gt;




&lt;h3&gt;
  
  
  Time for the report
&lt;/h3&gt;

&lt;p&gt;When you have a total understanding of the protocol, it's time to go into the report.&lt;br&gt;&lt;br&gt;
Go through each issue deeply, trace every bug in the codebase, and reflect on how the auditor found it and why you missed it.&lt;/p&gt;

&lt;p&gt;On every issue, I made a little explanation on my own to see if I understood it.&lt;/p&gt;




&lt;h2&gt;
  
  
  What are the pros of shadow auditing?
&lt;/h2&gt;

&lt;p&gt;When you audit in a live contest, you submit your findings and then wait at least a couple of days to see all findings.&lt;br&gt;&lt;br&gt;
So when you have a chance to analyze these things, you are already a couple of days out of that codebase — so not every mid and high will be easy to understand.&lt;br&gt;&lt;br&gt;
You need to sit and try to remind yourself of the codebase, from the protocol, which doubles the work.&lt;/p&gt;

&lt;p&gt;While performing a shadow audit, going through all reports is one of the next things you do after getting familiar with the protocol.&lt;br&gt;&lt;br&gt;
You see what I mean — there is no gap between these steps,&lt;br&gt;&lt;br&gt;
so your understanding of these issues can be a lot better and sharper.&lt;/p&gt;

&lt;p&gt;Maybe you will even find something on your own? Definitely try it!&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Doing shadow audits is way better than just reading reports,&lt;br&gt;&lt;br&gt;
because it's a whole process that includes going through reports,&lt;br&gt;&lt;br&gt;
but it's just a small part of it.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  And cons…
&lt;/h2&gt;

&lt;p&gt;One serious problem when I was shadow auditing was not having a real deadline and incentives.&lt;br&gt;&lt;br&gt;
Because of that, it can get a little bit tricky to stay motivated.&lt;br&gt;&lt;br&gt;
After a couple of days, I already started thinking about participating in a real contest or building the next project, which was distracting.&lt;/p&gt;

&lt;p&gt;I think that one way to help myself create some pressure on myself is to &lt;strong&gt;learn in public&lt;/strong&gt;, so write what you're gonna audit, and what the deadline will be.&lt;/p&gt;




&lt;h2&gt;
  
  
  Was the shadow audit worth my time?
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Yes, absolutely.&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
I learned so much during the process.&lt;/p&gt;

&lt;p&gt;I discovered what my flaws are in the code analysis process, how to perform better, and how to organize and understand the code.&lt;br&gt;&lt;br&gt;
Also, seeing the codebase of real big protocols is advancing my understanding of &lt;strong&gt;Solidity&lt;/strong&gt; and &lt;strong&gt;DeFi architecture&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;I already have ideas for improving my process, so I can't wait to start the next one.&lt;/p&gt;




&lt;blockquote&gt;
&lt;p&gt;This reflects my current thinking as someone still early in the journey 😄&lt;br&gt;&lt;br&gt;
If you have thoughts, feedback, or things you disagree with, I'd really appreciate hearing them.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;So, if you found this helpful, make sure to follow me here on &lt;strong&gt;Dev.to&lt;/strong&gt; and follow.&lt;br&gt;&lt;br&gt;
I also share everything I learn in real-time on &lt;strong&gt;X&lt;/strong&gt; — come say hi! 👋&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Thanks for reading!&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
— &lt;em&gt;DappScout&lt;/em&gt;&lt;/p&gt;

</description>
      <category>web3</category>
      <category>solidity</category>
      <category>blockchain</category>
    </item>
  </channel>
</rss>
