<?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 Hosho Group on Medium]]></title>
        <description><![CDATA[Stories by Hosho Group on Medium]]></description>
        <link>https://medium.com/@hosho?source=rss-f133452bd349------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*tn0PapzhbroHC8657tUK6w@2x.png</url>
            <title>Stories by Hosho Group on Medium</title>
            <link>https://medium.com/@hosho?source=rss-f133452bd349------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 01 Dec 2026 23:37:00 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@hosho/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[Introducing HoshoCon — The Blockchain Security Conference]]></title>
            <link>https://medium.com/@hosho/introducing-hoshocon-the-blockchain-security-conference-4000cd8085db?source=rss-f133452bd349------2</link>
            <guid isPermaLink="false">https://medium.com/p/4000cd8085db</guid>
            <category><![CDATA[conference]]></category>
            <category><![CDATA[cryptocurrency]]></category>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[las-vegas]]></category>
            <dc:creator><![CDATA[Hosho Group]]></dc:creator>
            <pubDate>Mon, 11 Jun 2018 22:40:03 GMT</pubDate>
            <atom:updated>2018-06-12T01:23:30.012Z</atom:updated>
            <content:encoded><![CDATA[<p>Authored by: <a href="https://www.linkedin.com/in/gabrielshepherd/">Gabe Shepherd</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NNd0D45r9qTZ-znw3hQVVg.png" /></figure><p>Hosho Group has been actively involved on the Blockchain and Cryptocurrency conference circuit since mid 2017. We’ve traveled across the globe to engage with the people in the industry and learn how to best support the security needs of our rapidly growing community.</p><p>We have traveled to some amazing destinations including Moscow, Berlin, Kiev, London, Seoul, New York, Tel Aviv, Toronto, and Singapore to name a few. While we have benefited from listening to keynotes, panels, and pitch competitions; nothing compares to the relationships and sense of community we now enjoy thanks to these events, and the people who have participated at them.</p><p>As part of our commitment to protecting and educating our clients about the importance of security, we are incredibly excited to announce <a href="http://hoshocon.com/">HoshoCon</a>, our Blockchain Security Conference! Having visited so many wonderful cities, we are humbled to have the opportunity to host you in ours — Las Vegas!</p><p>HoshoCon will take place on October 9th-11th of 2018 at <a href="https://www.hoshocon.com/page/1349324/the-venue">The Hard Rock Hotel &amp; Casino in Las Vegas</a> — and launch day registration pricing is <a href="http://hoshocon.com/">now live</a>! You can expect curated panelists, speakers, a developer track with workshops and presentations by industry leading cybersecurity experts, a mentorship program, a hack-a-thon, and nightly entertainment that only Las Vegas can live up to!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jmj17l6wFG3Ypoa7QdgqHg.png" /><figcaption>Hard Rock Hotel and Casino in Las Vegas- Host of HoshCon2018</figcaption></figure><p>We are grateful to our initial list of speakers including <a href="https://twitter.com/Melt_Dem">Meltem Demirors</a>, <a href="https://twitter.com/AlenaSatoshi">Alena Vranova</a>, Stacy and Max Keiser from <a href="https://twitter.com/KeiserReport">The Keiser Report</a>, Mikko Ohtamaa of Token Market, and <a href="https://twitter.com/mikojava">Mikko Matsumura</a> to name a few! We are not an events company, we are a Blockchain Security company, so we are equally grateful to our initial sponsors who believed in the idea of a Blockchain Security conference. Those companies include <a href="http://wachsman.com/">Wachsman</a>, Pink Sky Capital, and Fuller Street Productions.</p><p>Our goal is to make this conference the most valuable in the industry for all attendees and companies that get involved, so please send an email to <a href="/service/mailto:events@hoshogroup.com">events@hoshogroup.com</a> if you are interested in participating. Join our mailing list on the website for updates, and we will see you in October!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4000cd8085db" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Auditing the Unchained Capital smart contract]]></title>
            <link>https://medium.com/@hosho/auditing-the-unchained-capital-smart-contract-ac2d7ecea373?source=rss-f133452bd349------2</link>
            <guid isPermaLink="false">https://medium.com/p/ac2d7ecea373</guid>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[smart-contracts]]></category>
            <category><![CDATA[unchained-capital]]></category>
            <category><![CDATA[hosho]]></category>
            <category><![CDATA[blockchain-security]]></category>
            <dc:creator><![CDATA[Hosho Group]]></dc:creator>
            <pubDate>Thu, 24 May 2018 18:29:52 GMT</pubDate>
            <atom:updated>2018-05-24T19:05:14.713Z</atom:updated>
            <content:encoded><![CDATA[<h4>What standing out from the crowd looks like.</h4><p>Authored By: <a href="http://twitter.com/gabeshep">Gabe Shepherd</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2b1k7v6jfSKbKhfICHLTcQ.jpeg" /></figure><p>As Blockchain technology continues to impose its will in disrupting industries, Hosho Group headed to Consensus last week in New York, particularly interested in seeing how projects and the technologists behind them had changed since 2017. While the previous year demonstrated promise, as a security company within the Blockchain space we have audited a great deal of smart contracts since then and had yet to see one come through our company without a vulnerability. In fact, 95% of audits we conduct have one or more vulnerabilities, and 32% of them have one or more vulnerabilities of a critical nature.</p><p>As a cybersecurity company with a CEO that previously <a href="https://www.linkedin.com/in/jchysk/">co-founded Coinsetter </a>(Acquired by Kraken), and LaunchKey, a multi factor authentication platform acquired by Iovation, our team is well positioned to help an exchange or company executing a token generation event avoid minor and catastrophic incidents. We stress preventive security measures so much that I imagine companies and partners we work with could perceive it as paranoia. It is our responsibility to educate and protect our customers, and until we see the space mature with more emphasis on security — have an obligation to continue doing so, and even then we won’t stop.</p><p>Our ethos as a company is to contribute to the sophistication of the space by educating, highlighting, and discussing the flaws we find during a smart contract audit or how exchanges could have prevented hacks with routine penetration testing. By the same measure we are obligated to talk about projects and the technologists developing them when done well. The purpose of this post is to highlight the tremendous work done by Unchained Capital, who offers crypto-secured loans. Their team engaged Hosho for the purpose of conducting a third party audit of their open-source Ethereum smart contract which implemented a two-of-three multi-signature wallet designed to directly interface with Trezor hardware wallets.</p><p>For the first time since Hosho was founded, Unchained Capital provided us with a codebase that was given a clean audit report with 0 vulnerabilities found. As you can imagine, we have seen some pretty scary things in our technical audits and general security work, but Unchained Capital’s work was so thorough it earned high praise from Alexander Blair, our VP of Engineering</p><blockquote>“They put together a very well designed multi-signature wallet with sensible protections, combined with an easy to use dapp that should serve them and their clients well into the future. This was the best contract that the Hosho auditing team has come across, and the Unchained Capital team received a well deserved passing grade from the Hosho auditing team.”</blockquote><p>You can read more about Unchained Capital’s wallet and the audit we conducted on <a href="https://blog.unchained-capital.com/a-simple-safe-multisig-ethereum-smart-contract-for-hardware-wallets-a107bd90bb52">their blog pos</a>t. During our initial talks with the cofounders, <a href="https://www.linkedin.com/in/josephkelly/">Joe Kelly</a> and <a href="https://www.linkedin.com/in/dhruvbansal/">Dhruv Bansal</a> who are CEO and CSO respectively, it was refreshing to hear Dhruv proactively offer up this thought…</p><blockquote>“I am confident in our team’s ability and what we have built, but it’s still valuable to us and comforting to our customers to have a trustworthy, independent third party validate our work.”</blockquote><p>There is an abundance of technical talent within the Blockchain community, people who are accomplished and skilled in their craft. But putting aside for one minute the rapid growth of blockchain technologies, platforms, and languages these are being built with; All of us who want to contribute to the maturation of the space should be as committed as Dhruv and his team are to security minded development, and third party auditing of that work. Additionally, that independent review should be conducted <em>prior</em> to exposing customers, investors, and the industry to potential risk. <a href="https://hosho.io/">Hosho</a> would be honored to do that work, but ultimately what we care about is being a small part of a larger story that we are all writing together. Nobody in the industry benefits when a hack or capital loss occurs, not even Hosho, which sees a lot of work from companies after those things occur. The media loves to jump on these moments to instill doubt about the future of the space because it gets page views, and companies who are threatened by a decentralized world use them as tools to further entrench their power within their industry. Most of us in the industry believe that we are just scratching the surface of what this technology is capable of, but until independent security review is considered a prerequisite to any technology being released, we are only hurting ourselves by stifling innovation, capital infusion, and adoption by the general public.</p><p>It is easy for Hosho to republish blog posts about hacks and vulnerabilities, and use them as tools to educate our customers about the importance of our work. It was powerful to be able to say every audit we have conducted contained vulnerabilities of varying degree. But if we want to live up to our mission of education, prevention, and protection for our customers; Then <a href="https://www.unchained-capital.com/how_it_works/">Unchained Capital’s</a> work should be praised, and we are honored to be the first ones to do it.</p><p>In closing, as part of our customer success process we had a wrap up call with Joe and Dhruv to make sure there were no further questions and audit our own processes and customer service. We asked Dhruv if he felt the investment they made for our services was still valuable, despite knowing that we sent them a report back finding no vulnerabilities. Dhruv’s response further validated what we now know about their team. They care about their products, they care about their customers, and they care about the industry.</p><blockquote><strong>“It was absolutely still valuable. We felt pretty good about what we had developed, but we are responsible for people’s capital and having third party experts look at the work and validate our efforts, well it helps me sleep at night.”</strong></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ac2d7ecea373" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[FAQ: Smart Contract Audit]]></title>
            <link>https://medium.com/@hosho/faq-smart-contract-audit-6ea46336d340?source=rss-f133452bd349------2</link>
            <guid isPermaLink="false">https://medium.com/p/6ea46336d340</guid>
            <category><![CDATA[ethereum]]></category>
            <category><![CDATA[smart-contracts]]></category>
            <dc:creator><![CDATA[Hosho Group]]></dc:creator>
            <pubDate>Thu, 22 Feb 2018 22:05:32 GMT</pubDate>
            <atom:updated>2018-02-22T23:54:23.652Z</atom:updated>
            <content:encoded><![CDATA[<p>Hello everyone, Andrew from the Marketing team here at Hosho. I had the pleasure of sitting down with Hosho’s VP of Engineering — Alex Blair. I asked him FAQ regarding the Audit of a Smart Contract.</p><p><strong>Explain what a Smart Contract audit looks like</strong></p><p>At a high level, a smart contract audit is a review of the code as well as the functionality of the code in regards to the white paper, and or, other development materials provided by the client.</p><p>It also contains the complete writing of a test suite from essentially nothing, to a full, preferably 100% coverage of your various lines of code, your functionality, and things of that nature, as well as manual verification of any math, token issuance being the very largest portion of that, in most contracts.</p><p><strong>Why should you have your Smart Contract audited?</strong></p><p>Smart contracts are not incredibly complex. However, they do tend to contain very strange code paths and things that don’t always make the most sense off the bat. A good example of that is administration.</p><p>The smart contract system doesn’t inherently have an ownership system or idea. Very much due to that, you end up with the requirement of adding one in yourself.</p><p>There are certainly systems that add administration features, however, once you start adding them, you must make absolutely sure that anything that resembles administration feature is actually covered under that.</p><p>We’ve run into contracts where these features are not properly covered and due to this, they are open to the world and can be changed. In one very specific instance, it was the price of the token that was not properly covered.</p><p><strong>How often are problems found in Smart Contracts that you audit?</strong></p><p>We have found one contract so far that did not have a very high-level bug, out of the several dozens we’ve done in the last couple of months. There’s been one that didn’t have a particularly critical bug, it still had a error.</p><p>But every contract we run across has some kind of bug, error or non-alignment with the standard, which tends to be a lot of it. The standards are published, but people do not follow them.</p><p><strong>Give me a Technical Description of a Smart Contract audit</strong></p><p>Kind of from the top, we receive it. We do an initial code review, kind of get a feel for how a contract is going to function, does it compile and things of that nature, verify solidity versions, all that kind of stuff.</p><p>Once we’ve received it, and we’ve done all that work, then we start doing a static and dynamic analysis at the same time. The static analysis is a review of the code and kind of the logic behind it, versus a dynamic analysis, which is actually executed on machine.</p><p>Using Ethereum TestRPC and other related software, we verify the actual functionality of the code through very large test suite, some of which is pre-written. Others are absolutely written for each individual contract. General pre-written stuff is going to be stuff like ERC-20s, but any extensions are all custom per contract.</p><p><strong>What are some of the most egregious errors found in Smart Contracts?</strong></p><p>Mishandling of ownership is probably the most common one. How egregious that is tends to vary on what isn’t covered. Like I said, we’ve had issues with token ownership, token price ownership as well. We’ve had issues where there was an infinite token generation bug where two users could collude to generate infinite tokens between them. Obviously a bug, obviously an issue, but that was just something that wasn’t considered in the logic.</p><p>We’ve got issues where some tokens, just things similar to CryptoKitties, were being able to be traded, bought, and sold, but depending on how it was flagged, you could buy one that was recently traded at a deflated price due to kind of how the contract flow worked. So, there’s a lot of logic that goes into that. We really suggest looking into flowcharts and things like that to help avoid this if you’re doing things like buying, selling, or trading.</p><p>Most projects screw up their own in whatever way they find most fit. Contracts at this point are primarily moved to using libraries that take care of a lot of their really high-level security, but it’s whatever they add to the contact to where it’s worth breaking.</p><p><strong>What is the earliest you can get a Smart Contract audit?</strong></p><p>The contract should be one of the first things that you’re looking at. You should not be waiting until the week before your ICO is out to have your contract done. Your contract should be done weeks in advance, and it should be the absolute last worry on your mind.</p><p>You have enough going on at the beginning of your ICO to not worry about if your contract’s going to be done on time or not. Get your audit done as early as possible. Get your code done early. Get your audit done early.</p><p>The later you wait in the process, the tighter your schedule is, and the tighter and more expensive it’s going to end up being. It’s much cheaper to get your audit done weeks in advance.</p><p><strong>What kind of skills and knowledge is necessary to audit a Smart Contract?</strong></p><p>A fairly in-depth ability to handle logic, a very convoluted logic in general. Interest in designing and writing flow charts, spreadsheets, things of that nature. Some large-number math is usually very convenient because we’re dealing with things out to the 18th power as a baseline.</p><p>Past that, it’s really just kind of the ability and want to investigate and be like, “Hey, this didn’t work as I expected” or “Why didn’t I do that originally?” It goes back to the logic and kind of general deadline theory.</p><p><strong>When should you have your Smart Contract audited?</strong></p><p>The time to get a Smart Contract Audit is going to be very, very near the end of your development cycle. Getting your contract audited much before then usually isn’t that helpful, we’ve certainly had clients that have brought us contracts that ended up being very heavily edited.</p><p>In the last week or so of their development life cycle after the account does the audit, and then they have to undergo a much more extensive re-audit due to the fact the contract was changed so much.</p><p>Large structural changes, changes from time based tranches to block based tranches and things of that nature tend to cause very large issues with the auditing process.</p><p><strong>Why should the Auditor always be a different party than the writer?</strong></p><p>This is as much that we don’t end up with blinders on as anything else. The person that writes the contract will generally think they’ve written the contract correctly. Your auditor does not. Our perspective is to think that it’s not written correctly from the round up. We attack the problem from a “You screwed up let’s find the problem” versus a “Hey this is complete, let’s assume that it’s correct.” Which is a very valuable thing.</p><p>The best example of this, is going back to what I mentioned earlier, the contract that had incorrect Admin permissions. When they added that they obviously copy, paste it in the middle of the contract but didn’t copy over the admin verification. And they were very thankful we caught that, because it was just literally that they could change the value of the token.</p><p><strong>What are Security Best Practices before conducting an ICO</strong></p><p>At a very high level, you’re going to want to have a multisig wallet implementation done and ready to go, particularly for any administration purposes, and also for receiving funds. From the contract side, get an auto-done, period, end of story.</p><p>Other than that, there’s been a lot of phishing attacks recently, making sure your social media’s locked down, make sure your accounts are locked down, two-factor authentication. Just general best security practices, even outside of the contract arena.</p><p>For the contract, like I said, get a audit, period, end of story. There’s a lot of tokens that have had issues, and you want to make sure that you’re not one of them.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6ea46336d340" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ICO Investment — Do not burn Ether in Gas]]></title>
            <link>https://medium.com/@hosho/ico-investment-do-not-burn-ether-in-gas-640395317f48?source=rss-f133452bd349------2</link>
            <guid isPermaLink="false">https://medium.com/p/640395317f48</guid>
            <category><![CDATA[gas]]></category>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[ethereum]]></category>
            <dc:creator><![CDATA[Hosho Group]]></dc:creator>
            <pubDate>Thu, 22 Feb 2018 21:32:23 GMT</pubDate>
            <atom:updated>2018-02-22T21:32:23.493Z</atom:updated>
            <content:encoded><![CDATA[<h3>Abstract</h3><p>An investor lost a significant amount of Ether during the failed attempt to purchase AirSwap tokens during its ICO, a decentralized cryptocurrency exchange that started their public crowdsale on Tuesday. The Investor was trying to buy $508,000 (1,700 Ether) worth of AirSwap tokens, but the trade failed and the investor lost $70,000 (236.9516 Ether) in form of Ethereum transaction fees.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/0*PIZk6EwM8LklNDem.jpg" /></figure><h3>Background</h3><p>AirSwap is a decentralized token exchange based on the Swap protocol whitepaper. Swap provides a decentralized trading solution based on a peer-to-peer design. The design solves two problems encountered in a peer-to-peer trading environment: counter-party discovery and pricing suggestions.</p><p>The token sale happened between 10 October 2017 10:10:10 AM Eastern Time and 11 October 2017 at 9:10:10 AM Eastern Time. The token sale was whitelisted and shortlisted investors were entitled to allocation of the individual cap (3.3 ETH) during the entire 23 hours of the main sale. The whitelist registration process happened between October 4, 2017 at 10:00AM Eastern Time and October 6, 2017 at 4:00PM Eastern Time. During the whitelist registration there were more than 18,000 submissions of which 12,719 were successfully whitelisted for the sale.</p><p>AirSwap was running the sale through their own platform <a href="https://launch.airswap.io/">https://launch.airswap.io/</a> to avoid Ethereum network congestion, high gas fees, and to put their protocol and smart contracts to work. It is a web application that connects to the Ethereum network. MetaMask and Parity browser extensions were required for the AirSwap sale.</p><h3>The Trade</h3><p>The investor, only known at this point by their Ethereum blockchain address 0xf51ec864d5fb2f184198e369fe063fc77045a3ad, was trying to buy about $508,000 worth of AirSwap tokens or 1,700 ether according to the transaction history. As <a href="https://etherscan.io/tx/0x167b6e3217536e66e69f906a457b2457c6cc4f95928a47b0443ad895b23c6e76">Etherscan</a> explains, although the the trade failed/cancelled, the investor still lost $70,000 (236.9516 Ether) in form of Ethereum gas (transaction fees). The error during the transaction was, “Error encountered during contract execution [Bad instruction]”.</p><p>In a “Cancelled” transaction, the Ether value was not deducted from the sending address. However the Transactions fees (Gas Used x Gas Price) will still be deducted from the sending account (From Address).</p><p>[Bad instruction] warning indicates a logical error during contract execution, if interacting with a TokenSale/ICO Contract, its possible that the:</p><ul><li>ICO has yet to start</li><li>ICO has ended</li><li>ICO has reached its maximum contribution limit</li></ul><p>The date of the transaction is “Oct-11–2017 02:24:23 PM +UTC” (Oct-11–2017 9:24:23 AM Eastern Time) but the ICO end time was approximately 11 October 2017 at 9:10:10 AM Eastern Time. There was also a L(AST) Chance Sale on Oct 11 2017 that started on 10:10:10 AM Eastern Time to 12:12:12 PM Eastern Time.</p><p>In an ugly twist of fate the user’s transaction seemed in between these sale periods which may have resulted in his transactions being cancelled. It appears that the unfortunate participant was targeting the L(AST) Chance Sale, which was an uncapped sale running on the AirSwap token launcher platform. The total amount for the sale was dependent on the number of tokens that weren’t sold in the main sale on October 10th or beta tester sale on October 9th. During the main sale 30M AST were sold to 9,400 individual buyers. The investor was likely targeting some of the remaining tokens but was early to the sale.</p><p>The transaction possibly reverted because the transaction wasn’t yet valid. So while the investor wanted tokens from the contract, the contract wasn’t yet ready to transfer them because there is a hard-lock making them non-transferable until the 17th. On top of that, it also looks like the user may have been trying to transfer too many tokens at once.</p><h3>Technical Analysis</h3><p>The core of this issue resides not in either of the contracts, but instead, in the Ethereum VM (EVM) itself. This <a href="https://www.bloomberg.com/news/articles/2017-10-11/buyer-beware-as-70-000-goes-up-in-smoke-on-broken-ico-trade">bloomberg article</a> alludes to the fact that investors “do forfeit the amount of ether necessary to make the deal possible”. This is technically correct, as this is more commonly known as the gas cost of the execution for the contract within the community. The end-user has two options in most cases when they’re working with a send to a contract, which is the maximum gas that they are willing to spend, as well as the value of each unit of gas, in ETH that is to be spent. It’s very common to raise the value of the gas you’re willing to spend in order to prioritize your transfers.</p><p>In this particular instance, the gas-usage was extremely high. This was because the user had set their gas price to approximately 4000 times the typical amount. Other payments in their block were approximately 0.0000001 ETH per gas, but the user had it set to .0004. There was no bug in the contracts, just the behavior doesn’t work /quite/ as expected due to the way that everything fits and slides together. If the REVERT opcode had acted properly, the contract would have returned back &gt; 90% of the gas, making this still an expensive issue at $7,000 spent for a failed transaction, however it would have saved the user $63,000.</p><h3>Importance of REVERT opcode</h3><p>Now referring to this question on <a href="https://ethereum.stackexchange.com/questions/15166/difference-between-require-and-assert-and-the-difference-between-revert-and-thro/24185#24185">stackexchange</a> in an Ethereum smart contract there are two functions of interest: assert() and require().</p><pre>assert(false) compiles to 0xfe, which <strong>is</strong> an invalid opcode, using up all remaining gas, <strong>and</strong> reverting all changes.</pre><pre>require(false) compiles to (0xfd), which <strong>is</strong> currently invalid, but after Metropolis will become REVERT, meaning it will refund the remaining gas, <strong>and</strong> <strong>return</strong> a value (useful <strong>for</strong> debugging).</pre><p>Prior to the Metropolis fork, the require() and assert() functions actually behave identically, but they already compile to different opcodes when the condition is false. This means that your contracts will behave very differently after Metropolis depending on which one you use.</p><p>If one reads their <a href="https://github.com/airswap/contracts/blob/master/contracts/AirSwapToken.sol">solidity contract</a></p><pre><strong>function</strong> <strong>availableBalance</strong>(address _owner) <strong>constant</strong> <strong>returns</strong>(uint256) {<br>    <strong>if</strong> (balanceLocks[_owner].unlockDate &lt; now) {<br>        <strong>return</strong> balances[_owner];<br>    } <strong>else</strong> {<br>        assert(balances[_owner] &gt;= balanceLocks[_owner].amount);<br>        <strong>return</strong> balances[_owner] - balanceLocks[_owner].amount;<br>    }<br>}</pre><p>One can see that in function availableBalance there is the statement assert(balances[_owner] &gt;= balanceLocks[_owner].amount) which is an invalid opcode and could use up all remaining gas and revert all changes. This is one of the two possible locations that used up all the gas in the user’s transaction.</p><p>As it stands, right now, the Ethereum VM doesn’t formally support the REVERT opcode, only as of 28 days ago did the actual REVERT opcode (0xfd) become placed inside of the EVM source code. This changes with the Metropolis (Byzantium hardfork) release, version 1.7.1, block number 4,370,000 (Nominally Oct. 17). At that time it will become active as part of the hard-fork. Right now, the REVERT opcode throws an exception, which is expected, because it’s not formally supported. Due to this, as the actual functional code that supports REVERT isn’t active yet, it means that the gas, was fully consumed.</p><p>The reason that the consumption was so high, was due to the fact that the gas was transferred via an OPCODE CALL, which is normal in these cases, forwarding along the bulk of the available gas to ensure the sub-function can execute. Internally, this other contract did also use a REVERT code, but as it is not live it simply threw an exception rather than returning the gas. Once the hard fork happens, the REVERT opcode will become live, and that won’t be an issue any longer. So this error goes away in ~1 week. Many contracts reviewed by Hosho and other auditing companies have moved to using the revert() call which does use the upcoming REVERT opcode, to prepare for this, allowing the unused gas to be returned back, and ensuring that these are less costly.</p><h3>How to setup Gas during ICO</h3><p>Ether (ETH) is the fuel for that Ethereum network. when you send tokens, interact with a contract, send ETH, or do anything else on the blockchain, you must pay for that computation. That payment is calculated in Gas and gas is paid in ETH. You are paying for the computation, regardless of whether your transaction succeeds or fails. Even if it fails, the miners must validate and execute your transaction (compute) and therefore you must pay for that computation just like you would pay for a successful transaction. You can see your TX fee (gas limit * gas price) in ETH &amp; USD when you search for your transaction on etherscan.io. The gas limit is called the limit because it’s the maximum units of gas you are willing to spend on a transaction. However, the units of gas necessary for a transaction are already defined by how much code is executed on the blockchain.</p><p>It is very important to understand how gas works in order to make judicious decision while submitting a transaction to a Smart contract. If you are out of gas during a transaction, the transaction will be unable to complete. If you have extra gas during a transaction all unused gas is refunded to you at the end. If you send 1 ETH and use a gas limit of 400,000 you will receive 400,000–21,000* back. However, if you were sending 1 ETH to a contract and your transaction to the contract fails (say, the Token Creation Period is already over), you will use the entire 400,000 and receive nothing back. You can use our tool to calculate GWEI &lt;-&gt; WEI &lt;-&gt; USD here, which can be helpful when you want to know your TX fee in ETH, rather than GWEI. You can do so by lowering the amount you pay per unit of gas. The price you pay for each unit increases or decreases how quickly your transaction will be mined.</p><p>During Token Creation Periods, these costs go crazy due to supply / demand. 50 GWEI is the max gas price most new Token Creation Period contracts will accept. Anything above that and your TX will fail. Check with the Token Creation Period if you wish to invest in, ideally 50 GWEI would be the amount you should send in that case.</p><h3>Finally</h3><p>While there was noting wrong with the smart contract developed by Airswap, the whole 2 Hour window created a favorable condition for token grab between investors, but did cost few investors dearly. Responsible companies should make strides to avoid such a situation occurring during their ICO. Burning $70,000 (236.9516 Ether) as gas is not a small thing and this is something not only the investors but also the ICO team should have taken into consideration. It is time that the whole Ethereum ecosystem as a whole address the issue of exorbitant Gas prices and help make Ethereum transactions more safe and rational.</p><h3>Reference</h3><ul><li><a href="https://www.bloomberg.com/news/articles/2017-10-11/buyer-beware-as-70-000-goes-up-in-smoke-on-broken-ico-trade">https://www.bloomberg.com/news/articles/2017-10-11/buyer-beware-as-70-000-goes-up-in-smoke-on-broken-ico-trade</a></li><li><a href="https://github.com/airswap/contracts/blob/master/contracts/AirSwapToken.sol">https://github.com/airswap/contracts/blob/master/contracts/AirSwapToken.sol</a></li><li><a href="https://myetherwallet.github.io/knowledge-base/gas/what-is-gas-ethereum.html">https://myetherwallet.github.io/knowledge-base/gas/what-is-gas-ethereum.html</a></li><li><a href="https://etherscan.io/tx/0x167b6e3217536e66e69f906a457b2457c6cc4f95928a47b0443ad895b23c6e76">https://etherscan.io/tx/0x167b6e3217536e66e69f906a457b2457c6cc4f95928a47b0443ad895b23c6e76</a></li><li><a href="https://ethereum.stackexchange.com/questions/15166/difference-between-require-and-assert-and-the-difference-between-revert-and-thro/24185#24185">https://ethereum.stackexchange.com/questions/15166/difference-between-require-and-assert-and-the-difference-between-revert-and-thro/24185#24185</a></li><li><a href="https://etherscanio.freshdesk.com/support/solutions/articles/16000062876-my-transaction-had-been-cancelled-error-is-out-of-gas-or-bad-instructions-when-will-the-funds-r">https://etherscanio.freshdesk.com/support/solutions/articles/16000062876-my-transaction-had-been-cancelled-error-is-out-of-gas-or-bad-instructions-when-will-the-funds-r</a></li><li><a href="https://blog.airswap.io/airswap-token-buyers-guide-14916228d516">https://blog.airswap.io/airswap-token-buyers-guide-14916228d516</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=640395317f48" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>