Cointime

Download App
iOS & Android

zkSync Announces Improved Legacy Solidity Function Support Following Gemholic's $1.7M Stuck

Cointime Official

April 9 (Cointime) - zkSync, a Layer 2 scaling solution for Ethereum, has announced an update on their support for legacy Solidity functions in the zkSync Era, after the Gemholic case. GemSwap, the decentralized exchange operated by Gemholic, lost temporary access to 921 ETH (approximately $1.7 million) raised in a token sale due to a bug in their smart contract.

GemSwap is the fifth-largest DeFi protocol on zkSync Era, with a total value locked (TVL) of $3.7 million, according to DeFi Llama. The project accounts for 5.6% of Era's combined TVL.

In response to this incident and other challenges, zkSync has shared that .transfer() and .send() functions will now work exactly as they do in the Ethereum Virtual Machine (EVM), with no need for a reorg or regenesis. The solution involves a normal protocol upgrade aimed at addressing the issues users have been experiencing with calls that have a value greater than zero.

Read full thread:

First of all, and most importantly, the solution does not involve any kind of reorg or regenesis. It will be a normal protocol upgrade.

Buckle up: the rest of this thread will be highly technical.

On zkSync Era, calls with value>0 go through the MsgValueSimulator system contract, consuming some gas (more than the 2300 stipend for the transfer function on L1). This is why calling transfer without providing gas fails on the zkEVM.

The change: calls to the MsgValueSimulator, which had no minimum gas requirements, will now require at least 2*64*pubdata_bytes + K ergs. The pubdata is needed to transfer value, and K will be chosen high enough to process the transfer.

At the end of the MsgValueSimulator, it will be ensured that at least 2*64*pubdata_bytes + K' was spent to process the transfer (if fewer ergs were spent, the refund will go to the caller). K - K' will be zkSync Era stipend.

To protect from reentrancy we'll make sure that storage write costs are at least K - K' ergs. This approach is very much aligned with Ethereum: charge users more when value > 0 with some stipend granted.

Effectively, this means that the stipend will enable one and only one storage update, and nothing else (exactly as in EVM).

The change might slightly impact the estimate of the tx costs and the actual tx cost after refund. However, the gap between estimation and actual fee will be drastically reduced in the future.

This new behavior will take some time to implement, and will be deployed after diligent testing, auditing, and community review with the next protocol upgrade. We’ll do our best to expedite this process.

If you want to learn more, we will be happy to welcome you in our Discord developer community and answer all the questions: https://join.zksync.dev

Comments

All Comments

Recommended for you

  • FTC Requests Documents from Anthropic and OpenAI

    On October 15, according to Axios: The U.S. Federal Trade Commission (FTC) has requested documents related to the incident from Anthropic and OpenAI. The FTC issued a civil subpoena to the AI companies on Wednesday.

  • Cook: Apple AI Approved in China, Testing Version Launching Late October

    On October 15, Apple CEO Tim Cook revealed in an interview in Shanghai that Apple AI has been approved in China. A testing version will be launched later in October, featuring initial functions such as real-time translation, writing assistance, and image removal, while Siri AI will not be included.

  • UBS: Fed Expected to Raise Rates for the Third Time in March 2027

    On October 15, UBS stated that it expects the Federal Reserve to implement its third rate hike in March 2027, revising its previous forecast that the rate hike cycle would conclude in December.

  • BTC Surpasses $81,000

    Market data shows that BTC has surpassed $81,000, currently priced at $81,002, with a 24-hour decline of 2.94%. The market is experiencing significant volatility, so please ensure proper risk management.

  • US Spot Bitcoin ETF Sees $261.4 Million Net Outflow Yesterday

    On October 15, according to monitoring data from Farside Investors, the US spot Bitcoin ETF experienced a net outflow of $261.4 million yesterday.

  • Over $476 Million Liquidated in the Last Hour, Primarily Long Positions

    Data shows that in the past hour, a total of $476 million was liquidated across the network, with long positions accounting for $457 million and short positions for $19.7945 million, primarily affecting long positions. Among these, $200 million in ETH and $116 million in BTC were liquidated.

  • ETH Falls Below $2400

    Market data shows that ETH has fallen below $2400, currently priced at $2395.62, with a 24-hour decline of 4.47%. The market is experiencing significant volatility, so please ensure proper risk management.

  • BTC Drops Below $81,000

    Market data shows that BTC has fallen below $81,000, currently priced at $80,989.9, with a 24-hour decline of 2.87%. The market is experiencing significant volatility, so please ensure proper risk management.

  • US Considers Easing Sanctions on Shadow Fleet to Lower Shipping Rates

    On October 15, a US official stated on Wednesday that the Trump administration is considering easing sanctions on vessels known as the 'shadow fleet.' These ships have previously transported oil and petroleum products from countries such as Russia, Iran, and Venezuela. This move aims to reduce the currently historically high global shipping rates. Shortly before this, President Trump had temporarily lifted sanctions on Russian diesel, a decision that drew strong criticism from Ukrainian President Zelensky, several European governments, and some Republican senators. The US official revealed that current discussions focus on whether the US will allow previously sanctioned vessels to transport 'legitimate oil.' Here, 'legitimate oil' refers to crude oil or petroleum products not subject to US sanctions, rather than oil from Russia and Iran that is under sanctions. The official stated that this move aims to facilitate the export of more refined products and crude oil from the Gulf region.

  • Dollar Index Erases All Gains Since CPI Report Release

    On October 15, the Dollar Index (DXY) slowly declined in the Asian session, completely erasing all gains since the release of the U.S. September CPI data yesterday (which had peaked with a cumulative increase of about 70 points), now reported at 102.16. The British Pound against the U.S. Dollar (GBP/USD) and the Euro against the U.S. Dollar (EUR/USD) both rose about 0.3%, currently reported at 1.3231 and 1.1197, respectively. (Jin10)