{"id":119,"date":"2022-02-18T12:00:00","date_gmt":"2022-02-18T10:00:00","guid":{"rendered":"https:\/\/ackeeblockchain.com\/blog\/?p=119"},"modified":"2022-04-04T09:59:17","modified_gmt":"2022-04-04T08:59:17","slug":"ackee-blockchain-audited-zunami-protocol","status":"publish","type":"post","link":"https:\/\/ackee.xyz\/blog\/ackee-blockchain-audited-zunami-protocol\/","title":{"rendered":"Zunami Protocol audited by Ackee Blockchain"},"content":{"rendered":"<h4>About Zunami Protocol<\/h4>\n<p><em>Update (18th August 2023)<\/em>: this audit report was performed on commit <code class=\"codehl\">37dccabf5aa3697dce5eaf6457debb3ac7404fdd<\/code>, the <a href=\"https:\/\/coinmarketcap.com\/community\/articles\/64d9ef6262115c7ccfb3c1d8\/\">hack<\/a> was performed by a donation (price manipulation) into strategy MimCurveStakeDAO (<a href=\"https:\/\/raw.githubusercontent.com\/RektHQ\/Assets\/main\/images\/2023\/01\/zunami-steps.png\">step 3<\/a>) that was first added in commit <code class=\"codehl\">6df0ae533a718a34df70984d745cc2d70fb7172d<\/code>, 28,296 additions ahead of this audit.<\/p>\n<p><a href=\"https:\/\/www.zunami.io\/\">Zunami Protocol<\/a> is<strong> a multi-chain revenue aggregator for stablecoins<\/strong> <span style=\"font-weight: 400;\">that generate profits within the existing market using risk-free assets.\u00a0<\/span><\/p>\n<p>It uses Transaction Streamlining Mechanism (TSM)<span style=\"font-weight: 400;\">, reducing the commissions for individual transactions by <strong>accumulating users&#8217; funds in one batch<\/strong> and distributing it according to Zunami&#8217;s strategies.<\/span><!--more--><\/p>\n<p><span style=\"font-weight: 400;\"> <img loading=\"lazy\" decoding=\"async\" class=\"wp-image-122 aligncenter\" src=\"https:\/\/abchprod.wpengine.com\/wp-content\/uploads\/2022\/02\/Sni\u0301mek-obrazovky-2022-02-22-v-14.55.57-1.png\" alt=\"\" width=\"660\" height=\"301\" srcset=\"https:\/\/ackee.xyz\/blog\/wp-content\/uploads\/2022\/02\/Sni\u0301mek-obrazovky-2022-02-22-v-14.55.57-1.png 2147w, https:\/\/ackee.xyz\/blog\/wp-content\/uploads\/2022\/02\/Sni\u0301mek-obrazovky-2022-02-22-v-14.55.57-1-300x137.png 300w, https:\/\/ackee.xyz\/blog\/wp-content\/uploads\/2022\/02\/Sni\u0301mek-obrazovky-2022-02-22-v-14.55.57-1-1024x466.png 1024w, https:\/\/ackee.xyz\/blog\/wp-content\/uploads\/2022\/02\/Sni\u0301mek-obrazovky-2022-02-22-v-14.55.57-1-768x350.png 768w, https:\/\/ackee.xyz\/blog\/wp-content\/uploads\/2022\/02\/Sni\u0301mek-obrazovky-2022-02-22-v-14.55.57-1-1536x700.png 1536w, https:\/\/ackee.xyz\/blog\/wp-content\/uploads\/2022\/02\/Sni\u0301mek-obrazovky-2022-02-22-v-14.55.57-1-2048x933.png 2048w, https:\/\/ackee.xyz\/blog\/wp-content\/uploads\/2022\/02\/Sni\u0301mek-obrazovky-2022-02-22-v-14.55.57-1-370x169.png 370w, https:\/\/ackee.xyz\/blog\/wp-content\/uploads\/2022\/02\/Sni\u0301mek-obrazovky-2022-02-22-v-14.55.57-1-760x346.png 760w\" sizes=\"auto, (max-width: 660px) 100vw, 660px\" \/><\/span><\/p>\n<p><span style=\"font-weight: 400;\">The Zunami Protocol <strong>selects the most profitable strategies<\/strong> by monitoring APY data and making calculations. Then, the users&#8217; funds are sent to <\/span><a href=\"https:\/\/curve.fi\/\"><span style=\"font-weight: 400;\">Curve<\/span><\/a><span style=\"font-weight: 400;\">, and LP tokens are staked on <\/span><a href=\"https:\/\/www.convexfinance.com\/\"><span style=\"font-weight: 400;\">Convex Finance<\/span><\/a><span style=\"font-weight: 400;\"> or <\/span><a href=\"https:\/\/yearn.finance\/#\/home\"><span style=\"font-weight: 400;\">Yearn Finance<\/span><\/a><span style=\"font-weight: 400;\">.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Accumulated rewards in the DeFi protocol are automatically sold, and the profits are reinvested for the auto-compounding effect.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">To learn more about the <\/span>Zunami Protocol,<span style=\"font-weight: 400;\"> read <strong>the official\u00a0documentation<\/strong><\/span>\u00a0<a href=\"https:\/\/zunamilab.gitbook.io\/zunami-docs\/protocol-overview\/how-it-works\"><span style=\"font-weight: 400;\"><strong>here<\/strong><\/span><\/a><span style=\"font-weight: 400;\">.<\/span><\/p>\n<h4>About the audit<\/h4>\n<div class=\"page\" title=\"Page 1\">\n<div class=\"section\">\n<div class=\"layoutArea\">\n<div class=\"column\">\n<p>Ackee Blockchain security team, engaged by Zunami Protocol, performed an <a href=\"https:\/\/ackeeblockchain.com\/blog\/glossary\/audit\/\">audit<\/a> of several contracts between <strong>January 3 and January 14, 2022<\/strong>. The entire audit process was conducted with a total time donation of <strong>12 engineering days<\/strong>.<\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<p class=\"p1\">At the beginning of the\u00a0<span class=\"s1\">audit<\/span>, the\u00a0following\u00a0<b>main objectives\u00a0<\/b>were defined:<\/p>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"2\"><span style=\"font-weight: 400;\">Check the activity on the GitHub repository.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"2\"><span style=\"font-weight: 400;\">Review the code quality, architecture, and best practices.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"2\"><span style=\"font-weight: 400;\">Check for vulnerabilities if nobody can steal funds or damage contracts.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"2\"><span style=\"font-weight: 400;\">Validate algorithms and math calculations for misbehaviors.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"2\"><span style=\"font-weight: 400;\">Check if the contract&#8217;s owner is not overpowered.<\/span><\/li>\n<\/ul>\n<p>The audit methodology for Zunami Protocol consisted of:<\/p>\n<div class=\"page\" title=\"Page 3\">\n<div class=\"section\">\n<div class=\"layoutArea\">\n<div class=\"column\">\n<ol>\n<li><strong>Technical specification\/documentation<\/strong> &#8211; a brief overview of the system is requested from the client, and the audit scope is defined.<\/li>\n<li><strong>Tool-based analysis<\/strong> &#8211; deep check with automated Solidity analysis tools is performed.<\/li>\n<li><strong>Manual code review<\/strong> &#8211; the code is checked line by line for common vulnerabilities, code duplication, best practices, and the code architecture is reviewed.<\/li>\n<li><strong>Local deployment + hacking<\/strong> &#8211; contracts are deployed locally, and we try to aack the system and break it.<\/li>\n<li><strong>Unit testing<\/strong> &#8211; run unit tests to ensure that the system works as expected. Potentially we write our unit tests for specific suspicious scenarios.<\/li>\n<\/ol>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<h4><b>Findings<\/b><\/h4>\n<p class=\"p1\">Using the toolset, manual code review, and unit testing<b> led to\u00a0the following\u00a0<\/b><a href=\"https:\/\/ackeeblockchain.com\/blog\/glossary\/findings\/\"><b>findings<\/b><\/a>:<\/p>\n<ul>\n<li style=\"text-align: left;\">L1: <span style=\"font-weight: 400;\">Inconsistent iteration statement syntax\u00a0<\/span><\/li>\n<li>L2: <span style=\"font-weight: 400;\">Hardcoded token index<\/span><\/li>\n<li>L3: <span style=\"font-weight: 400;\">Confusing modifier naming<\/span><\/li>\n<li>M1: <span style=\"font-weight: 400;\">Unused virtual keyword<\/span><\/li>\n<li>M2: <span style=\"font-weight: 400;\">Public functions can be external<\/span><\/li>\n<li>M3: <span style=\"font-weight: 400;\">State variable could be local<\/span><\/li>\n<li>M4: <span style=\"font-weight: 400;\">Missing const<\/span><\/li>\n<li>M5: <span style=\"font-weight: 400;\">Unused variables<\/span><\/li>\n<li>M6: <span style=\"font-weight: 400;\">Code duplication<\/span><\/li>\n<li>M7: <span style=\"font-weight: 400;\">Interface issues<\/span><\/li>\n<li>M8: <span style=\"font-weight: 400;\">Unintended feature &#8211; Renounce ownership<\/span><\/li>\n<li>M9: <span style=\"font-weight: 400;\">Missing const<\/span><\/li>\n<li>H1: <span style=\"font-weight: 400;\">Management fee rewriting<\/span><\/li>\n<li>C1: <span style=\"font-weight: 400;\">Bug in the logic &#8211; wrong pool id<\/span><\/li>\n<li>C2: <span style=\"font-weight: 400;\">Rewriting deposit amounts<\/span><\/li>\n<\/ul>\n<p class=\"p1\"><strong>3 low<\/strong> severity, <strong>9 medium<\/strong> severity, <strong>1 high<\/strong> severity, and <strong>2 critical<\/strong> severity issues were identified.<\/p>\n<h4>Conclusion<\/h4>\n<p><span style=\"font-weight: 400;\">Based on our audit report, the Zunami team responsibly took four weeks to resolve the audit findings.<\/span><\/p>\n<p>After the audit, we recommended a <a href=\"https:\/\/ackeeblockchain.com\/blog\/glossary\/re-audit\/\"><strong>re-audit<\/strong><\/a>, which <span style=\"font-weight: 400;\">was performed between <strong>February<\/strong> <strong>16 and February 18, 2022<\/strong>.<\/span> <span style=\"font-weight: 400;\">In the re-audit, we reviewed whether all the findings have been fixed.\u00a0<\/span><span style=\"font-weight: 400;\">The Zunami team <strong>correctly fixed all issues<\/strong> discovered in the first audit, and the codebase also improved between the two audit revisions. We found only one new minor issue.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">We were delighted to audit the <\/span><b>Zunami protocol \u2013 a multi-chain revenue aggregator for stablecoins<\/b><span style=\"font-weight: 400;\">\u00a0and look forward to working with them again.<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>About Zunami Protocol Update (18th August 2023): this audit report was performed on commit 37dccabf5aa3697dce5eaf6457debb3ac7404fdd, the hack was performed by a donation (price manipulation) into strategy MimCurveStakeDAO (step 3) that was first added in commit 6df0ae533a718a34df70984d745cc2d70fb7172d, 28,296 additions ahead of this audit. Zunami Protocol is a multi-chain revenue aggregator for stablecoins that generate profits within the existing market using risk-free assets.\u00a0 It&hellip;<\/p>\n","protected":false},"author":11,"featured_media":124,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[20,10],"tags":[21,27,26,24,28,13,25],"class_list":["post-119","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-audits","category-ethereum","tag-audit","tag-blockchain","tag-cryptocurrency","tag-ethereum","tag-smart-contract","tag-vulnerability","tag-zunami-protocol"],"aioseo_notices":[],"featured_image_src":"https:\/\/ackee.xyz\/blog\/wp-content\/uploads\/2022\/02\/ABCH-zunami-protocol-600x400.png","featured_image_src_square":"https:\/\/ackee.xyz\/blog\/wp-content\/uploads\/2022\/02\/ABCH-zunami-protocol-600x600.png","author_info":{"display_name":"Andrea Nov\u00e1kov\u00e1","author_link":"https:\/\/ackee.xyz\/blog\/author\/andrea-novakova\/"},"_links":{"self":[{"href":"https:\/\/ackee.xyz\/blog\/wp-json\/wp\/v2\/posts\/119","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ackee.xyz\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ackee.xyz\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ackee.xyz\/blog\/wp-json\/wp\/v2\/users\/11"}],"replies":[{"embeddable":true,"href":"https:\/\/ackee.xyz\/blog\/wp-json\/wp\/v2\/comments?post=119"}],"version-history":[{"count":0,"href":"https:\/\/ackee.xyz\/blog\/wp-json\/wp\/v2\/posts\/119\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ackee.xyz\/blog\/wp-json\/wp\/v2\/media\/124"}],"wp:attachment":[{"href":"https:\/\/ackee.xyz\/blog\/wp-json\/wp\/v2\/media?parent=119"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ackee.xyz\/blog\/wp-json\/wp\/v2\/categories?post=119"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ackee.xyz\/blog\/wp-json\/wp\/v2\/tags?post=119"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}