Skip to content

feat(airdrop): add admin-gated sweep_unclaimed to recover unclaimed TLEND - #451

Open
comandanto wants to merge 1 commit into
thisisouvik:mainfrom
comandanto:feat/airdrop-unclaimed-sweep
Open

comandanto wants to merge 1 commit into
thisisouvik:mainfrom
comandanto:feat/airdrop-unclaimed-sweep

Conversation

@comandanto

Copy link
Copy Markdown

Description

TlendAirdropContract could be funded and claimed from, but had no way to take unclaimed TLEND back out, so tokens allocated to addresses that never claimed stayed trapped. This adds an admin-only sweep_unclaimed(caller, to, amount) that transfers tokens from the pool to to.

Related Issue

Closes #422

Motivation and Context

Lets the treasury recycle unclaimed rewards after a round closes or expires.

Changes:

  • contracts/tlend_airdrop/src/lib.rs: new sweep_unclaimed (requires auth from the stored admin, rejects non-positive amounts and amounts above the contract balance, emits an airdrop/sweep event).
  • contracts/tlend_airdrop/src/test.rs: tests for full sweep after a claim, partial sweep, non-admin rejection, zero amount and amount above balance.

No expiry deadline is enforced (the issue lists it as optional); the sweep is gated by the admin only.

How Has This Been Tested?

Run from contracts/ on Windows (stable Rust, wasm32-unknown-unknown installed):

cargo test -p tlend_airdrop   -> 13 passed; 0 failed (5 new)
cargo test                    -> all crates pass, 0 failed
cargo clippy -p tlend_airdrop -- -D warnings   -> clean
cargo build --target wasm32-unknown-unknown --release   -> Finished

Workspace-wide cargo clippy --all-targets -D warnings and cargo fmt --check were not run as gates: they already report pre-existing issues on main in files this PR does not touch.

Screenshots (if appropriate):

n/a

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation. (n/a, no documented behaviour changes)
  • I have updated the documentation accordingly. (n/a, see above)
  • I have read the CONTRIBUTING document.

@vercel

vercel Bot commented Oct 25, 2026

Copy link
Copy Markdown

@comandanto is attempting to deploy a commit to the thisisouvik's projects Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai

coderabbitai Bot commented Oct 25, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 7d6782b3-181a-4e8f-96ff-6d3e0d4cf6dd
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement Unclaimed Token Sweep / Recovery Mechanism in TlendAirdropContract

1 participant