You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: resolve coverage build logic error after contract changes
- Fix root test:coverage to use build:self:coverage for proper coverage artifacts
- Add build:coverage chain in issuance package for coverage-specific compilation
- Inline coverage script execution in test:coverage:self
- Remove scripts/coverage file (logic moved inline)
The original issue was that pnpm test:coverage reported incomplete coverage
after contract changes, requiring manual pnpm clean. This was caused by
coverage tests using regular build artifacts instead of coverage-specific
artifacts. The fix ensures coverage builds use the correct configuration
and generate proper artifacts automatically.
Copy file name to clipboardExpand all lines: packages/issuance/contracts/allocate/IssuanceAllocator.md
+31-10Lines changed: 31 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# IssuanceAllocator
2
2
3
-
The IssuanceAllocator is a smart contract responsible for allocating token issuance to different components of The Graph protocol. It calculates issuance for all targets based on their configured proportions and handles minting for non-self-minting targets.
3
+
The IssuanceAllocator is a smart contract responsible for allocating token issuance to different components of The Graph protocol. It calculates issuance for all targets based on their configured proportions and handles minting for allocator-minting targets.
4
4
5
5
## Overview
6
6
@@ -35,7 +35,7 @@ When the contract is paused:
35
35
36
36
-**Distribution stops**: `distributeIssuance()` returns early without minting any tokens, returning the last block when issuance was distributed.
37
37
-**Accumulation begins**: Issuance for allocator-minting targets accumulates in `pendingAccumulatedAllocatorIssuance` and will be distributed when the contract is unpaused (or in the interim via `distributePendingIssuance()`) according to their configured proportions at the time of distribution.
38
-
-**Self-minting continues**: Self-minting targets can still query their allocation, but should check the `blockAppliedTo` fields to respect pause state. Because RewardsManager does not check `blockAppliedTo` and will mint tokens even when the allocator is paused, the initial implementation does not pause self-minting targets. (This behavior is subject to change in future versions, and new targets should not check `blockAppliedTo`.) Note that RewardsManager is indepently pausable.
38
+
-**Self-minting continues**: Self-minting targets can still query their allocation, but should check the `blockAppliedTo` fields to respect pause state. Because RewardsManager does not check `blockAppliedTo` and will mint tokens even when the allocator is paused, the initial implementation does not pause self-minting targets. (This behavior is subject to change in future versions, and new targets should check `blockAppliedTo`.) Note that RewardsManager is independently pausable.
39
39
-**Configuration allowed**: Governance functions like `setIssuancePerBlock()` and `setTargetAllocation()` still work. However, unlike changes made while unpaused, changes made will be applied from lastIssuanceDistributionBlock rather than the current block.
40
40
-**Notifications continue**: Targets are still notified of allocation changes, and should check the `blockAppliedTo` fields to correctly apply changes.
41
41
@@ -45,7 +45,8 @@ During pause periods, the contract tracks:
45
45
46
46
-`lastIssuanceAccumulationBlock`: Updated to current block whenever accumulation occurs
47
47
-`pendingAccumulatedAllocatorIssuance`: Accumulates issuance intended for allocator-minting targets
-**Internal accumulation**: The contract uses private `accumulatePendingIssuance()` functions to handle accumulation logic, which can be triggered automatically during rate changes or manually via the public `distributePendingIssuance(uint256)` function
49
50
50
51
#### Recovery Process
51
52
@@ -83,7 +84,9 @@ The contract uses ERC-7201 namespaced storage to prevent storage collisions in u
83
84
84
85
### Constants
85
86
86
-
The contract inherits the following constant from `BaseUpgradeable`.
87
+
The contract inherits the following constant from `BaseUpgradeable`:
88
+
89
+
-**MILLION**: `1,000,000` - Used as the denominator for Parts Per Million (PPM) calculations. For example, 50% allocation would be represented as 500,000 PPM.
87
90
88
91
## Core Functions
89
92
@@ -189,6 +192,19 @@ The contract provides multiple overloaded functions for setting target allocatio
189
192
- Can be called even when the contract is paused
190
193
- No-op if there is no pending issuance or all targets are self-minting
-**TargetAddressCannotBeZero**: Thrown when attempting to set allocation for the zero address
365
+
-**InsufficientAllocationAvailable**: Thrown when the total allocation would exceed 1,000,000 PPM (100%)
366
+
-**TargetDoesNotSupportIIssuanceTarget**: Thrown when a target contract does not implement the required IIssuanceTarget interface
367
+
-**ToBlockOutOfRange**: Thrown when the `toBlockNumber` parameter in `distributePendingIssuance(uint256)` is outside the valid range (must be >= lastIssuanceAccumulationBlock and <= current block)
0 commit comments