Skip to content

Commit 70c00e4

Browse files
committed
docs: improve code comments in IssuanceAllocator
- Add clarity to availablePPM calculation explaining it comprises default allocation's allocator-minting PPM, target's allocator-minting PPM, and target's self-minting PPM to maintain 100% allocation invariant - Refine reentrancy comment to explicitly reference that calculations occur after notifications to prevent reentrancy issues Addresses PR feedback from code review
1 parent 13a77e4 commit 70c00e4

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

packages/issuance/contracts/allocate/IssuanceAllocator.sol

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -567,8 +567,12 @@ contract IssuanceAllocator is
567567
AllocationTarget storage targetData = $.allocationTargets[target];
568568
AllocationTarget storage defaultTarget = $.allocationTargets[$.targetAddresses[0]];
569569

570-
// Calculation is done here after notifications to prevent reentrancy issues
570+
// Calculations occur after notifications in the caller to prevent reentrancy issues
571571

572+
// availablePPM comprises the default allocation's current allocator-minting PPM,
573+
// the target's current allocator-minting PPM, and the target's current self-minting PPM.
574+
// This maintains the 100% allocation invariant by calculating how much can be reallocated
575+
// to the target without exceeding total available allocation.
572576
uint256 availablePPM = defaultTarget.allocatorMintingPPM +
573577
targetData.allocatorMintingPPM +
574578
targetData.selfMintingPPM;

0 commit comments

Comments
 (0)