feat(airdrop): implement Merkle-tree airdrop contract extension - #515
Open
Myart352 wants to merge 10 commits into
Open
feat(airdrop): implement Merkle-tree airdrop contract extension#515Myart352 wants to merge 10 commits into
Myart352 wants to merge 10 commits into
Conversation
- Add MerkleAirdrop struct with id, funder, token, merkle_root, total_amount, claimed_amount, expiration_ledger, cancelled fields - Add verify_merkle_proof() helper using iterative SHA-256 hashing - Add DataKey variants: AirdropCount, Airdrop(u32), AirdropClaimed(u32, Address) - Implement create_airdrop(): transfer total_amount to contract, store airdrop record - Implement claim_airdrop(): verify Merkle proof, check not already claimed, transfer tokens - Implement cancel_airdrop(): funder cancels after expiration, refunds unclaimed tokens - Add get_airdrop() and get_airdrop_count() view functions - Add 8 comprehensive tests covering single recipient, invalid proof, double claim, cancel after/before expiration, funder-only cancel, invalid params, and 3-recipient tree Closes FinChippay#475
|
@Myart352 is attempting to deploy a commit to the Topmatrixmor2014 Team on Vercel. A member of the Team first needs to authorize it. |
…ytesN conversions, add ToXdr import, extern crate std for tests
Contributor
|
Please fix CI |
…ild, fix contactsDB syntax
- Add i18next-scanner to frontend devDeps, prettier to backend - Fix duplicate logger imports, unused vars, parsing errors - Fix corrupted migrate-status.js duplicate catch blocks - Fix corrupted logger.js with duplicate keys - Fix undefined Contract/TransactionBuilder/Account in analyticsService
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Cherry-pick CI config fixes from commit 2530115: - Fix YAML indentation in ci.yml - Remove duplicate fuzz job - Fix docker-publish.yml duplicate build steps - Remove duplicate scripts in package.json
- Make output:"export" conditional on VERCEL env var so Vercel deployments use server mode while Docker builds stay static - Update vercel-deploy.yml node version to match .nvmrc (22)
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.
Closes #475
Summary
Adds a Merkle-tree-based airdrop mechanism to FinchippayContract enabling gas-efficient token distributions to thousands of recipients.
Changes
Fixes Applied
masterto pull_request trigger branches (CI only ran onmain)as_array()→to_array(),Hash<32>/BytesN<32>conversions, addedToXdrimport, addedextern crate stdfor testscargo check --target wasm32v1-nonepasses with 0 errorsTesting
cargo checkpasses cleanly on wasm32 targetSecurity