Skip to content

Conversation

@RembrandtK
Copy link
Contributor

@RembrandtK RembrandtK commented Nov 17, 2025

Rebase of: #1245

Issuance Allocator contracts, see: packages/issuance/contracts/allocate/IssuanceAllocator.md

Cherry-picked from ec0c984 (issuance-baseline-2/3)
Rebased onto main with regenerated lockfile
@socket-security
Copy link

socket-security bot commented Nov 17, 2025

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Added@​nomicfoundation/​hardhat-toolbox@​5.0.0981007689100
Addeddebug@​4.4.310010010083100
Added@​openzeppelin/​hardhat-upgrades@​3.9.19910010087100
Addedhardhat@​2.26.394100919780

View full report

@RembrandtK RembrandtK mentioned this pull request Nov 17, 2025
@openzeppelin-code
Copy link

openzeppelin-code bot commented Nov 17, 2025

Issuance Allocator (IA) (rebased)

Generated at commit: 48be37a20ee36bb881ef42a70c7d12ce5d46fd3b

🚨 Report Summary

Severity Level Results
Contracts Critical
High
Medium
Low
Note
Total
3
5
0
14
38
60
Dependencies Critical
High
Medium
Low
Note
Total
0
0
0
0
0
0

For more details view the full report in OpenZeppelin Code Inspector

@codecov
Copy link

codecov bot commented Nov 17, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.14%. Comparing base (380f6ad) to head (48be37a).
⚠️ Report is 21 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1257      +/-   ##
==========================================
+ Coverage   84.05%   86.14%   +2.08%     
==========================================
  Files          42       45       +3     
  Lines        2070     2345     +275     
  Branches      615      698      +83     
==========================================
+ Hits         1740     2020     +280     
+ Misses        330      325       -5     
Flag Coverage Δ
unittests 86.14% <100.00%> (+2.08%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

The default allocation receives issuance that is
not explicitly allocated to another target.

- Added setDefaultAllocationAddress() to set.
- getTotalAllocation() excludes default when it is the zero address.
- Tests and documentation updated.
Added two configurable reclaim addresses:

- indexerEligibilityReclaimAddress
- subgraphDeniedReclaimAddress

When rewards are denied and the reclaim address is set (non-zero),
tokens are minted to that address instead of not being minted at all.
Defaults to address(0) (original behavior).

Also updated associated documentation and tests.
- 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
…wing (#1268)

Replace vm.assume with bounded inputs to fix "vm.assume rejected too many inputs" error.
The previous implementation used overly restrictive constraints that caused the fuzzer
to reject most random inputs. Now limits amountThawing and amountCollected to half of
MAX_STAKING_TOKENS, guaranteeing valid deposit ranges while maintaining test coverage.
…address

Change setDefaultAllocationAddress to distribute any pending issuance to the
old default address before changing to the new address.

Add evenIfDistributionPending parameter to handle the case when distribution
cannot proceed (e.g., when paused). This allows callers to either:
- Return false when distribution is pending (evenIfDistributionPending=false)
- Force the change anyway (evenIfDistributionPending=true)

Implementation:
- Calls _handleDistributionBeforeAllocation before changing default address
- Distributes pending issuance to old default address up to current block
- Then changes allocation to new default address
- When paused and evenIfDistributionPending=false, returns false instead of changing
- Original setDefaultAllocationAddress(address) signature wraps new implementation with evenIfDistributionPending=false
Refactor _removeTargetFromList to _removeTarget to logically group target
removal operations (array removal and mapping deletion) in a single function.
Loop starts at index 1 to protect default allocation at index 0.

Also fixes MILLION/PPM terminology, adds missing natspec, and adds test for
address(0) default allocation.
When changing default allocation address, allocation data is copied from
oldAddress to newAddress, which was overwriting newAddress's lastChangeNotifiedBlock.

- If newAddress was just notified, the notification record was lost
- If newAddress had a future block set (via forceTargetNoChangeNotificationBlock),
  that restriction was lost
- When changing from address(0) (which is never notified), newAddress's
  lastChangeNotifiedBlock was incorrectly set to 0

Fix: preserve newAddress's lastChangeNotifiedBlock when copying allocation data.

Also clarifies that notification blocks are target-specific, not about the default in general.
IA: Audit fix/response for Issuance Allocator

Incorporated into audit report (Graph_IssuanceAllocator_v01.pdf) and now part of baseline for subsequent.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants