Skip to main content
Mapping keys extraction

Smart Contract Mapping Variable Extractor

Smartmuv

In solidity or Ethereum smart contracts mapping acts like a hash table. It is used for storing data as key-value pairs, in which the key can be any of the built-in data types rather than the reference type, while the value can be any type. In Ethereum, mappings are mostly used for the association of unique addresses with the associated value type.

Mapping data structure plays quite an important role in the smart contract. Today when everyone launches their token currency by using the ERC20 standard, in which the data structure that holds the user balance is the mapping data structure. Not only the token contract but also the other smart contracts use the mapping data structure for holding the user-related data. In many use-cases, smart contact developers or owners need mapping variable data like, they might need to migrate all the balances to another gas optimized version of the smart contract, or they might just want to get some statistics from mapping variable

For getting the hold of your smart contract data for migration, or making decisions, there is a need to look forward to the extraction of mapping variables.

What is the Problem?

Well, mapping is the (key, value) structure in which the value is stored against each key. In solidity, the value is stored against the hash of the key, as a hash is non-reversible so it’s difficult to recover the mapping key unless you get hold of it by using hard-coded source code. But using code to keep track of the mapping keys should be bothersome because you have to write code (specifical loop) for every mapping variable which only increases your code length. Moreover, it is only applicable before the deployment of the smart contract. Then, what about the contracts who have already been deployed?

It simply means that once a mapping is created and deployed there is no way for DApps developers to know what the contents of the mapping are.

SmartMuv

SmartMuv provides the complete list of mapping keys with their values in just a couple of clicks. First, it analyzes your contract and provides you with a list of your mapping variables with telling if it is extractable or not. Then on extracting it provides you the complete list of mapping keys with their associated values. This tool gives quite an easy way to track your important mapping variables and helps developers and DApps owners in many scenarios like migration, upgrade, cost estimation for business decision making.