Is there any structure like EnumerableMap.UintToAddressMap in reverse way, i.e. address -> uint256
? I want a mapping to store addresses and each address maps into a uint value. I also need to calculate the sum of those uint values for all addresses.
The use case is that I had quite a few beneficiaries in a sale that they split the revenue in different percentages. I had to make sure that the percentage of the sum of those addresses to be 100% and able to retrieve the percentage holding for each of the address in the mapping.
Would be great if this can be added in the future. Thank you~
Environment
βββ @openzeppelin/contracts-upgradeable@3.3.0
βββ @openzeppelin/truffle-upgrades@1.5.0
Details
Code to reproduce