-
Notifications
You must be signed in to change notification settings - Fork 48
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
Override default fee in Airstreams with two mappings #1040
Comments
Question: why do we need two sets? Isn't Question: will there be only one special fee? By reading "user has a special fee and if yes, use that as the campaign fee instead of the default fee", it seems like there are two fees: default and special. Does that mean custom fee cant be set for each user if required? |
Pending answers to above questions, I will work on the PR that introduces these changes and will merge it into #1038. |
The idea behind the second mapping is to allow for a fee of 0 (zero) in cases where the default fee is greater than zero. We will have a Here’s how it should look: // If not configured, the default is zero. This means we can't tell if it was intentionally set to zero
// or if it was never configured. That's why we need the second mapping.
mapping(address => uint256) public feesByUser;
mapping(address => bool) public isUserSet;
uint256 public defaultSablierFee = 0.0001e18;
function createMerkle(address admin) public {
uint256 _sablierFee;
if (isUserSet[admin]) {
_sablierFee = feesByUser[admin];
} else {
_sablierFee = defaultSablierFee;
}
new SablierMerkle(admin, _sablierFee);
}
I’m not sure I fully understand the question, but I’ll put it this way: the idea is to have specific clients who would benefit from the best rates. Please lmk if everything is clear, and if you have any suggestions for a better version |
No, because the default value of a Solidity mapping is zero, so it is impossible to differentiate between a default value of zero and an actual fee we want to set to zero for a particular user.
No. Different users may have different special fees. Some users will be granted a zero fee, while others may pay more than the default fee. This feature is about giving us and users more optionality. |
@andreivladbrg thanks for explaining. Yes its clear to me know. I didn't consider the scenario of zero fee. |
Due to our plans to introduce Sablier Pro, it would be helpful to implement a mechanism to override the default fee that gets set as immutable in the
MerkleLockup
campaign.Spec:
feesByUser
mapping that mapsaddress
types touint256
typesisUserSet
mapping that mapsaddress
types tobool
typesNote: the 'user' in this context refers to the campaign creator. You are welcome to find a better name.
Related:
The text was updated successfully, but these errors were encountered: