<?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[ZK Labs - Medium]]></title>
        <description><![CDATA[ZK Labs Blog - Medium]]></description>
        <link>https://blog.zklabs.io?source=rss----2bbc373c10b0---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>ZK Labs - Medium</title>
            <link>https://blog.zklabs.io?source=rss----2bbc373c10b0---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 28 Apr 2026 20:00:30 GMT</lastBuildDate>
        <atom:link href="https://blog.zklabs.io/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[ZK Labs Community Audits Initiative for non-ICO Projects]]></title>
            <link>https://blog.zklabs.io/zk-labs-community-audits-initiative-for-non-ico-projects-ea7830d082f8?source=rss----2bbc373c10b0---4</link>
            <guid isPermaLink="false">https://medium.com/p/ea7830d082f8</guid>
            <category><![CDATA[solidity]]></category>
            <category><![CDATA[smart-contracts]]></category>
            <category><![CDATA[ethereum]]></category>
            <category><![CDATA[security]]></category>
            <dc:creator><![CDATA[Matthew Di Ferrante]]></dc:creator>
            <pubDate>Wed, 26 Sep 2018 07:31:02 GMT</pubDate>
            <atom:updated>2018-09-26T07:31:02.658Z</atom:updated>
            <content:encoded><![CDATA[<p>As part of a broader pursuit to securing the ecosystem, we at ZK Labs are excited to announce our Community Audits initiative to sponsor audits for projects that have not done ICO and don’t plan to do one.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5MhkC9VYTnibbdpnwGKCog.png" /></figure><p>Examples of eligible projects include tooling and libraries important to the development ecosystem (e.g., web3js, solc), non-profit smart contract infrastructure (e.g. ENS, Multisig wallets), open source crypto code/libraries (e.g., ZoKrates), or services beneficial to community.</p><p>Note that the project doesn’t necessarily need to be non-profit to qualify, as long as it can serve as a utility to the community — for example, gambling contracts will never be eligible, but a state channel platform that has some fee system built in could be fine. The point of the community audits initiative is for grassroots projects to be able to receive quality audits without needing to think about raising large amounts of funding before the project can go live, and without having to go through a complex ECF-type application process for a grant.</p><h3>First Wave of Community Audits</h3><p>As part of this announcement, we‘re thrilled to publish the first two community audits we’ve undertaken:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/200/1*7huSYePw727U3SDT9ouPAA.png" /></figure><p><a href="https://solidstamp.com"><strong>SolidStamp</strong></a>: SolidStamp connects <strong>smart contract users</strong> and <strong>auditors</strong> to ensure the safety of their funds. The contract maintains an on-chain database of <strong>smart contract audits</strong> so you can be confident in the code you interact with on-chain.</p><p>— The audit by Matthew Di Ferrante can be found here: <a href="https://zklabs.io/audits/solidstamp.html">https://zklabs.io/audits/solidstamp.html</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/151/1*18s2jE4v64la13WMy96SIw.png" /></figure><p><a href="https://tokensubscription.com/"><strong>Token Subscription</strong></a>: The Token Subscription project enables applications to create a <strong>trustless subscription model</strong> without their users needing to constantly and manually transfer tokens.</p><p>— The audit by Dean Eigenmann can be found here: <a href="https://zklabs.io/audits/tokensub.html">https://zklabs.io/audits/tokensub.html</a></p><h3>About the Initiative</h3><p>So far, the following auditors are confirmed as being part of the initiative:</p><ul><li>Matthew Di Ferrante, ZK Labs Founder &amp; Ethereum Security Contributor</li><li>Dean Eigenmann, ZK Labs Auditor &amp; ENS Developer</li><li>Nick Johnson, ENS Project Lead &amp; Ethereum Core Dev</li></ul><p>I personally will commit to doing at least one reasonably sized community audit per month, along with Dean Eigenmann. We hope to grow the pool with more volunteers as time goes on.</p><p>For any audits that would take a much longer amount of time, we will also be maintaining a charity multisig whose purpose is to fund more complex undertakings. A percentage of profits from ZK Labs will go to fund the initiative, and donations to it are welcomed by anyone. When donating you can also nominate a project or specify a project class (e.g, crypto code, tooling, etc) that you would like your audit donation to go towards.</p><p>If you have a project you want audited that you feel meets the eligibility criteria, want to be involved or are willing to be a multisig curator, reach out to us at <a href="mailto:audits@zklabs.io">audits@zklabs.io</a> or come talk to us in our public room on riot: <a href="https://riot.im/app/#/room/#zklabs:matrix.org">https://riot.im/app/#/room/#zklabs:matrix.org</a></p><p>I hate paperwork just as much as the next cryptoanarchist, so I promise the process will be simple and decisions quick — don’t be afraid to email, even if we may not be able to do a full audit I’m always happy to provide advice.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ea7830d082f8" width="1" height="1" alt=""><hr><p><a href="https://blog.zklabs.io/zk-labs-community-audits-initiative-for-non-ico-projects-ea7830d082f8">ZK Labs Community Audits Initiative for non-ICO Projects</a> was originally published in <a href="https://blog.zklabs.io">ZK Labs</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[NESTing Scalable & Private Voting with Ring Signatures (with a Gentle Introduction to Signature…]]></title>
            <link>https://blog.zklabs.io/nesting-scalable-private-voting-with-ring-signatures-with-a-gentle-introduction-to-signature-22d79f2630a2?source=rss----2bbc373c10b0---4</link>
            <guid isPermaLink="false">https://medium.com/p/22d79f2630a2</guid>
            <category><![CDATA[privacy]]></category>
            <category><![CDATA[cryptography]]></category>
            <category><![CDATA[smart-contracts]]></category>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[ethereum]]></category>
            <dc:creator><![CDATA[Awa Sun Yin]]></dc:creator>
            <pubDate>Thu, 19 Jul 2018 04:51:26 GMT</pubDate>
            <atom:updated>2018-07-19T04:51:25.747Z</atom:updated>
            <content:encoded><![CDATA[<h3>NESTing Scalable &amp; Private Voting with Ring Signatures (with a Gentle Introduction to Signature Schemes in Cryptography)</h3><p>In December last year, <a href="https://medium.com/u/76b12f2cf7d2">Tatu Kärki</a> (Aragon) introduced the project’s own grant program, in collaboration with Placeholder, called Nest (see <a href="https://blog.aragon.one/introducing-aragon-nest-1aa8c91c0566"><em>Introducing Aragon Nest</em></a>). Similar to the Ethereum Foundation’s grant program <a href="https://blog.ethereum.org/2015/04/07/devgrants-help/">ÐΞVgrants</a> and the <a href="https://ecf.network">Ethereum Community Fund</a>, the purpose is to provide grants to individuals or teams that are developing the infrastructure, developer tooling, and frameworks, on which Ethereum’s ecosystem relies on. In addition to financial support, the Nest program is committed to provide advising and technical support to the grantees. Ever since the announcement, Nest has received more than 20 different applications, and you can view them <a href="https://github.com/aragon/nest/issues">here</a>, as they are open-source.</p><p>In the first week of May 2018, <a href="https://medium.com/u/b7bf76066ce8">Matthew Di Ferrante</a> (<a href="https://blog.zklabs.io">ZK Labs</a>), submitted an application representing ZK Labs Research. While ZK Labs is commonly known for security audits, the research arm is an independent team lead by himself, in collaboration with <a href="https://medium.com/u/4e1111d8cc92">Dean Eigenmann</a> (ENS &amp; ZK Labs), and Rebekah Mercer (PhD in Cryptography at Åahrus). The proposal was pre-approved on the 24th of May and shortly after, the corresponding <a href="https://github.com/aragon/nest/issues/40">GitHub Issue</a> was labelled as “approved” 🎉.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CG1qzEF-j4Pho1kovr8iMg.jpeg" /><figcaption>Nest with eggs laid by starlings, house finches or any other brids that tend to lay blue eggs</figcaption></figure><h3>Flash Conceptual Framework</h3><p>On a high level, ZK Labs Research’s project aims to enable private and scalable voting and authentication on Ethereum, leveraging<em> linkable ring signatures</em>. Before diving into the details, let’s have a smooth refresher of concepts.</p><p><strong>Introducing Ring Signatures</strong></p><p>In cryptography, <em>ring signatures</em> are a type of <em>signature scheme. </em>Signature schemes are systems that have one basic functionality: produce digital signatures. A signature scheme is composed by three main elements:</p><ul><li>A<strong> key-generation</strong> algorithm</li><li>A <strong>signing</strong> algorithm</li><li>A <strong>signature</strong> <strong>verification</strong> algorithm</li></ul><p>Signature schemes are pervasive in infrastructure layers of the technology that we use day-to-day. For illustration, the Transport Layer Security (TLS), protocol, on which all websites we visit rely to secure the communications between servers and the browsers, uses commonly known schemes such as Rivest-Shamir-Adleman (RSA) or FIPS’ Digital Signature Algorithm (DSA).</p><p>OpenSSL (commonly used in web servers), NSS (used in Firefox or Thunderbird, among other Mozilla client products), and Crypto++ (commonly used for research and open-source projects) are open-source libraries that include implementations of the aforementioned and more.</p><p>In blockchain literature, signature schemes are essential. <a href="https://bitcoin.org/en/developer-reference#opcodes">Bitcoin</a> and <a href="https://ethereum.github.io/yellowpaper/paper.pdf">Ethereum</a> protocols use Elliptic Curve Digital Signature Algorithms (ECDSA), which is a variant of DSA. In both cases, a curve formed by the parameters defined in <a href="https://en.bitcoin.it/wiki/Secp256k1"><em>secp256k1</em></a> is used.</p><p>Ring signatures are a category of signature schemes. They are characterised for preserving the identity of a signer, as member of a group can produce a signature without revealing him/herself but the group. Grosso modo, a ring signature scheme involves a group of public and private key sets, each of which belong to different peers. Any of the individuals belonging to this group, identified by the corresponding public key, can sign a message using their own private key. Privacy is granted as <em>any</em> of the members of this group <em>could’ve signed the message</em>. Hence, under any external accusations, any of the group members could <em>plausibly deny</em> the claims.</p><p><strong>Examples of Applied Ring Signatures</strong></p><p>An example of its application is for increasing privacy and avoiding de-anonymisation through graph analysis on p2p payment systems (you know, cryptocurrencies). In such systems, a transaction signed by a sender is mixed with a pool of transactions made by a other senders, making it much harder to link each transaction to its actual signer. Obfuscating links via mixing was a popular way of enhancing the privacy on Bitcoin, which existed before ring signatures were implemented in the protocol of certain payment systems. The difference is that <em>tumblers </em>for Bitcoin, e.g., were trusted services that could exit-scam at any time, whereas in certain cryptocurrencies it is implemented in the protocol, so your transactions get mixed by default.</p><p>Another, less mainstream example, could be the following. In a parallel world, governance of Eearthereum is on-chain, where proposals are made and submitted by the public. Proposals can be approved with only one of the signatures (which is a really, really bad idea, don’t do this at home) of the members of the Earthereum Foundation. One of the latest proposals, called<em> EARTHIP-04150705</em>, requested to abandon the existing fork and fully support Earthereum Modern.</p><p>Normally, the fellows at the EF (Earthereum Foundation) would discuss each proposal in their weekly call via Earthpe, but in this particular instance, one of the members of the EF, Zladimir Vamfir signed the approval for the proposal without talking about it with Bitalik Vuterin nor the other members of the EF. Because in the Earthereum’s community there is the unspoken rule of “at the end, Bitalik is the one calling the shots”, everybody though it was B’s decision and unleashed a wave of confusion and made the community rage, without knowing which member actually made the signature*.</p><p><em>* Note that this example is a work of fiction. Names, characters, businesses, places, events, locales, and incidents are either the products of my imagination or used in a fictitious</em><strong><em> </em></strong><em>manner. Any resemblance to actual persons, living or dead, or actual events is purely coincidental.</em></p><p><strong>Introducing Linkable Ring Signatures</strong></p><p>While the very first paper proposing ring signatures dated back in 2001, variant of linkable ring signatures began to proliferate around 2004 (see <em>Literature</em> section at the end). In Rebekah’s “Privacy on the Blockchain: Unique Ring Signatures”, she describes them as:</p><blockquote>Linkable ring signature algorithms provide a scheme that allows users to sign on behalf of a group, again without revealing the individual signer’s identity, but with the additional property that any signatures produced by the same signer, whether signing the same message or different messages, have an identifier, called a tag, linking the signatures. With this tag, third parties can efficiently verify that the signatures were produced by the same signer, without learning who that signer is.</blockquote><p>In essence, the main difference between linkable and initial ring signatures is the tag identifying signatures produced by a specific signer. Unique Ring Signatures (URS) have a <em>tag </em>that links signatures <em>if and only if the signer, message, and ring are the same across the two signatures</em>. This tag is produced by the signer’s private key, a list of public keys of the ring, and allows group members and external peers to check either two identical pieces of information have been signed by the same ring member. URS could grant certain parties the ability to query a piece of information to a server without compromising the anonymity of the original signer. Due to the properties of linkable ring signatures, it could potentially enable private and trustless electronic voting systems.</p><h3>ZK Labs Research’s Proposal on a Scalable and Private Voting System</h3><p>This section aims to provide a shallow description of what the proposal is about and the major components of the project.</p><h4>Background &amp; Motivations</h4><p>Electronic voting systems have always been a popular use case described by many projects in the blockchain space, especially after the infamous incidents in Catalunya last year (I actually wrote a blogpost during those times, as I am originally from Barcelona, titled “<a href="https://medium.com/@awasunyin/how-to-vote-without-being-hit-by-rubber-bullets-and-batons-c9951ad0cc32"><em>How to Vote Without Being Hit by Rubber Bullets and Batons</em></a>”**). The Catalan case was the perfect case where it was obvious that the existing voting system was unavoidably-susceptible to a centralised authority. The properties that an e-voting system should maximise are:</p><ul><li><strong>Decentralisation:</strong> to avoid governments or respective authorities to censor and block voting events</li><li><strong>Anonymity</strong>: to protect citizens’ political privacy</li><li><strong>Scalability</strong>: assuming that such system is used, in even the smallest country in the world, such system should support at least 1,000 citizens to vote (Vatican City, where the population size is estimated to be 1K inhabitants)</li></ul><p>As a system with such properties has not yet been implemented, the aim of ZK Labs Research’s proposal is to provide a set of libraries that support the basic components of an e-voting system on Ethereum and a prototype integrated with the Aragon protocol.</p><p><em>** Note that all my writings around this topic are solely focused on technology and its applications, using real-life events as illustration. Thus, any political connotations are unintended. Should you have suggestions for enhancing neutrality in my writing, please leave a comment.</em></p><h4>Overview of the Components: What is On-Chain and What is Off-Chain?</h4><p>In order to produce a scheme that is scalable, the amount of processes on-chain should be minimised. In this proposal, the only on-chain processes will be <em>key-generation</em> and <em>final verification</em>.</p><p>The processes off-chain are signature generation locally by the users and collection of the signatures from the participants and combining them into an on-chain signature. A decentralised application that provides an interface for users to sign up and for other utilities, such as showing the final voting results.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UMQ10TCoCqKYRE3x991U7Q.png" /><figcaption>Diagram of On-Chain and Off-Chain Components in the Scheme by Matt Di Ferrante</figcaption></figure><h4>Concluding Remarks &amp; Future Writing</h4><p>In this article we announced that ZK Labs Research’ Proposal submitted to Aragon &amp; Placeholder’s Nest program was accepted. A quick refresher of basic concepts has been provided, reminding of basic definitions and examples of what signatures schemes and ring signatures are, with the goal of providing a conceptual foundation for the reader. In the last section, the background and motivations for ZK Labs Research’ proposal was described, finishing up with an overview of the components that the project committed to deliver.</p><p>Depending on the interest showed by the audience, there might be follow-up articles on:</p><ul><li>Technical deep dive into the private and scalable e-voting scheme</li><li>Updates on the progress of the project</li><li>Privacy / Anonymity limitations of ring signatures (more analysis)</li><li>Overview of signature schemes and possible applications for blockchain technology (more cryptography)</li></ul><p>Any feedback is always welcome, feel free to leave a comment or reach out to me on Twitter!</p><h3>Preliminary Work &amp; Readings</h3><h4>Prior Art</h4><ul><li><a href="https://github.com/mattdf/RingCrypto/">mattdf/RingCrypto</a></li><li><a href="https://github.com/solidblu1992/RingCTToken">solidblu1992/RingCTToken</a></li></ul><h4>Ring Signatures, including linkable and unique ring signatures:</h4><ul><li>Rivest, R. L., Shamir, A., &amp; Tauman, Y. (2001, December). How to leak a secret. In <em>International Conference on the Theory and Application of Cryptology and Information Security</em> (pp. 552–565). Springer, Berlin, Heidelberg.</li><li>Liu, J. K., Wei, V. K., &amp; Wong, D. S. (2004, July). Linkable spontaneous anonymous group signature for ad hoc groups. In <em>Australasian Conference on Information Security and Privacy</em>(pp. 325–335). Springer, Berlin, Heidelberg.</li><li>Liu, J. K., &amp; Wong, D. S. (2005, May). Linkable ring signatures: Security models and new schemes. In <em>International Conference on Computational Science and Its Applications</em> (pp. 614–623). Springer, Berlin, Heidelberg.</li><li>Au, M. H., Liu, J. K., Susilo, W., &amp; Yuen, T. H. (2007, May). Certificate based (linkable) ring signature. In <em>International Conference on Information Security Practice and Experience</em>(pp. 79–92). Springer, Berlin, Heidelberg.</li><li>Franklin, M. K., &amp; Zhang, H. (2012). A Framework for Unique Ring Signatures. <em>IACR Cryptology ePrint Archive</em>, <em>2012</em>, 577.</li><li>Mercer, R. (2016). Privacy on the Blockchain: Unique Ring Signatures. <em>arXiv preprint arXiv:1612.01188</em>.</li></ul><h4>In protocol ring signatures for blockchain-based payment systems:</h4><ul><li>van Saberhagen, N. (2018). Cryptonote v 2.0, 2013. <em>URL: https://cryptonote. org/whitepaper. pdf. White Paper. Accessed</em>, 04–13.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=22d79f2630a2" width="1" height="1" alt=""><hr><p><a href="https://blog.zklabs.io/nesting-scalable-private-voting-with-ring-signatures-with-a-gentle-introduction-to-signature-22d79f2630a2">NESTing Scalable &amp; Private Voting with Ring Signatures (with a Gentle Introduction to Signature…</a> was originally published in <a href="https://blog.zklabs.io">ZK Labs</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Adex Platform Audit]]></title>
            <link>https://blog.zklabs.io/adex-platform-audit-5bd172cbe0c3?source=rss----2bbc373c10b0---4</link>
            <guid isPermaLink="false">https://medium.com/p/5bd172cbe0c3</guid>
            <category><![CDATA[audit]]></category>
            <category><![CDATA[ethereum]]></category>
            <dc:creator><![CDATA[Dean Eigenmann]]></dc:creator>
            <pubDate>Thu, 30 Nov 2017 16:02:17 GMT</pubDate>
            <atom:updated>2017-11-30T16:10:05.048Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/426/1*YZDBRpozfmF4Vr1UF-yYmA@2x.jpeg" /></figure><p>The ZK Labs auditors were hired by the <a href="http://adex.network/">Adex team</a> to conduct 2 separate audits of their platform, which can be found in the <a href="https://github.com/AdExBlockchain/adex-core">Adex github repository</a>. The team audited the smart contract versions found in the commit 6ecc86b2a3c3594569e3df9936f6b356b0f42d1e.</p><p>The 2 separate reports written can be found here.</p><p>The Adex team wrote their smart contracts to a very high standard, which led to the ZK Labs team finding no severe issues. However, we were able to make a few suggestions.</p><p><em>Suggestions like naming and wrapping function calls in require were resolved by the team.</em></p><h4>Suggestions</h4><ul><li>Wrap all token transfer &amp; transferFrom function calls into a require, to support older versions of ERC20 tokens which do not throw.</li><li>Replace occurrences of send with transfer.</li><li>Variable name in the ADXExchange contract can be removed.</li><li>Function ordering should be cleaned up to match soliditys style guide.</li><li>Comments listing where function, event and modifier definitions are seem rather useless.</li><li>Consider summarizing “Links on publisher” and “Links on advertiser” into a common struct, so the struct Bid contains advertiser and publisher that are both a struct containing the specific info. This can be done as the info on both sides is the same, except of slot and unit, but for this the enum can be used to specify what type of data it is.</li><li>Consider changing the description comments above functions to natspec conforming comments.</li><li>Make modifier names more descriptive</li><li>Change var to an explicit type, increases legibility and ease of understanding.</li><li>Remove the underscores from parameter names where they are not necessary.</li><li>The logic is identical to that found in cancelBid, consider expanding the permissions in the cancelBid function to allow for both the advertiser and the publisher to cancel, eliminating the need for this function.</li></ul><h4>Minor issue</h4><p>There is nothing that prevents the advertiser and publisher from being the same person, maybe this should be checked for.</p><h4>Conclusion</h4><p>No severe issues were found, however suggestions were made to adhere to best practices.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5bd172cbe0c3" width="1" height="1" alt=""><hr><p><a href="https://blog.zklabs.io/adex-platform-audit-5bd172cbe0c3">Adex Platform Audit</a> was originally published in <a href="https://blog.zklabs.io">ZK Labs</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[FansUnite Audit]]></title>
            <link>https://blog.zklabs.io/fansunite-audit-e16dd53e42c?source=rss----2bbc373c10b0---4</link>
            <guid isPermaLink="false">https://medium.com/p/e16dd53e42c</guid>
            <category><![CDATA[solidity]]></category>
            <category><![CDATA[smart-contracts]]></category>
            <category><![CDATA[audit]]></category>
            <category><![CDATA[blockchain]]></category>
            <dc:creator><![CDATA[Dean Eigenmann]]></dc:creator>
            <pubDate>Thu, 02 Nov 2017 15:26:53 GMT</pubDate>
            <atom:updated>2017-11-02T15:26:53.257Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/705/1*q9n2nc3Fl1qyrYNvNRWBjw.png" /></figure><p>The ZK Labs auditors were hired by the <a href="https://fansunite.io/">FansUnite team</a> to conduct 2 separate audits of their crowdsale and token contracts, which can be found in the <a href="https://github.com/FansUnite12/FAN-contracts">FansUnite github repository</a>. The team audited the smart contract versions found in the commit 1c989dbd269958df1d474d5e29ed11e96e7efee0.</p><p><em>The severe issue mentioned below were fixed by the FansUnite team as of the commit </em><a href="https://github.com/FansUnite12/FAN-contracts/commit/75cc4b3d1a6232bdd107b17637bb264a94981e04"><em>75cc4b3d1a6232bdd107b17637bb264a94981e04</em></a><em>.</em></p><p><a href="https://github.com/decanus/audits/blob/master/FansUnite.pdf"><em>Full report by Dean Eigenmann.</em></a></p><p>Along with investigating some of the security issues, we added some of our recommendations that could be implemented to simplify and improve the code.</p><h3>Severe</h3><p>A severe issue was found which would lead to the failure of finalization of the crowdsale. This was due to the fact that the last purchase could exceed token cap, causing an exception to be thrown by SafeMath in the finalize method.</p><p>This issue could occur not only through the purchase function, but also through the addPrecommitment function, which allows the FansUnite team to allocate tokens to addresses.</p><p>The solution of this issue was to simply check that an allocation through either the addPrecommitment or the purchase function does not exceed the maximum limit.</p><h3>Suggestions</h3><p>Along with the issue we had found, we also found a series of improvements and changes that could be made to the code.</p><ul><li>The <a href="https://github.com/FansUnite12/FAN-contracts/blob/1c989dbd269958df1d474d5e29ed11e96e7efee0/contracts/FansUniteCrowdfund.sol#L40">MinGoalReached</a> event can be removed as it is never used.</li><li>The multiplier <a href="https://github.com/FansUnite12/FAN-contracts/blob/1c989dbd269958df1d474d5e29ed11e96e7efee0/contracts/FansUniteCrowdfund.sol#L80"><em>10**24</em></a><em> </em>is used repeatedly, a constant could be created in place.</li><li>The <a href="https://github.com/FansUnite12/FAN-contracts/blob/1c989dbd269958df1d474d5e29ed11e96e7efee0/contracts/FansUniteCrowdfund.sol#L96">doPurchase</a> function is passed a parameter called <em>_owner</em> that is unused. We suggested to remove this parameter and simply use the <em>msg.sender </em>constant.</li><li>We suggested that the <a href="https://github.com/FansUnite12/FAN-contracts/blob/1c989dbd269958df1d474d5e29ed11e96e7efee0/contracts/FansUniteCrowdfund.sol#L105">transfer method call</a> in the <a href="https://github.com/FansUnite12/FAN-contracts/blob/1c989dbd269958df1d474d5e29ed11e96e7efee0/contracts/FansUniteCrowdfund.sol#L96">doPurchase</a> function should use the <em>weiAmount</em> variable rather than the <em>msg.value</em> constant.</li><li>We suggested that the <a href="https://github.com/FansUnite12/FAN-contracts/blob/1c989dbd269958df1d474d5e29ed11e96e7efee0/contracts/FansUniteCrowdfund.sol#L120">addToWhitelist</a> function should be adapted so an array of addresses could be whitelisted. This would reduce the amount of transactions required significantly.</li><li>We suggested to the developers that the FansUniteToken could be easily replaced with contracts from the OpenZeppelin library.</li><li>The <a href="https://github.com/FansUnite12/FAN-contracts/blob/1c989dbd269958df1d474d5e29ed11e96e7efee0/contracts/TokenVesting.sol#L27">TokenVesting</a> contract constructor could be modified to automatically multiple the <em>_duration</em> variable by <em>1 weeks</em>, simplifying what needs to be passed.</li><li>It could occur that the <a href="https://github.com/FansUnite12/FAN-contracts/blob/1c989dbd269958df1d474d5e29ed11e96e7efee0/contracts/FansUniteCrowdfund.sol#L114">finalize</a> method mints 0 tokens to the <em>unsoldSupplyAddress</em>, we suggested that a check should be added.</li></ul><h3>Conclusion</h3><p>We found one severe issue, which we explained to the FansUnite team along with a list of possible methods to fix the issue. Additionally we proposed changes to follow best practice standards as well as increase the legibility of the code.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e16dd53e42c" width="1" height="1" alt=""><hr><p><a href="https://blog.zklabs.io/fansunite-audit-e16dd53e42c">FansUnite Audit</a> was originally published in <a href="https://blog.zklabs.io">ZK Labs</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>