test: airdrop reverts when recipient list exceeds 50 addresses#542
Merged
Chucks1093 merged 3 commits intoJul 18, 2026
Merged
Conversation
ethnum 1.5.2 fails to compile on current stable (transmute of a zero-sized type to TryFromIntError is now a hard error). 1.5.3 builds cleanly; no other dependencies change.
Implements airdrop_keys per issue accesslayerorg#523: the creator mints keys to a list of recipient wallets, paying the bonding curve cost for every key plus the protocol fee on the total (creator fee waived). Supply moves along the curve exactly as individual buys would. Recipient lists are capped at MAX_AIRDROP_RECIPIENTS (50); larger lists revert with the new AirdropRecipientLimitExceeded error. The airdrop is priced and validated in full before any storage write, so a failed call mints nothing. Emits KeysAirdropped with a summary payload.
Closes accesslayerorg#537: - 51 recipients reverts with AirdropRecipientLimitExceeded - exactly 50 recipients succeeds and credits every recipient - failed over-limit airdrop leaves supply, holder count, protocol fee balance, and all recipient balances unchanged
OpensrcLord
force-pushed
the
test/issue-537-airdrop-recipient-limit
branch
from
July 18, 2026 10:59
1ddd18e to
e1710fb
Compare
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.
Summary
Closes #537.
The airdrop entrypoint did not exist yet (tracked in #523), so this PR first adds
airdrop_keysand then the boundary tests #537 asks for.airdrop_keys(prerequisite, per #523 spec)AirdropEntry { address, amount }recipients; non-creator callers revert withUnauthorizedMAX_AIRDROP_RECIPIENTS); larger lists revert with the newAirdropRecipientLimitExceedederror (appended at the end of the enum, ABI-safe)KeysAirdropped { creator_id, total_keys, total_cost, recipient_count, ledger }and returnsAirdropSummary { total_keys, total_cost, recipient_count }Tests (
creator-keys/tests/airdrop_recipient_limit.rs)AirdropRecipientLimitExceededBuild fix
ethnum1.5.2 fails to compile on current stable rustc (1.97); bumped to 1.5.3 inCargo.lock(no other dependency changes).Verification
cargo test --workspace— all 120 test targets passcargo clippy --workspace --all-targets -- -D warnings— cleancargo fmt --check— clean