思路:为需要遍历的 mapping 再准备一个 list,之后通过 for 循环遍历 list 取得 mapping 的 key。
mapping (address => uint) usersValue
mapping (uint => address) list
uint length = xx
for (uint i; i < length; i++) {
usersValue[ list[i] ]
}
Ref:https://ethereum.stackexchange.com/questions/10915/could-mapping-data-structure-return-the-number-of-items-it-points
Link:https://www.cnblogs.com/farwish/p/12364291.html