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

  • BTC Surpasses $82,000

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

  • ETH Surpasses $2400

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

  • BTC Surpasses $81,000

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

  • BTC Falls Below $80,000

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

  • Philadelphia Semiconductor Index Set to Lose Over $2 Trillion in Market Value in Seven Trading Days

    The Philadelphia Semiconductor Index is poised to evaporate over $2 trillion in market value within seven trading days.

  • Philadelphia Semiconductor Index Drops 4% to Lowest Level in Nearly a Month

    The Philadelphia Semiconductor Index fell by 4.01% during the day, currently reported at 11,215.37 points. Nvidia dropped by 3.25%, Broadcom fell by 2.87%, Micron decreased by 5.79%, Intel declined by 5.81%, AMD dropped by 6.28%, Qualcomm rose by 0.66%, TSMC fell by 4.37%, and ASML decreased by 3.34%.

  • Philadelphia Semiconductor Index Falls 4% to Lowest Level in Nearly a Month

    The Philadelphia Semiconductor Index dropped 4.01% during the day, currently reported at 11,215.37 points. Nvidia fell by 3.25%, Broadcom by 2.87%, Micron by 5.79%, Intel by 5.81%, AMD by 6.28%, Qualcomm rose by 0.66%, TSMC fell by 4.37%, and ASML dropped by 3.34%.

  • Ripple Prime Launches Perpetual Contract Trading Services for Institutional Clients

    According to Bloomberg, Ripple's main brokerage division, Ripple Prime, is launching perpetual contracts for real-world assets (RWA) aimed at institutional clients, covering over 100 reference markets including stocks, indices, ETFs, and commodities. This product is offered through Trade.xyz on Hyperliquid, continuing Ripple Prime's previous initiative to provide clients with access to cryptocurrency perpetual contract trading.

  • NYC Comptroller Urges Anthropic to Pause IPO Plans

    On October 15, New York City Comptroller Mark Levine stated in an interview that he has written to Anthropic CEO Dario Amodei, urging the company to suspend its planned initial public offering (IPO). In the letter, he called for Anthropic to pause its IPO plans until it can fully and transparently address concerns related to AI safety, governance, and development that the company itself has raised. Levine wrote that the company should focus on mitigating these risks rather than advancing the IPO. Currently, New York City has an investment exposure of less than $10 million in Anthropic through the private market.

  • US September PPI Rises 6.3% Year-on-Year, Exceeding Market Expectations

    The US Producer Price Index (PPI) for September recorded a year-on-year increase of 6.3%, the highest since May 2026, surpassing market expectations of 5.3%. The month-on-month PPI for September was reported at 1.3%, significantly higher than the market forecast of 0.5%. Additionally, US retail sales for September showed a month-on-month increase of 0.8%, also exceeding market expectations.