Skip to content

feat: claim to a third-party address #152

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 7 commits into
base: staging
Choose a base branch
from

Conversation

smol-ninja
Copy link
Member

@smol-ninja smol-ninja commented May 1, 2025

Changelog


  • The following function has been added:
function claimTo(uint256 index, address to, uint128 amount, bytes32[] calldata merkleProof) external payable;

Important

With claimTo, msg.sender, if eligible, can receive airdrop on to address. If msg.sender is not eligible, it should revert. msg.sender should not be able to claim on other's behalf. It applies to both direct transfers as well as stream.

Important

With claim, anyone can claim on anyone's behalf. But the token should always be sent to the eligible user. It applies to both direct transfers as well as stream.

  • The Claim event has been changed to become re-usable across both claim and claimTo (cc might be important for @sablier-labs/frontend-core):
event Claim(uint256 index, address indexed recipient, uint128 amount, address to);
event Claim(uint256 index, address indexed recipient, uint128 amount, address to);
event Claim(uint256 index, address indexed recipient, uint128 amount, uint256 indexed streamId, address to);
event Claim(uint256 index, address indexed recipient, uint128 claimAmount, uint128 forgoneAmount, address to);
  • Added a _postProcessClaim function to be reused across claim and claimTo.
  • Added fuzz tests for claimTo.
  • I have created a separate shared test for claimTo. Even though it shares logic with claim, a separate integration for claimTo is important for extra security.
  • Skipped fork tests to reduce load on RPCs since the logic is same across the two claim functions. Also, changing fork tests would require refactoring it similar to fuzz tests multi airdrop function. Also, both functions are thoroughly tests across integration and concrete tests.

@smol-ninja smol-ninja force-pushed the feat/claim-recipient branch from 50e8a60 to 0db4fdf Compare May 2, 2025 10:48
@smol-ninja smol-ninja force-pushed the feat/claim-recipient branch from 0db4fdf to 9439ebb Compare May 5, 2025 10:42
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.

1 participant