Skip to content

Commit

Permalink
chore: added comment regarding freeing memberships
Browse files Browse the repository at this point in the history
  • Loading branch information
richard-ramos committed Aug 27, 2024
1 parent c2221c3 commit d047296
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion contracts/Membership.sol
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ contract Membership {
tail = nextID;
}

function extendMembership(address _sender, uint256[] memory membershipMapIdx) public {
function extendMembership(address _sender, uint256[] calldata membershipMapIdx) public {
for (uint256 i = 0; i < membershipMapIdx.length; i++) {
uint256 idx = membershipMapIdx[i];

Expand Down Expand Up @@ -223,6 +223,16 @@ contract Membership {
return _isGracePeriod(expirationDate);
}

function freeExpiredMemberships(uint256[] calldata expiredMemberships) public {
// TODO: user can pass a list of expired memberships and free them
// Might be useful because then offchain the user can determine which
// expired memberships slots are available, and proceed to free them.
// This might be cheaper than the `while` loop used when registering
// memberships, although easily solved by having a function that receives
// the list of memberships to free, and the information for the new
// membership to register
}

function withdraw() public {}

// TODO - keep track of balances, use msg.sender
Expand Down

0 comments on commit d047296

Please sign in to comment.