📅  最后修改于: 2022-03-11 15:03:36.637000             🧑  作者: Mango
// example mapping:
mapping(address => uint256) investments;
// you have to have an list storing the addresses in order to iterate over the mapping
address [] investers;
// function to reset all values in the mapping to {value}
function resetBalance(uint256 value)public {
// iterate over the array to iterate over the mapping and reset all to value
for (uint i=0; i< investers.length ; i++) {
investments[investers[i]] = value;
}
}