CRYPTO NEWS

Why Solidity Compiler Allows declaring storage variables inside functions?

Solidity does not cause any compile errors for this code although the storage variable data is declared with no reference to actually storage (initially)

contract Test { struct Data {     uint256 first;     uint256 second; } address public someAddress = 0x04068DA6C83AFCFA0e13ba15A6696662335D5B75; mapping(address => Data) public datas;  constructor() {}  function test(address[] memory users) external view {     Data storage data;     for (uint256 i = 0; i < users.length; i++) {         if (users[i] == someAddress) {             data = datas[someAddress];             break;         }     } } 

}

Can such declaration cause any problems?

KazPuh

#KazPuh #TheSupremeTeam Artist Name: KazPuh Who are you? Versatile depending on the beat. Just a simple rhythm switch could change the entire cadence and I try to be unique with every song. Where are you from? I'm from Deltona, Florida. Most people around make music but barely anyone can do more than just rap. How::Listen

#KazPuh #TheSupremeTeam
Artist Name: KazPuh

Who are you?

Versatile depending on the beat. Just a simple rhythm switch could change the entire cadence and I try to be unique with every song.

Where are you from?

I'm from Deltona, Florida.
Most people around make music but barely anyone can do more than just rap.

How can we follow you?

Nearly all platforms. Too many to name.

Song Title: Ame Damné

Listen to KazPuh:

Source: https://supremepr.us/

Why Solidity Compiler Allows declaring storage variables inside functions?

Shopping cart
There are no products in the cart!
Continue shopping
0