You now want a second number per member: how many times they deposited.
The tempting move is a second mapping. Two mappings that must always be written together is a bug waiting to happen, because one day only one of them gets updated.
Declare a record instead:
struct Member {
uint256 amount;
uint256 deposits;
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;
contract Registry {
mapping(address => uint256) public amounts;
function join(uint256 amount) external {
amounts[msg.sender] += amount;
}
function amountOf(address who) external view returns (uint256) {
return amounts[who];
}
function depositsOf(address who) external view returns (uint256) {
return 0;
}
}