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

Protocol Fees (Set to 20%) #5

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion contracts/Rln.sol
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ contract RLN {
uint256 public immutable MEMBERSHIP_DEPOSIT;
uint256 public immutable DEPTH;
uint256 public immutable SET_SIZE;
uint256 public immutable WAD = 10 ** 18;
uint256 public immutable PROTOCOL_FEES_PERCENTAGE = 2 * 10 ** 17;// 20 Percent fees

uint256 public pubkeyIndex = 0;
mapping(uint256 => uint256) public members;
Expand Down Expand Up @@ -86,7 +88,8 @@ contract RLN {
members[_pubkeyIndex] = 0;

// refund deposit
(bool sent, _) = receiver.call{value: MEMBERSHIP_DEPOSIT}("");
uint256 withdrawableDeposit = MEMBERSHIP_DEPOSIT * (WAD - PROTOCOL_FEES_PERCENTAGE) / WAD
(bool sent, _) = receiver.call{value: withdrawableDeposit}("");
Copy link
Contributor

Choose a reason for hiding this comment

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

Please also add comments next to each code line to elaborate on what is happening.

Copy link
Contributor

Choose a reason for hiding this comment

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

Please also add comments next to each code line to elaborate on what is happening.

@kgrgpg Once the comment is addressed, let me know to re-review.

require(sent, "transfer failed");

emit MemberWithdrawn(pubkey, _pubkeyIndex);
Expand Down