@bananapus/distributor-v6 0.0.19 → 0.0.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +3 -3
- package/src/JB721Distributor.sol +5 -5
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bananapus/distributor-v6",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.20",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -26,8 +26,8 @@
|
|
|
26
26
|
"deploy:testnets": "source ./.env && npx sphinx propose ./script/Deploy.s.sol --networks testnets"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@bananapus/721-hook-v6": "^0.0.
|
|
30
|
-
"@bananapus/core-v6": "^0.0.
|
|
29
|
+
"@bananapus/721-hook-v6": "^0.0.52",
|
|
30
|
+
"@bananapus/core-v6": "^0.0.55",
|
|
31
31
|
"@bananapus/permission-ids-v6": "^0.0.25",
|
|
32
32
|
"@openzeppelin/contracts": "5.6.1",
|
|
33
33
|
"@prb/math": "4.1.1"
|
package/src/JB721Distributor.sol
CHANGED
|
@@ -266,7 +266,7 @@ contract JB721Distributor is JBDistributor, IJB721Distributor {
|
|
|
266
266
|
|
|
267
267
|
// Use the checkpoints module to verify the token's snapshot owner had voting power at the round's snapshot
|
|
268
268
|
// block. If the token did not exist then, ownerOfAt returns zero above and the token is not eligible.
|
|
269
|
-
uint256 pastVotes = IVotes(address(IJB721TiersHook(hook).
|
|
269
|
+
uint256 pastVotes = IVotes(address(IJB721TiersHook(hook).checkpoints()))
|
|
270
270
|
.getPastVotes({account: owner, timepoint: snapshotBlock});
|
|
271
271
|
|
|
272
272
|
// If the owner had no voting power at round start, the token is ineligible.
|
|
@@ -278,14 +278,14 @@ contract JB721Distributor is JBDistributor, IJB721Distributor {
|
|
|
278
278
|
}
|
|
279
279
|
|
|
280
280
|
/// @notice The total stake at a specific block, using the hook's checkpoints module for historical accuracy.
|
|
281
|
-
/// @dev Uses `IVotes.getPastTotalSupply` from the hook's
|
|
281
|
+
/// @dev Uses `IVotes.getPastTotalSupply` from the hook's checkpoints module. This ensures that only NFTs
|
|
282
282
|
/// that existed (and were delegated) at `blockNumber` are counted, preventing late mints from diluting or
|
|
283
283
|
/// capturing rewards within the current round.
|
|
284
284
|
/// @param hook The hook to get the total stake for.
|
|
285
285
|
/// @param blockNumber The block number to get the total staked amount at.
|
|
286
286
|
/// @return total The total checkpointed voting units at the given block.
|
|
287
287
|
function _totalStake(address hook, uint256 blockNumber) internal view override returns (uint256 total) {
|
|
288
|
-
IJB721Checkpoints checkpoints = IJB721TiersHook(hook).
|
|
288
|
+
IJB721Checkpoints checkpoints = IJB721TiersHook(hook).checkpoints();
|
|
289
289
|
total = IVotes(address(checkpoints)).getPastTotalSupply(blockNumber);
|
|
290
290
|
}
|
|
291
291
|
|
|
@@ -311,7 +311,7 @@ contract JB721Distributor is JBDistributor, IJB721Distributor {
|
|
|
311
311
|
returns (address owner)
|
|
312
312
|
{
|
|
313
313
|
// The 721 hook owns the checkpoint module; the distributor only trusts that module's historical proof.
|
|
314
|
-
IJB721Checkpoints checkpoints = IJB721TiersHook(hook).
|
|
314
|
+
IJB721Checkpoints checkpoints = IJB721TiersHook(hook).checkpoints();
|
|
315
315
|
|
|
316
316
|
// Use staticcall so older hooks without `ownerOfAt` fail closed instead of reverting the whole distribution.
|
|
317
317
|
(bool success, bytes memory data) =
|
|
@@ -382,7 +382,7 @@ contract JB721Distributor is JBDistributor, IJB721Distributor {
|
|
|
382
382
|
if (owner == address(0)) return (0, newUniqueCount);
|
|
383
383
|
|
|
384
384
|
// Query the owner's checkpointed voting power at the round's snapshot block.
|
|
385
|
-
pastVotes = IVotes(address(IJB721TiersHook(ctx.hook).
|
|
385
|
+
pastVotes = IVotes(address(IJB721TiersHook(ctx.hook).checkpoints()))
|
|
386
386
|
.getPastVotes({account: owner, timepoint: snapshotBlock});
|
|
387
387
|
|
|
388
388
|
// If the snapshot owner had no voting power at round start, the token is ineligible for this round.
|