fix: parametrize NFT serial in TokenReject.rejectTokens - #135
Merged
natanasow merged 2 commits intoAug 19, 2026
Merged
Conversation
Signed-off-by: ValentinVPK <valentin.krumov@limechain.tech>
natanasow
approved these changes
Aug 18, 2026
Contributor
|
🎉 This PR is included in version 0.2.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description:
TokenReject.rejectTokenshardcodednftId.serial = 1, so the example could only ever reject serial#1of each NFT collection — any other serial was unreachable, and the limitation was invisible to the test suite (it only ever minted one fresh NFT, which is always serial 1).int64[] serialsparameter torejectTokensand usenftId.serial = serials[i](mirroringcancelMultipleAirdrops/claimMultipleAirdrops)serialsarray#2, so the missing-serial limitation cannot silently returnmintNFTToAddresscalls in the test that were missingawait(they returned Promises and "worked" only because the reject was hardcoded to serial 1)Related issue(s):
Fixes #123
Notes for reviewer:
This is a breaking ABI change —
rejectTokensgains a parameter, so its selector changes. That's inherent to the fix (the serial must be caller-supplied). Theserialsarray is expected to be parallel tonftAddresses; there's no explicit length guard, matching the sibling multi-airdrop helpers (out-of-bounds already reverts at the EVM level).Verified:
npx hardhat compileclean (64 files); the rewritten test passes Prettier and ESLint. The regression test asserts the second minted serial is2(setupNftcreates a fresh collection and does not pre-mint, so sequential mints yield 1 then 2) and rejects serial#2— which the previous hardcoded-1code could not do. The acceptance suite runs against a live Hedera node (solo), so runtime confirmation is via CI, not local.