Posts

Showing posts from July, 2023

Examples of Nested Mapping in Solidity

Image
Nested Mapping   1.  Manage Ownership Information of Housing Society Description : The " NestedMapping " smart contract is a Solidity example that demonstrates the use of nested mappings to manage ownership information of houses within a housing society. The contract allows users to record the ownership details of different apartments within the society, associating each apartment number with the name of its respective owner. The main components of the contract are as follows: 1. Nested Mappings:    - " OwnerName " is a nested mapping that uses the address of the housing society as the first key and the uint256 representing apartment numbers as the second key. The mapping stores the name of the owner associated with each apartment number. The structure can be visualized as `mapping (address => mapping (uint256 => string)) public OwnerName`. 2. Dynamic Array:    - " Society " is a dynamic array that stores the list of apartment numbers (uint256) withi...