<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>0xSimao</title>
    <description>Expert Security Researcher – 28 Top-3 Finishes &amp; 60+ Private Audits.</description>
    <link>https://www.0xsimao.com/</link>
    <atom:link href="https://www.0xsimao.com/blog/feed.xml" rel="self" type="application/rss+xml"/>
    <item>
      <title>Bug Deep Dive #33</title>
      <pubDate>Sun, 18 Jan 2026 12:36:28 -0800</pubDate>
      <link>https://www.0xsimao.com/blog/bug-deep-dive-33</link>
      <guid>https://www.0xsimao.com/blog/bug-deep-dive-33</guid>
      <description>&lt;p class=" s-text-color-default style="&gt;&lt;span class="s-text-color-default"&gt;Jackpot enforces pool cap as the following:&lt;/span&gt;&lt;/p&gt;&lt;p class=" s-text-color-default" style="text-align: start; font-size: 17.008px;"&gt;&lt;span class="s-text-color-default"&gt;This is to ensure the following:&lt;/span&gt;&lt;/p&gt;&lt;ul&gt;&lt;li class=" s-text-color-default" style="font-size: 17.008px;"&gt;&lt;span class="s-text-color-default"&gt;bonusBallMax + normalBallMax &lt;= MAX_BIT_VECTOR_SIZE&lt;/span&gt;&lt;/li&gt;&lt;li class=" s-text-color-default" style="font-size: 17.008px;"&gt;&lt;span class="s-text-color-default"&gt;Pool cap does not exceed governance pool cap&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p class=" s-text-color-default" style="font-size: 17.008px;"&gt;&lt;span class="s-text-color-default"&gt;Otherwise, TicketComboTracker cannot properly store purchased Ticket on max bonus ball, since the following will revert with overflow:&lt;/span&gt;&lt;/p&gt;&lt;p class=" s-text-color-default" style="text-align: start; font-size: 17.008px;"&gt;&lt;span class="s-text-color-default"&gt;However, LP pool cap can be exceeded on drawing settlement, because new LP value calculation does not enforce the same pool cap logic:&lt;/span&gt;&lt;/p&gt;&lt;p class=" s-text-color-default" style="text-align: start; font-size: 17.008px;"&gt;&lt;span class="s-text-color-default"&gt;Since LP value can grow by up to &lt;/span&gt;&lt;span class="s-text-color-default"&gt;lpEdgeTarget = 30%&lt;/span&gt;&lt;span class="s-text-color-default"&gt; on every draw without any jackpot winner, governance cap or calculated limit can be exceeded, if previous total pool was just below the surface.&lt;/span&gt;&lt;/p&gt;&lt;p class=" s-text-color-default" style="text-align: start; font-size: 17.008px;"&gt;&lt;span class="s-text-color-default"&gt;&lt;strong&gt;Impact&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=" s-text-color-default" style="text-align: start; font-size: 17.008px;"&gt;&lt;span class="s-text-color-default"&gt;Important invariants can be broken on settlement drawing:&lt;/span&gt;&lt;/p&gt;&lt;ul&gt;&lt;li class=" s-text-color-default" style="text-align: start; font-size: 17.008px;"&gt;&lt;span class="s-text-color-default"&gt;&lt;strong&gt;Pool Cap...&lt;a href=https://www.0xsimao.com/blog/bug-deep-dive-33&gt;Read More&lt;/a&gt;</description>
    </item>
    <item>
      <title>Mentorship Series #26</title>
      <pubDate>Thu, 15 Jan 2026 18:37:56 -0800</pubDate>
      <link>https://www.0xsimao.com/blog/mentorship-series-26</link>
      <guid>https://www.0xsimao.com/blog/mentorship-series-26</guid>
      <description>&lt;p style="font-size: 100%;"&gt;We finished the Panoptic &lt;a href="https://code4rena.com/audits/2025-12-panoptic-next-core" data-type="undefined" target="_blank"&gt;contest&lt;/a&gt; on Code4rena.&lt;/p&gt;&lt;p style="font-size: 100%;"&gt;&lt;span style="color: #444444;"&gt;&lt;strong&gt;Lesson Summary:&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;ul&gt;&lt;li style="font-size: 100%;"&gt;&lt;span class="s-text-color-default"&gt;Verify pool ID packing/unpacking end-to-end&lt;/span&gt;&lt;span class="s-text-color-default"&gt; — Confirm truncation (e.g., last 40 bits of Uniswap pool address), void bits (8-bit field), tick spacing (48-bit), and shift amounts (e.g., &gt;&gt;112, &gt;&gt;240) match exactly between encode (constructor/init) and decode (getters) to avoid silent truncation or ID collisions.&lt;/span&gt;&lt;/li&gt;&lt;li style="font-size: 100%;"&gt;&lt;span class="s-text-color-default"&gt;Test collision handling in while loops rigorously&lt;/span&gt;&lt;span class="s-text-color-default"&gt; — When incrementing pool patterns (+1 on lower bits) to avoid address clashes, fuzz edge cases (all-1s in 40-bit field, overflow into void/tick spacing bits) — confirm cast-back-to-uint40 correctly wraps without corrupting higher fields.&lt;/span&gt;&lt;/li&gt;&lt;li style="font-size: 100%;"&gt;&lt;span class="s-text-color-default"&gt;Check initialization guards are tamper-proof&lt;/span&gt;&lt;span class="s-text-color-default"&gt; — Ensure &lt;/span&gt;&lt;span class="s-text-color-default"&gt;isInitialized&lt;/span&gt;&lt;span class="s-text-color-default"&gt; bit (often left-shifted high, e.g., &lt;&lt;240) can’t be faked via direct storage writes or re-initialization attacks; verify it’s only set once during legitimate pool creation and unpacked correctly (e.g., &gt;&gt;240 &gt; 0).&lt;/span&gt;&lt;/li&gt;&lt;li style="font-size: 100%;"&gt;&lt;span class="s-text-color-default"&gt;Evaluate permissionless tick expansion impact&lt;/span&gt;&lt;span class="s-text-color-default"&gt; — For functions like &lt;/span&gt;&lt;span class="s-text-color-default"&gt;expand&lt;/span&gt;&lt;span class="s-text-color-default"&gt; that any user can call, assess griefing vectors: flash-loan → massive deposit → expand ticks → withdraw → revert ranges;...&lt;a href=https://www.0xsimao.com/blog/mentorship-series-26&gt;Read More&lt;/a&gt;</description>
    </item>
    <item>
      <title>Mentorship Series #25</title>
      <pubDate>Thu, 15 Jan 2026 18:37:54 -0800</pubDate>
      <link>https://www.0xsimao.com/blog/mentorship-series-25</link>
      <guid>https://www.0xsimao.com/blog/mentorship-series-25</guid>
      <description>&lt;p style="font-size: 100%;"&gt;We continued the Panoptic &lt;a href="https://code4rena.com/audits/2025-12-panoptic-next-core" data-type="undefined" target="_blank"&gt;contest&lt;/a&gt; on Code4rena.&lt;/p&gt;&lt;p style="font-size: 100%;"&gt;&lt;span style="color: #444444;"&gt;&lt;strong&gt;Lesson Summary:&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;ul&gt;&lt;li style="font-size: 100%;"&gt;Simulate full sequences (accrue → deposit/withdraw → accrue again) to catch borrow index desync or double-burning shares.&lt;/li&gt;&lt;li style="font-size: 100%;"&gt;Verify borrow index always updates proportionally on partial burns — stale index after exact-balance interest payment can wipe users out.&lt;/li&gt;&lt;li style="font-size: 100%;"&gt;Cross-check time handling: epoch (4s steps) vs raw block.timestamp mismatches → 0 delta in one contract while the other accrues → state drift.&lt;/li&gt;&lt;li style="font-size: 100%;"&gt;Test same-block loops on accrueInterest(): non-incrementing epoch + positive elapsed time can repeatedly inflate borrow rate toward max.Flag asymmetric rate math (faster increases than decreases, uncapped linear adaptation) — suspicious unless docs explicitly justify volatility or one-sided speed.&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;span style="display: inline-block"&gt;&lt;/span&gt;&lt;/p&gt;&lt;a href=https://www.0xsimao.com/blog/mentorship-series-25&gt;Read More&lt;/a&gt;</description>
    </item>
    <item>
      <title>Mentorship Series #24</title>
      <pubDate>Thu, 15 Jan 2026 18:37:52 -0800</pubDate>
      <link>https://www.0xsimao.com/blog/mentorship-series-24</link>
      <guid>https://www.0xsimao.com/blog/mentorship-series-24</guid>
      <description>&lt;p style="font-size: 100%;"&gt;We continued the Panoptic &lt;a href="https://code4rena.com/audits/2025-12-panoptic-next-core" data-type="undefined" target="_blank"&gt;contest&lt;/a&gt; on Code4rena.&lt;/p&gt;&lt;p style="font-size: 100%;"&gt;&lt;span style="color: #444444;"&gt;&lt;strong&gt;Lesson Summary:&lt;/strong&gt;&lt;/span&gt;## Notes&lt;/p&gt;&lt;ul&gt;&lt;li class=" style="&gt;When the user doesn't have enough balance, his index is not updated. What happens if the user deposits more afterwards? &lt;/li&gt;&lt;li class=" style="&gt;100 USDC, user has only 50 balance. They burn this 50 balance, index is not updated. If he deposits 100 again, how much is he going to pay? Will he have to pay 50 shares of interest, because he paid 50 already, or will he have to pay 100 again, totalling 150?&lt;/li&gt;&lt;li class=" style="&gt;Is there a health check in the Pool?&lt;/li&gt;&lt;li class=" style="&gt;What if linearAdaptation is not zero but is very small?&lt;/li&gt;&lt;li class=" style="&gt;How big can linear adaptation get?&lt;/li&gt;&lt;li style="font-size: 100%;"&gt;If called every block, the linear adaptation should be small. What happens to the rate? Is there a maximum rate? max speed?&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;span style="display: inline-block"&gt;&lt;/span&gt;&lt;/p&gt;&lt;a href=https://www.0xsimao.com/blog/mentorship-series-24&gt;Read More&lt;/a&gt;</description>
    </item>
    <item>
      <title>Mentorship Series #23</title>
      <pubDate>Thu, 15 Jan 2026 18:37:50 -0800</pubDate>
      <link>https://www.0xsimao.com/blog/mentorship-series-23</link>
      <guid>https://www.0xsimao.com/blog/mentorship-series-23</guid>
      <description>&lt;p style="font-size: 100%;"&gt;We continued the Panoptic &lt;a href="https://code4rena.com/audits/2025-12-panoptic-next-core" data-type="undefined" target="_blank"&gt;contest&lt;/a&gt; on Code4rena.&lt;/p&gt;&lt;p style="font-size: 100%;"&gt;&lt;span style="color: #444444;"&gt;&lt;strong&gt;Lesson Summary:&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;ul&gt;&lt;li style="font-size: 100%;"&gt;There seems to be enough precision when the utilization(err) is small, because it only rounds down to 0 when err is super small&lt;/li&gt;&lt;li style="font-size: 100%;"&gt;trapezoidal rule in the borrowRate fn - check if it works with all values/conditions&lt;/li&gt;&lt;li style="font-size: 100%;"&gt;Check yearn exploit post-mortem&lt;/li&gt;&lt;li style="font-size: 100%;"&gt;What if all the rates are 0? See potential edge cases with this trapezoidal rule - can't happen because of line 1841 _borrowRate&lt;/li&gt;&lt;li style="font-size: 100%;"&gt;How are they handling elapsed == 0 in _borrowRate? - they handle precision pretty well&lt;/li&gt;&lt;li style="font-size: 100%;"&gt;What if I spam _borrowRate? - OK&lt;/li&gt;&lt;li style="font-size: 100%;"&gt;Call it often, don't call it often, not calling it one day, huge deposit, borrow a lot &lt;/li&gt;&lt;/ul&gt;&lt;a href=https://www.0xsimao.com/blog/mentorship-series-23&gt;Read More&lt;/a&gt;</description>
    </item>
    <item>
      <title>Mentorship Series #22</title>
      <pubDate>Thu, 15 Jan 2026 18:37:48 -0800</pubDate>
      <link>https://www.0xsimao.com/blog/mentorship-series-22</link>
      <guid>https://www.0xsimao.com/blog/mentorship-series-22</guid>
      <description>&lt;p style="font-size: 100%;"&gt;We continued the Panoptic &lt;a href="https://code4rena.com/audits/2025-12-panoptic-next-core" data-type="undefined" target="_blank"&gt;contest&lt;/a&gt; on Code4rena.&lt;/p&gt;&lt;p style="font-size: 100%;"&gt;&lt;span style="color: #444444;"&gt;&lt;strong&gt;Lesson Summary:&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;ul&gt;&lt;li style="font-size: 100%;"&gt;Downcasting cuts the number, watch closely for such casts&lt;/li&gt;&lt;li style="font-size: 100%;"&gt;ERC4626 and vaults check assets for zero amount, not shares&lt;/li&gt;&lt;li style="font-size: 100%;"&gt;Check the cast in the withdraw fn, can it cause a problem?  - ok&lt;/li&gt;&lt;li style="font-size: 100%;"&gt;Play with numbers with all the branches in the accrueInterest fn&lt;/li&gt;&lt;li style="font-size: 100%;"&gt;Can someone call a fn which accrues interest and screw another `owner` (trigger the !isDeposit) branch to make the other owner burn his shares?&lt;/li&gt;&lt;ul&gt;&lt;li style="font-size: 100%;"&gt;User has enough balance&lt;/li&gt;&lt;li style="font-size: 100%;"&gt;User has not enough balance and it's not a deposit &lt;/li&gt;&lt;li style="font-size: 100%;"&gt;User does not have enough balance but it's a deposittransfer ---&gt; deposit, basically search for ways for users to game the accrueing of interest somehow&lt;/li&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;p&gt;&lt;span style="display: inline-block"&gt;&lt;/span&gt;&lt;/p&gt;&lt;a href=https://www.0xsimao.com/blog/mentorship-series-22&gt;Read More&lt;/a&gt;</description>
    </item>
    <item>
      <title>Mentorship Series #21</title>
      <pubDate>Thu, 15 Jan 2026 18:37:45 -0800</pubDate>
      <link>https://www.0xsimao.com/blog/mentorship-series-21</link>
      <guid>https://www.0xsimao.com/blog/mentorship-series-21</guid>
      <description>&lt;p style="font-size: 100%;"&gt;We continued the Panoptic &lt;a href="https://code4rena.com/audits/2025-12-panoptic-next-core" data-type="undefined" target="_blank"&gt;contest&lt;/a&gt; on Code4rena.&lt;/p&gt;&lt;p style="font-size: 100%;"&gt;&lt;span style="color: #444444;"&gt;&lt;strong&gt;Lesson Summary:&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;ul&gt;&lt;li style="font-size: 100%;"&gt;Entry point for UniswapV4 is the `unlock` function(call unlock and it callbacks you)&lt;/li&gt;&lt;li style="font-size: 100%;"&gt;NonZeroDeltaCount must be 0 after every UniV4 pool swap&lt;/li&gt;&lt;li style="font-size: 100%;"&gt;UniV4 callback implementation should always check if the msg.sender is the pool&lt;/li&gt;&lt;li style="font-size: 100%;"&gt;UniV4 delta could be positive or negative - depends if you send funds to UniV4 or UniV4 sends funds to you&lt;/li&gt;&lt;li style="font-size: 100%;"&gt;sync needs to be called before settles in UniV4&lt;/li&gt;&lt;li style="font-size: 100%;"&gt;Transfer `delta` to the UniV4 pool first, then you .mint 1-1 the delta you transferred&lt;/li&gt;&lt;li style="font-size: 100%;"&gt;Check if .symbol can revert before going to the catch(like in Sukukfi)&lt;/li&gt;&lt;li style="font-size: 100%;"&gt;Check how uniV4 delta works - when's the delta negative/positive(on send or on receive)? Negative - Pool manager is owed tokens, positive - user is owed tokens&lt;/li&gt;&lt;li style="font-size: 100%;"&gt;Check why aren't they calling `sync` in one of the branches in `unlockCallback` - ОК&lt;/li&gt;&lt;li style="font-size: 100%;"&gt;Check if tokens with Reentrancy are in-scope&lt;/li&gt;&lt;li style="font-size: 100%;"&gt;What happens if the delta is type(int256).min and I negate it?&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;span style="display: inline-block"&gt;&lt;/span&gt;&lt;/p&gt;&lt;a href=https://www.0xsimao.com/blog/mentorship-series-21&gt;Read More&lt;/a&gt;</description>
    </item>
    <item>
      <title>Mentorship Series #20</title>
      <pubDate>Thu, 15 Jan 2026 18:37:42 -0800</pubDate>
      <link>https://www.0xsimao.com/blog/mentorship-series-20</link>
      <guid>https://www.0xsimao.com/blog/mentorship-series-20</guid>
      <description>&lt;p style="font-size: 100%;"&gt;We continued the Panoptic &lt;a href="https://code4rena.com/audits/2025-12-panoptic-next-core" data-type="undefined" target="_blank"&gt;contest&lt;/a&gt; on Code4rena.&lt;/p&gt;&lt;p style="font-size: 100%;"&gt;&lt;span style="color: #444444;"&gt;&lt;strong&gt;Lesson Summary:&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;ul&gt;&lt;li style="font-size: 100%;"&gt;Offset is the byte position in calldata where immutable arguments start. It's used by the Clone pattern to read immutable args.&lt;/li&gt;&lt;li style="font-size: 100%;"&gt;2. calldata loads 32 bytes. When you load 32 bytes from an offset, you then need to shift whatever amount is needed in order to only get the info in the bytes you need&lt;/li&gt;&lt;li style="font-size: 100%;"&gt;One Epoch is 4 seconds&lt;/li&gt;&lt;li style="font-size: 100%;"&gt;Strengthen bits, bytes, shifting knowledge&lt;/li&gt;&lt;li style="font-size: 100%;"&gt;Try to memorize the variables, if needed close your eyes and repeat each one. This is important for context&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;span style="display: inline-block"&gt;&lt;/span&gt;&lt;/p&gt;&lt;a href=https://www.0xsimao.com/blog/mentorship-series-20&gt;Read More&lt;/a&gt;</description>
    </item>
    <item>
      <title>Mentorship Series #19</title>
      <pubDate>Thu, 15 Jan 2026 18:37:39 -0800</pubDate>
      <link>https://www.0xsimao.com/blog/mentorship-series-19</link>
      <guid>https://www.0xsimao.com/blog/mentorship-series-19</guid>
      <description>&lt;p style="font-size: 100%;"&gt;We continued the Panoptic &lt;a href="https://code4rena.com/audits/2025-12-panoptic-next-core" data-type="undefined" target="_blank"&gt;contest&lt;/a&gt; on Code4rena.&lt;/p&gt;&lt;p style="font-size: 100%;"&gt;&lt;span style="color: #444444;"&gt;&lt;strong&gt;Lesson Summary:&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;ul&gt;&lt;li style="font-size: 100%;"&gt;Master bit manipulation first — Prioritize learning shifts (&lt;&lt;, &gt;&gt;), masks (&amp;, |, ~), packing/unpacking, and signed integer behavior before diving deep; once comfortable, most "complex" libraries become straightforward helpers.&lt;/li&gt;&lt;li style="font-size: 100%;"&gt;Treat bit-packing as storage optimization, not magic — Expect every value (ticks, liquidity, pointers, legs, flags) crammed into 256-bit words with manual getters/setters; always trace back to the packing layout comment or constants to verify offsets and ranges.&lt;/li&gt;&lt;li style="font-size: 100%;"&gt;Watch for negative number rounding traps — When averaging or dividing for medians/averages (e.g., (a + b) / 2), Solidity’s toward-zero division rounds negative numbers “up” (toward zero) — flag this for consistency checks in tick/price calculations.&lt;/li&gt;&lt;li style="font-size: 100%;"&gt;Be extra suspicious of unchecked blocks — They appear everywhere in extreme-optimization code; carefully verify arithmetic (especially +, - in clamps or deltas) can’t overflow/underflow in ways that break logic (e.g., int24 wrap-around making values unexpectedly small).Lean on fuzz testing for confidence — Once you understand the bit logic, write fuzz tests for encode/decode/update functions — deterministic packing is usually easy to prove correct (or find bugs) with good coverage, so don’t skip this step even if it initially looks clean.&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;span style="display: inline-block"&gt;&lt;/span&gt;&lt;/p&gt;&lt;a href=https://www.0xsimao.com/blog/mentorship-series-19&gt;Read More&lt;/a&gt;</description>
    </item>
    <item>
      <title>Mentorship Series #18</title>
      <pubDate>Thu, 15 Jan 2026 18:37:36 -0800</pubDate>
      <link>https://www.0xsimao.com/blog/mentorship-series-18</link>
      <guid>https://www.0xsimao.com/blog/mentorship-series-18</guid>
      <description>&lt;p style="font-size: 100%;"&gt;We started the Panoptic &lt;a href="https://code4rena.com/audits/2025-12-panoptic-next-core" data-type="undefined" target="_blank"&gt;contest&lt;/a&gt; on Code4rena.&lt;/p&gt;&lt;p style="font-size: 100%;"&gt;&lt;span style="color: #444444;"&gt;&lt;strong&gt;Lesson Summary:&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;ul&gt;&lt;li style="font-size: 100%;"&gt;OZ multicall had a bug when using multicall with metatransactions&lt;/li&gt;&lt;li style="font-size: 100%;"&gt;If the protocol is too big, start with smaller files - constants, libraries, types, etc. which you can go through first so you gain more context for the harder stuff&lt;/li&gt;&lt;li style="font-size: 100%;"&gt;uint ---&gt; int can mess things up&lt;/li&gt;&lt;/ul&gt;&lt;a href=https://www.0xsimao.com/blog/mentorship-series-18&gt;Read More&lt;/a&gt;</description>
    </item>
  </channel>
</rss>
