Crypto Flexs
  • DIRECTORY
  • CRYPTO
    • ETHEREUM
    • BITCOIN
    • ALTCOIN
  • BLOCKCHAIN
  • EXCHANGE
  • TRADING
  • SUBMIT
Crypto Flexs
  • DIRECTORY
  • CRYPTO
    • ETHEREUM
    • BITCOIN
    • ALTCOIN
  • BLOCKCHAIN
  • EXCHANGE
  • TRADING
  • SUBMIT
Crypto Flexs
Home»ETHEREUM NEWS»Solidity storage array bug | Ethereum Foundation Blog
ETHEREUM NEWS

Solidity storage array bug | Ethereum Foundation Blog

By Crypto FlexsFebruary 27, 20244 Mins Read
Facebook Twitter Pinterest LinkedIn Tumblr Email
Solidity storage array bug |  Ethereum Foundation Blog
Share
Facebook Twitter LinkedIn Pinterest Email

Solidity Storage Array Bug Announced

This blog post is about two bugs linked to completely unrelated storage arrays. Both have existed in compilers for a long time and are only now being discovered, even though the contracts containing them are very likely to malfunction in testing.

Daenam Kim get help Nguyen Farmin both curve grid We discovered an issue with signed integer arrays that resulted in incorrect data being stored.

This bug has existed since Solidity 0.4.7, and we consider this the more serious of the two. If these arrays use negative numbers in certain situations, data corruption will occur, making bugs easier to detect.

Through the Ethereum bug bounty program, we have received reports of a flaw in a new experimental ABI encoder (called ABIEncoderV2). The new ABI encoder is still marked as experimental, but since it’s already in use on mainnet, we think it’s worth announcing prominently. Credit to Ming Chuan Lin (of https://www.secondstate.io) Thank you for finding and fixing the bug!

that much 0.5.10 release Contains bug fixes. There are currently no plans to publish fixes for the legacy 0.4.x Solidity series, but we may do so if there is public demand.

Both bugs should be easily visible in tests that cover the relevant code path.

More details about both bugs can be found below.

Signed integer array bug

Who should worry?

When deploying a contract that uses an array of signed integers in a repository and assigning them directly

  • A literal array containing at least one negative value (x = (-1, -2, -3);) or
  • existing array different signed integer type

Doing so may corrupt data on the storage array.

Contracts that only assign individual array elements, e.g. x(2) = -1;) has no effect.

How to tell if a contract is vulnerable

If your storage uses signed integer arrays, try running tests using negative values. As a result, the actual value stored should be positive rather than negative.

If you have a contract that meets these conditions and would like to determine whether it is in fact vulnerable, you can contact us via: security@ethereum.org.

technical details

Storage arrays can be allocated from many different types of arrays. During this copy and assignment operation, a type conversion is performed on each element. In addition to conversions, certain bits of the value must be zeroed to prepare for storing multiple values ​​in the same storage slot, especially if the signed integer type is shorter than 256 bits.

The bit to be zeroed was incorrectly determined from a source other than the target type. This causes too many bits to be set to 0. In particular, the sign bit becomes 0, making the value positive.

ABIEncoderV2 array bug

Who should worry?

If you have deployed contracts that use the experimental ABI Encoder V2, those contracts may be affected. This means that only contracts that use the following directives within their source code can be affected:

pragma experimental ABIEncoderV2;

Additionally, there are several requirements for a bug to occur. See technical details below for more information.

How to tell if a contract is vulnerable

The bug only appears if all of the following conditions are met:

  • Storage data associated with an array or structure is transferred directly to an external function call. abi.encode OR AND to event data without pre-assignment to a local (memory) variable
  • This data includes arrays of structures or statically sized (that is, at least two-dimensional) arrays.

Additionally, your code will not be affected in the following situations:

  • If you just return that data and don’t use that data abi.encodeExternal call or event data.

possible outcome

