Comptroller design: a single contract to store all logic related to fees #32
Replies: 4 comments 10 replies
-
Thanks for starting the discussion Andrei. There is one more question:
In that case, we will have to whitelist his Though it can lead to exploitation of fees but its very unlikely. Especially in case of campaign, where there will always be some funds to clawback. So, I am beginning to question whether custom fee based on
It has consequences in
I think this makes the most sense meanwhile. We can keep the fee fixed at $1 or $0.5 in Lockup and charge premium in the UI whenever we want.
Since IPFS is public goods and given there is AI, it would now be easy to construct merkle proof and bypass the fee. I don't think we should have just one variable
What do you think about calling it
Will it change the fee logic used in Airdrops / Campaigns? |
Beta Was this translation helpful? Give feedback.
-
To add an interface, it would most likely looks like this: Note It's important to have as many combinations as possible, so that we can update the comptroller in the factory, lockup, and flow contracts without deploying a new version of these contracts State variables
Getters
Calculation functions
Setters
lmk if you agree |
Beta Was this translation helpful? Give feedback.
-
looks like there aren’t so many non-cancelable streams: ![]() |
Beta Was this translation helpful? Give feedback.
-
@razgraf has suggested on a call today — what if we whitelist tokens instead of addresses to facilitate custom fees? this makes sense with new tokens used for airdrops, but IMO with streams and big tokens it doesn't work that well (sorry for the spam) |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm opening this discussion as a follow-up to the decision to implement a single contract (
Comptroller
) to manage all fee logic across our protocols — airdrops, flow, and lockup.See: sablier-labs/lockup#1219
(@maxdesalle tagging to get notified about this — as it will be relevant for you since all fees across campaigns, lockup, and flow will be centralized in one place. That means only one
collectFees
per chain. No need to dig into the technical details below)Current Airdrops Design: fee charged in
claim
Reference: sablier-labs/airdrops#66
TLDR: We store an oracle and a minimum fee in USD, then convert it to wei at claim time — both in the factory and deployed campaigns. Key points:
Note: with the
Comptroller
, we will have a greater flexibility, which is a plus.Lockup and Flow: fee charged in
withdraw
In these protocols, fees can be dynamic throughout the stream lifecycle. For example, a stream might start with a $0 fee, and the min fee could be increased later — unlike airdrops, where the fee can't be change if is zero at deployment time.
To match the airdrops approach, the initial idea was to support custom fees for stream senders. But there's a problem:
If a stream is non-cancelable, the recipient is guaranteed all the funds deposited. This makes the sender role less relevant. A user could set a sender address which has a lower (or zero) fee, so it's bypassing the default
withdraw
fee.Note: This isn’t an issue in airdrops because the
msg.sender
is used to get the fee at deployment. In streams,stream.sender
might differ frommsg.sender
.Possible Solutions
Setnot a good solution, see belowmsg.sender
asstream.sender
(might be consequences in MerkleLockup campaigns)sender
andstreamCreator
in the stream datalmk if you come up with better solutions
Based on what we decide here, in the
Comptroller
we would need to implement these functions:calculateMinFeeWeiForCampaignCreator(address campaignCreator)
- used in claimcalculateMinFeeWeiForSender(address sender)
- used in withdrawOther Question
Given our plan is to charge: (i) $1 on
withdraw
(ii) $3 fee onclaim
Should the
Comptroller
have:minFeeUSDClaim
andminFeeUSDWithdraw
, orminFeeUSD
, set as $1 with a $3 passed in our UI for claims?Since getting the Merkle proof isn't easy for users, a single
minFeeUSD
might be enough.@sablier-labs/evm @razgraf would appreciate your input. This is priority 0, as the audit is approaching.
Beta Was this translation helpful? Give feedback.
All reactions