Solidity REPL
Types & storage

Named nested mapping

Use named mapping keys and values in a nested allowance table.

Solidity 0.8.18REPL 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 named nested mapping so its input, result, and state changes stay easy to compare.

Solidity to run

mapping(address owner => mapping(address spender => uint256 amount)) public allowance
address spender = address(0xBEEF)
allowance[msg.sender][spender] = 50
allowance[msg.sender][spender]

Official Solidity reference

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

Mapping types

What to expect

The named owner and spender keys resolve to the nested allowance value 50.

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