QuadrigaCX Contract Error
Notice: This page is a freshly imported case study from the original repository. The original content was in a different format, and may not have relevant information for all sections. Please help restructure the content by moving information from the 'About' section to other sections, and add any missing information or sources you can find. If you are new here, please read General Tutorial on Wikis or Anatomy of a Case Study for help getting started.
It’s easy to forget the level of trust that Quadriga had in the market. The top upvoted comment reads “thank you for the statement and transparency and sharing all details”. Given failures and many hacking incidents, smart contracts should in general not be relied upon, and an exchange should always have redundancy and auditing checks built in for every single system. While some issues may be seen as inevitable, having an issue persist for 3 days without being noticed is troubling. While there are many steps which could have been taken to prevent or notice the issue sooner, and this incident did contribute to the depletion of reserves, it’s not the reason anyone ultimately lost their funds. This type of failure is very challenging to regulate, already in the best interest of the exchange to avoid, and rare compared to other types of failures which can occur. The exchange needs to transparently cover this shortfall, with the assistance of any hot wallet insurance.
This exchange or platform is based in Canada, or the incident targeted people primarily in Canada.
About QuadrigaCX
This exchange or platform is based in Canada, or the incident targeted people primarily in Canada.
The background of the exchange platform, service, or individuals involved, as it would have been seen or understood at the time of the events.
Include:
- Known history of when and how the service was started.
- What problems does the company or service claim to solve?
- What marketing materials were used by the firm or business?
- Audits performed, and excerpts that may have been included.
- Business registration documents shown (fake or legitimate).
- How were people recruited to participate?
- Public warnings and announcements prior to the event.
Don't Include:
- Any wording which directly states or implies that the business is/was illegitimate, or that a vulnerability existed.
- Anything that wasn't reasonably knowable at the time of the event.
There could be more than one section here. If the same platform is involved with multiple incidents, then it can be linked to a main article page.
Early Interview With Gerald Cotten
An early interview with Gerald Cotten published by The Georgia Straight[1].
How would you explain, very briefly, Bitcoin to a newbie?
To a newbie, I would describe it as a decentralized, peer-to-peer payment system. It basically allows you to send payments from one user to another without the need of a central authority, such as a bank.
What’s the easiest way to get bitcoins in Vancouver?
The easiest way to get bitcoins in Vancouver is, in my opinion, our ATM, because you just walk up to it, scan your QR code, and within five seconds you’ll have the bitcoins in your Bitcoin wallet.
What sets your online currency exchange apart from the others in Canada?
There’s a few other Bitcoin exchanges in Canada. What mainly sets ours apart is the fact that we charge no fees right now. It’s a promotional thing. In addition to that, we have more account funding options and withdrawal options than any exchange in the country.
One of our main features is Interac Online. It allows any user to fund their account instantly. So, you can actually, from the comfort of your own home, fund your Quadriga CX account through your online banking with Interac Online and buy bitcoins instantly. It’s the fastest way to get bitcoins in Canada.
What are your plans for your Bitcoin ATMs in Vancouver?
The plan with the ATMs is they’re going to be hooked up to our exchange. So, if someone makes a purchase from our ATM, it makes an equivalent trade on our exchange, which basically refills the ATM instantly. Our plan is to spread our ATMs around Vancouver and not just Vancouver—around the country. Because in addition to those three that are coming in about a week, we have an additional large order with Lamassu, where we’ll be spreading the ATMs basically across Canada. We want to spread Bitcoin across the country and basically make buying bitcoins easier for the average Canadian.
The federal government mentioned Bitcoin in its budget this week. How would you like to see cryptocurrencies regulated in Canada?
At this point, I’d like to see a little more clarity from our governmental institutions. Right now, if you contact FINTRAC [Financial Transactions and Reports Analysis Centre of Canada] and ask them about Bitcoin, they’ll basically tell you that Bitcoin is not currently regulated by the government and that they’re unable to provide you with any additional information.
From an exchange point of view, this is quite frustrating, because you’re trying to figure out what the regulations are. We’re quite proactive when it comes to regulations. We don’t want to break the law. We want to fully comply, and we actually more than comply with what the current laws are. So, a bit more clarification from FINTRAC and from the federal government would be very useful—just in terms of planning our business for the future.
What other cryptocurrencies aside from Bitcoin have your attention?
Litecoin is interesting—just because it seems to be pretty much the second largest cryptocurrency.
In addition to that, Dogecoin has been getting a lot of media attention. So, we’re actually adding Dogecoin to our website within the coming weeks. It seems to have a huge amount of community support. It’s very popular on Reddit, and because of that reason it’s caught my attention.
The Reality
This sections is included if a case involved deception or information that was unknown at the time. Examples include:
- When the service was actually started (if different than the "official story").
- Who actually ran a service and their own personal history.
- How the service was structured behind the scenes. (For example, there was no "trading bot".)
- Details of what audits reported and how vulnerabilities were missed during auditing.
The issue with the smart contract was described in the statement which was released by QuadrigaCX[2].
In order to call a function in an Ethereum contract, we need to work out its signature. For that we take the HEX form of the function name and feed it to Web3 SHA3. The Web3 SHA3 implementation requires the Hex value to be prefixed with 0x - optional until Geth 1.5.6.
Our code didn't prefix the Hex string with 0x and when we upgraded Geth from 1.5.3 to 1.5.9 on the 24th of May, the SHA3 function call failed and our sweeper process then called the contract with an invalid data payload resulting in the ETH becoming trapped.
As far as recoverability is concerned, EIP 156 (https://github.com/ethereum/EIPs/issues/156) could be amended to cover the situation where a contract holds funds and has no ability to move them.
What Happened
A large quantity of Ethereum was locked in the QuadrigaCX smart contract.
| Date | Event | Description |
|---|---|---|
| November 2013 | QuadrigaCX Founded | The company is founded[3]. The exchange first starts with conducting local trades of cash for bitcoin[1] |
| December 2013 | Exchange Launches | The Quadriga coin exchange itself launches[3][4] with a staff of just 5[1]. |
| January 30th, 2014 | QuadrigaCX Launches Vancouver Bitcoin ATM | QuadrigaCX launches a bitcoin ATM in Vancouver, which is only Vancouver's second bitcoin ATM, which is a Lamassu Bitcoin Machine that cost $5,000[1]. The exchange leaves "beta"[1]. |
| February 14th, 2014 10:10:00 AM MST | The Georgia Straight Article | The Georgia Straight (Vancouver Free Press) publishes an interview with Gerald Cotten. The article highlights the recent bitcoin ATM launched. It states the company is expecting to receive 3 more ATMs "in a week or so". It provides an address of 332 Water Street in Gastown for the exchange headquarters, and indicates that Gerald Cotten will be at an art and trade show on Saturday and a currency and commodity exchange which is part of an event called CoinFest[1]. |
| February 15th, 2014 4:00:00 PM MST | Gerald Cotten At CoinFest | Gerald Cotten is attending the CoinFest in Vancouver, first an art and trade show at the Vancouver English Centre, followed by the currency and commodity exchange at the Doolin's Irish Pub[1][5]. |
| March 14th, 2015 5:05:37 PM MDT | Quadriga Fintech Solutions Website Live | The first capture is taken of the Quadriga Fintech Solutions website, which provides a glimpse of the corporate entity public face. It provides details on the trading platform, merchant services, and remittance solutions they offer as "the leader in cryptocurrency solutions"[6]. |
| March 2015 | Move To Go Public | The parent company Quadriga Fintech looks at taking QuadrigaCX public, but nothing materializes[3]. |
| March 15th, 2015 7:59:33 PM MDT | Quadriga Fintech Solutions Corporate Profile | A capture of the corporate profile of Quadriga Fintech Solutions. It highlights the online trading platform, the "first bitcoin exchange in Canada to be licensed by FinTRAC". According to this description, the exchange also supported "gold bullion", Quadriga is offering merchant payment processing systems for businesses to accept bitcoin, and they are in negotiations with two online casinos to become their "sole bitcoin processing merchant platform". Finally, Quadriga utilizes "the technologyy of the bitcoin blockchain" to provide a remittance service for Mexico and the Carribbean[4]. |
| February 29th, 2016 | Director Resignations | Anthony Milewski and Lovie Horner resign[3]. [7](TBD follow links.) |
| March 8th, 2016 | BCSC Cease Trade Order | The British Columbia Securities Commission issues a cease trade order, since no audited financial statements were recieved[3]. |
| March 18th, 2016 | More Resignations | Director Bill Filtness and CFO Natasha Tsai both resign. This leaves Gerald Cotten as the sole executive[3]. |
| May 30th, 2017 3:15:18 AM MDT | Failed Deposit Transaction Example | An example transaction occurs which attempts to deposit 4.382119011569663172 ETH, which gets stuck in the smart contract[8]. |
| June 2nd, 2017 1:16:32 AM MDT | Community Asking About Loss | A thread is posted to Reddit reporting that user ethereum deposits are being "sent to an address that's unrecoverable"[9]. (TBD expand further.) |
| June 2nd, 2017 5:36:48 AM MDT | Details Posted on Reddit | The QuadrigaCX platform posts details about the incident to Reddit[2]. (TBD expand with details.) |
| June 2nd, 2017 6:20:35 AM MDT | Post Praising Transparency | A response to the incident praises QuadrigaCX for their high level of transparency and explains the technical details of what happened[10]. |
| June 2nd, 2017 12:00:01 PM MDT | CoinDesk Article | CoinDesk publishes an article on the incident[11]. (TBD expand with details.) |
| June 2nd, 2017 | Date In Timelines | The date is widely reported as June 2nd, 2017[12][13]. |
| February 6th, 2019 | Verdict Timeline | The smart contract loss is referenced in a timeline published by Verdict[14]. (TBD add more timeline information.) |
| February 22nd, 2019 | CoinRivet Article | The contract incident is referenced in a CoinRivet article on CoinBase CEO Brian Armstrong's reactions to the collapse of the QuadrigaCX coin exchange[15]. |
Technical Details
Total Amount Lost
The Crypto Theft Timeline reports the total loss as 60000 "Crypto", which likely indicates 60,000 ethereum[12]. The BitcoinExchangeGuide also lists the amount of the loss as 60,000 ethereum[13].
The total amount lost has been estimated at $14,700,000 USD.
How much was lost and how was it calculated? If there are conflicting reports, which are accurate and where does the discrepancy lie?
Immediate Reactions
Community Reactions Prior To Announcement
Multiple posts on Reddit reference an issue with Ethereum deposits into the QuadrigaCX coin exchange[9].
All over the ETH reddit says you guys screwed up your SafeConditionalHFTransfer without a function and users keep deposit ETH which is sent to an address that's unrecoverable.
For example https://etherscan.io/tx/0x7e86b05eac756b1062e7420bcefe581a2e906197a8fc87832e7783905b2d88cf
client deposit to 0xf8cf56df660b655cb913931ddb10fbd25ec5df82 and the exchange redirects to 0x027BEEFcBaD782faF69FAD12DeE97Ed894c68549 but due to an error in their code they did not call the right function and the 4 ether is trapped in the contract
there are many such tx in the last few days from many addresses but with this same error
QuadrigaCX Posts Reddit Announcement
Ultimately, QuadrigaCX posted a detailed announcement about the situation to Reddit[2].
Earlier this week, we noticed an irregularity with regards to the sweeping process of incoming Ether to the exchange. The usual process involved sweeping the ether into a ETH/ETC splitter contract, before forwarding the ether to our hot wallet. Due to an issue when we upgraded from Geth 1.5.3 to 1.5.9, this contract failed to execute the hot wallet transfer for a few days in May. As a result, a significant sum of Ether has effectively been trapped in the splitter contract. The issue that caused this situation has since been resolved.
While this issue poses a setback to QuadrigaCX, and has unfortunately eaten into our profits substantially, it will have no impact on account funding or withdrawals and will have no impact on the day to day operation of the exchange.
All withdrawals, including Ether, are being processed as per usual and client balances are unaffected.
"Earlier this week, we noticed an irregularity with regards to the sweeping process of incoming Ether to the exchange. The usual process involved sweeping the ether into a ETH/ETC splitter contract, before forwarding the ether to our hot wallet. Due to an issue when we upgraded from Geth 1.5.3 to 1.5.9, this contract failed to execute the hot wallet transfer for a few days in May. As a result, a significant sum of Ether has effectively been trapped in the splitter contract. The issue that caused this situation has since been resolved." “In order to call a function in an Ethereum contract, we need to work out its signature. For that we take the HEX form of the function name and feed it to Web3 SHA3. The Web3 SHA3 implementation requires the Hex value to be prefixed with 0x - optional until Geth 1.5.6. Our code didn't prefix the Hex string with 0x and when we upgraded Geth from 1.5.3 to 1.5.9 on the 24th of May, the SHA3 function call failed and our sweeper process then called the contract with an invalid data payload resulting in the ETH becoming trapped.” “While this issue poses a setback to QuadrigaCX, and has unfortunately eaten into our profits substantially, it will have no impact on account funding or withdrawals and will have no impact on the day to day operation of the exchange. All withdrawals, including Ether, are being processed as per usual and client balances are unaffected.” “Data from EtherScan shows that the contract in question currently holds 67,317.25 ETH – an amount worth roughly $14.7m at current ether prices.”
Community Reactions Following Announcement
The Reddit community was largely supportive of the situation and the level of transparency provided was praised[10][16].
thank you for the statement and transparency and sharing all details.
I really hope you guys recover from this. Hopefully maybe ETH will go back to $50ETH/USD and you'll be able to buy back all the trapped ETH.
Ultimate Outcome
The smart contract incident did not cause any noted losses at the time, however it did reduce the amount of Ethereum on the QuadrigaCX balance sheet, and could be argued to contribute towards the ultimate collapse of the platform in 2019.
What was the end result? Was any investigation done? Were any individuals prosecuted? Was there a lawsuit? Was any tracing done?
Total Amount Recovered
According to BitcoinExchangeGuide, "QuadrigaCX resolved the issue, and customers were not penalized"[13].
There do not appear to have been any funds recovered in this case.
What funds were recovered? What funds were reimbursed for those affected users?
Ongoing Developments
What parts of this case are still remaining to be concluded?
Prevention Policies
Coming soon.
References
- ↑ 1.0 1.1 1.2 1.3 1.4 1.5 1.6 Geek Speak: Gerald Cotten, CEO of Quadriga CX - The Georgia Straight (Apr 27, 2023)
- ↑ 2.0 2.1 2.2 Statement on QuadrigaCX Ether contract error : ethereum (Mar 6, 2020)
- ↑ 3.0 3.1 3.2 3.3 3.4 3.5 QuadrigaCX timeline: Every twist and turn in the bizarre crypto scandal (Mar 7, 2020)
- ↑ 4.0 4.1 Quadriga Fintech Solutions Corporate Profile Archive - March 15th, 2015 7:59:33 PM MDT (Apr 28, 2023)
- ↑ CoinFest 2014 to celebrate Bitcoin in Vancouver - The Georgia Straight (Apr 27, 2023)
- ↑ Quadriga Fintech Solutions Website - Archive March 14th, 2015 5:05:37 PM MDT (Apr 28, 2023)
- ↑ Quadriga Announces Resignation of Directors - SEDAR Filing (Apr 28, 2023)
- ↑ Example of Failing Deposit Transaction - Etherscan (Apr 5, 2023)
- ↑ 9.0 9.1 "QuadrigaCX, did you just lose $17 million CAD?" - BitcoinCA - Reddit (Mar 6, 2020)
- ↑ 10.0 10.1 MyCrypto Taylor - "First thank you for the statement and transparency and sharing all details." - Reddit (Apr 5, 2023)
- ↑ Ethereum Client Update Issue Costs Cryptocurrency Exchange $14 Million - CoinDesk (Mar 6, 2020)
- ↑ 12.0 12.1 100 Crypto Thefts: A Timeline of Hacks, Glitches, Exit Scams, and other Lost Cryptocurrency Incidents (Jan 25, 2020)
- ↑ 13.0 13.1 13.2 Bitcoin Scams and Cryptocurrency Hacks List - BitcoinExchangeGuide.com (Mar 5, 2020)
- ↑ QuadrigaCX timeline: Every twist and turn in the bizarre crypto scandal - Verdict (Mar 6, 2020)
- ↑ Brian Armstrong believes the QuadrigaCX fiasco may have been an accidental exit scam - Coin Rivet (Mar 6, 2020)
- ↑ Sebastian Livermore - "I really hope you guys recover from this. Hopefully maybe ETH will go back to $50ETH/USD and you'll be able to buy back all the trapped ETH." - Reddit (Apr 5, 2023)
Cite error: <ref> tag with name "messari-81" defined in <references> is not used in prior text.