Skip to content
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

feat: sablier fee on Airstreams claim #1038

Merged
merged 21 commits into from
Oct 24, 2024
Merged

Conversation

smol-ninja
Copy link
Member

@smol-ninja smol-ninja commented Sep 9, 2024

Changelog

@smol-ninja smol-ninja marked this pull request as draft September 9, 2024 09:42
@smol-ninja smol-ninja force-pushed the feat/claim-fee-airstream branch from de15007 to 945477a Compare September 9, 2024 21:00
Copy link
Member

@andreivladbrg andreivladbrg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i've seen that you have modified the contract as per my suggestion

i do have one more question:

src/periphery/abstracts/SablierMerkleBase.sol Outdated Show resolved Hide resolved
@smol-ninja smol-ninja force-pushed the feat/claim-fee-airstream branch from 4657ecc to 4abe924 Compare September 9, 2024 23:24
test: ReceiveEth mock contract
test: update precompiles
refactor: add missing override modifier
refactor: return feeAmount in withdrawFees in MerkleBase
@smol-ninja smol-ninja marked this pull request as ready for review September 10, 2024 10:57
@smol-ninja smol-ninja force-pushed the feat/claim-fee-airstream branch from fdfb966 to 475bf14 Compare September 10, 2024 10:59
@smol-ninja
Copy link
Member Author

This PR is now ready for review pending conclusion in #1039.

@PaulRBerg
Copy link
Member

PaulRBerg commented Sep 10, 2024

Thanks, @smol-ninja!

We need to implement some additional functionality, unfortunately.

#1040

@smol-ninja
Copy link
Member Author

smol-ninja commented Sep 10, 2024

We need to implement some additional functionality, unfortunately

No problem. How do we proceed @andreivladbrg? Should I close this PR then or should we review and merge it and then work on top of it? #1040 (comment)

@smol-ninja

This comment was marked as outdated.

@smol-ninja smol-ninja changed the title feat: receive ether in claim function feat: sablier fee on airstreams claim Sep 11, 2024
@smol-ninja smol-ninja changed the title feat: sablier fee on airstreams claim feat: sablier fee on Airstreams claim Sep 11, 2024
@smol-ninja smol-ninja marked this pull request as draft September 11, 2024 14:38
@smol-ninja smol-ninja force-pushed the feat/claim-fee-airstream branch from f727f8e to b82c687 Compare September 11, 2024 16:42
@smol-ninja
Copy link
Member Author

@andreivladbrg You can review this PR now. Its completed from my end.

@smol-ninja
Copy link
Member Author

Bumping this up @andreivladbrg so that you can add it to your to do task.

@andreivladbrg
Copy link
Member

I’m sorry, @smol-ninja 😞. I rebased on staging from main, and it caused a lot of conflicts in this PR. I didn’t realize the consequences. I will help you fixing them

@PaulRBerg
Copy link
Member

git reflog

@smol-ninja
Copy link
Member Author

I’m sorry, @smol-ninja 😞. I rebased on staging from main, and it caused a lot of conflicts in this PR. I didn’t realize the consequences. I will help you fixing them

No problem @andreivladbrg. I am sure it wont take more than 2 mins to fix it. These ain't as scary as they look in Github UI.

@smol-ninja smol-ninja force-pushed the feat/claim-fee-airstream branch 3 times, most recently from 974cac0 to de0bce6 Compare October 8, 2024 18:25
@smol-ninja smol-ninja force-pushed the feat/claim-fee-airstream branch from de0bce6 to 2538668 Compare October 11, 2024 06:38
Copy link
Member

@andreivladbrg andreivladbrg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So sorry for the late review, we’ve been busy with Flow, and I’ve just gotten my focus back on Lockup.


I haven’t fully reviewed the tests yet, but I’ll leave my feedback on src below:

Also, why campaignOwner and not campaignAdmin?