Naturally, any bug can have very different consequences depending on the program control flow, but this is expected to be more likely to lead to malfunction than exploitability.

The bug occurs when, under certain circumstances, a method call sends corrupted parameters to another contract.

technical details

During the encoding process, the experimental ABI encoder does not properly advance to the next element in the array if the element occupies more than a single slot in the storage.

This is only true for elements that are structures or statically sized arrays. Dynamically sized arrays or arrays of primitive data types are not affected.

The specific effect you will see is that the data is “moved” around the encoded array. Unit(2)() And it contains data.
((1, 2), (3, 4), (5, 6))it is encoded as follows: ((1, 2), (2, 3), (3, 4)) This is because the encoder only advances a single slot between elements rather than two.

This post was co-written by @axic, @chriseth, and @holiman.

Share. Facebook Twitter Pinterest LinkedIn Tumblr Email

Related Posts

Enterprise Ethereum finally has a privacy playbook.

June 7, 2026

Clear Signatures: Making Transaction Approvals More Secure on Ethereum

June 3, 2026

‘He’s full of shit’: JP Morgan’s Jamie Dimon takes aim at Coinbase CEO over clarity laws

May 30, 2026
Add A Comment

Comments are closed.

Recent Posts

Chris Jericho To Join And Co-Create Official Community Traits For Kokopi Koalas™ NFT Collection

June 9, 2026

Bancor reduced its stable fee to 0.001%. Can BNT bounce back?

June 9, 2026

Neura Closes Strategic Funding Round And Partnerships To Build Emotional AI With Persistent, User-Owned Memory

June 9, 2026

Phemex Kicks Off $7 Million Ultimate Championship, Bringing Trading Competition To Football Season

June 9, 2026

MEXC Prediction Markets Launches Combo To Enable Multi-Event Combination Trading

June 9, 2026

ZIGChain expands on-chain access by integrating Ondo tokenized stocks and ETFs.

June 8, 2026

Bitmine Immersion Technologies (BMNR) Announces ETH Holdings Reach 5.54 Million Tokens, And Total Crypto And Total Cash Holdings Of $9.6 Billion

June 8, 2026

MapleStory Universe Opens MSU Space And Launches Global Game Jam Competition As Part Of MSU 2.0 Expansion

June 8, 2026

Why is UK Financial Ltd’s trillion-dollar ERC-3643 conversion attracting major platforms?

June 7, 2026

Bybit Launches IPO Express, Becoming One Of First Centralized Crypto Exchanges To Offer Tokenized IPO Access, Starting With SpaceX

June 7, 2026

Enterprise Ethereum finally has a privacy playbook.

June 7, 2026

Crypto Flexs is a Professional Cryptocurrency News Platform. Here we will provide you only interesting content, which you will like very much. We’re dedicated to providing you the best of Cryptocurrency. We hope you enjoy our Cryptocurrency News as much as we enjoy offering them to you.

Contact Us : Partner(@)Cryptoflexs.com

Top Insights

Chris Jericho To Join And Co-Create Official Community Traits For Kokopi Koalas™ NFT Collection

June 9, 2026

Bancor reduced its stable fee to 0.001%. Can BNT bounce back?

June 9, 2026

Neura Closes Strategic Funding Round And Partnerships To Build Emotional AI With Persistent, User-Owned Memory

June 9, 2026
Most Popular

MetDesk and NVIDIA Earth-2 Revolutionize Energy Trading with AI-Based Weather Forecasting

July 30, 2024

Barcelona welcomes COREWEAVE’s AI cloud platform with the launch of a new data center.

May 13, 2025

Gala Games Hosts Live Town Hall on Mirandus Development

June 27, 2024
  • Home
  • About Us
  • Contact Us
  • Disclaimer
  • Privacy Policy
  • Terms and Conditions
© 2026 Crypto Flexs

Type above and press Enter to search. Press Esc to cancel.