Skip to content

Commit e0c3548

Browse files
committed
feat: treat default allocation as unallocated in getTotalAllocation reporting
Modified getTotalAllocation() to exclude default allocation from reported totals when the default target is address(0), since address(0) cannot receive minting. This provides clearer reporting of actual allocated issuance while maintaining the internal 100% allocation invariant. - Updated getTotalAllocation() to check if default is address(0) - When default is address(0), subtract default allocation from reported totalAllocationPPM and allocatorMintingPPM - Internal 100% allocation invariant remains unchanged - Updated 12 tests across 3 test files to expect new reporting behavior - All 165 tests passing
1 parent dbf5d2b commit e0c3548

File tree

7 files changed

+808
-153
lines changed

7 files changed

+808
-153
lines changed

packages/interfaces/contracts/issuance/allocate/IIssuanceAllocationAdministration.sol

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,17 @@ interface IIssuanceAllocationAdministration {
7272
*/
7373
function forceTargetNoChangeNotificationBlock(address target, uint256 blockNumber) external returns (uint256);
7474

75+
/**
76+
* @notice Set the address that receives the default (unallocated) portion of issuance
77+
* @param newAddress The new default allocation address (can be address(0))
78+
* @return True if successful
79+
* @dev The default allocation automatically receives the portion of issuance not allocated to other targets
80+
* @dev This maintains the invariant that total allocation is always 100%
81+
* @dev Reverts if attempting to set to an address that has a normal (non-default) allocation
82+
* @dev No-op if setting to the same address
83+
*/
84+
function setDefaultAllocationAddress(address newAddress) external returns (bool);
85+
7586
/**
7687
* @notice Distribute any pending accumulated issuance to allocator-minting targets.
7788
* @return Block number up to which issuance has been distributed

packages/issuance/contracts/allocate/IssuanceAllocator.sol

Lines changed: 125 additions & 21 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)