src/periphery/interfaces/ISablierMerkleFactory.sol Outdated Show resolved Hide resolved
src/periphery/SablierMerkleFactory.sol Outdated Show resolved Hide resolved
src/periphery/SablierMerkleFactory.sol Outdated Show resolved Hide resolved
src/periphery/SablierMerkleInstant.sol Show resolved Hide resolved
src/periphery/abstracts/SablierMerkleBase.sol Outdated Show resolved Hide resolved
src/periphery/interfaces/ISablierMerkleFactory.sol Outdated Show resolved Hide resolved
src/periphery/interfaces/ISablierMerkleFactory.sol Outdated Show resolved Hide resolved
src/periphery/interfaces/ISablierMerkleBase.sol Outdated Show resolved Hide resolved
src/periphery/interfaces/ISablierMerkleFactory.sol Outdated Show resolved Hide resolved
src/periphery/interfaces/ISablierMerkleFactory.sol Outdated Show resolved Hide resolved
@smol-ninja
Copy link
Member Author

Finally. Thanks for the partial review @andreivladbrg. Appreciate it!

Also, why campaignOwner and not campaignAdmin?

No reason just #1032 (comment): campaignAdmin didn't come to my mind when I was proposing this. Paul was fine with anything as long as it is prefixed with campaign and you didn't object as well.

refactor: use plural in mapping names
refactor: DRY'ify through _computeSablierFeeForUser function
refactor: adds missing override
refactor: rename SetSablierFee to SetSablierFeeForUser
feat: add non-zero check for to address in withdrawFees
docs: polish natspecs
fix: typos

Co-authored-by: Andrei Vlad Birgaoanu <99738872+andreivladbrg@users.noreply.github.com>
@smol-ninja
Copy link
Member Author

As per Slack conversation between @razgraf and @andreivladbrg, its beneficial for the UI to include sablierFee in the CreateMerkle events. However, to be able to include sablierFee in CreateMerkleLT event, I would either have to merge _deployMerkleLT code into createMerkleLT or return sablierFee in _deployMerkleLT to then access it in the event log.

@andreivladbrg, which one would you go for? I’d like to go with the first approach as _deployMerkleLT is anyways only called in createMerkleLT so why not include the code directly and avoid having returned value. But I do not remember why we decided to have a separate function _deployMerkleLT.

Copy link
Member

@andreivladbrg andreivladbrg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 more comments re src

Copy link
Member

@andreivladbrg andreivladbrg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just reviewed the tests as well, and they generally look good. (pushed some small polishes cf0990e)

There are a couple of things I would update (due to the new shared structure in periphery), but to avoid doing the same work twice after rebasing in this PR, I’ll address them there.


Sorry again for the long time waited. We are finally here 🚀

test/Base.t.sol Outdated Show resolved Hide resolved
test/periphery/fork/merkle-campaign/MerkleInstant.t.sol Outdated Show resolved Hide resolved
test/periphery/fork/merkle-campaign/MerkleLL.t.sol Outdated Show resolved Hide resolved
test/periphery/fork/merkle-campaign/MerkleLT.t.sol Outdated Show resolved Hide resolved
docs: polish natspecs over setDefaultSablierFee
chore: change visibility to private for internal functions in Factory
@andreivladbrg
Copy link
Member

@andreivladbrg, which one would you go for? I’d like to go with the first approach as _deployMerkleLT is anyways only called in createMerkleLT so why not include the code directly and avoid having returned value. But I do not remember why we decided to have a separate function _deployMerkleLT.

@smol-ninja I have missed this one.
Do what you think is best.

The reason I introduced the internal function for deployment was due to a "stack too deep" error. If you can manage to abstract the logic into a single function, feel free to go for it.

@smol-ninja smol-ninja merged commit 9974448 into staging Oct 24, 2024
9 checks passed
@smol-ninja smol-ninja deleted the feat/claim-fee-airstream branch October 24, 2024 21:03
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.

3 participants