We want to run some analytics off chain.

What’s the best way to get the full data of a public mapping? Need to get all addresses and their balances.

Here is an example, https://github.com/pancakeswap/pancake-farm/blob/master/contracts/MasterChef.sol#L78, we want to be able to get all the values stored for the variable.

1 Answer 1


You can make a bot that is connected to the Ethereum blockchan (hosting your own node or using service like infura.io).

Then you need the smart contract address you want to look out, and his ABI.

Then you can load this address+ABI on web3js (or other library, ethereumJS) and then ask in loop what are data for each mapping.

If you want to be efficient, you need to copy/paste this data into a database (MySQL or MongoDB) then listen to event so your database will allways be up to date and to query / operations like a regular database.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.