Solidity REPL
Types & storage

Local storage reference

Modify a state array through a local storage reference.

Solidity 0.8.36REPL mode

Why use this example

Use this pattern to explore how Solidity represents typed values and how state-changing expressions affect storage. The entry isolates local storage reference so its input, result, and state changes stay easy to compare.

Solidity to run

uint256[] public storedValues
storedValues.push(7)
uint256[] storage selected = storedValues
selected[0] = 42

storedValues[0]

Official Solidity reference

Compare this focused investigation with the complete language definition in the Solidity documentation.

Storage references

What to expect

Writing through the local storage reference changes the original state array value to 42.

Continue the investigation

Change a value, add another expression, or open Inspect after the run. Accepted entries remain available to the next entry, and the clean replay keeps the complete result reproducible.

Read about state and storage Reproducible investigation