-
Notifications
You must be signed in to change notification settings - Fork 3
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
Conversation
50e8a60
to
0db4fdf
Compare
0db4fdf
to
9439ebb
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work — I’ve left my feedback below:
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.
I agree with the idea of using the same approach of having a shared
file.
However, similar to the createWithTimestamps
vs createWithDurations
tests, I believe we can just test one the branches below, since currently is testing the same logic twice:
├── when to address zero
│ └── it should revert
└── when to address not zero
├── when caller not eligible
│ └── it should revert
└── when caller eligible
├── it should mark the index as Claimed
├── it should transfer the ETH to the merkle lockup
└── it should emit {Claim} event
Thank you very much @andreivladbrg for the review and the feedback.
Which two branches are you talking about? claimTo.tree and claim.tree do not have the same starting branches. They might share the middle branches but that would be a bad DX. Also, in one test, we are referring to caller whereas in other, we are referring to recipient for the clarity. |
these branches, claim and claimTo, are pretty much duplicated i've listed in my previous comment how the
|
I see. I understood now. Yeah that makes sense. Implemented in 96211bc. |
fix: error names docs: fix comments build: bump solhint, evm-utils and lockup Co-authored-by: Andrei Vlad Birgaoanu <[email protected]>
If no more feedback, then can you plz approve the PR after reviewing the latest commit cc @andreivladbrg? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changelog
ipfsCID
will result in Sablier UI incompatibilities #146bun run check
andbun run format
(see this discussion); since ci usesbun run lint
, cant change it.Important
With
claimTo
,msg.sender
, if eligible, can receive airdrop onto
address. Ifmsg.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.Claim
event has been changed to become re-usable across bothclaim
andclaimTo
(cc might be important for @sablier-labs/frontend-core):_postProcessClaim
function to be reused acrossclaim
andclaimTo
.claimTo
.claimTo
. Even though it shares logic withclaim
, a separate integration forclaimTo
is important for extra security.