somish/NexusMutual

Review method payJoiningFee

Closed this issue · 2 comments

If I understand correctly, payJoiningFee is solving 2 functions.

  1. Initiating membership process and accepts fee 0.002 ETH
  2. Completion of membership process post KYC trigger

While 1 should be a payable method, 2 should not. When the membership process is triggered, we are not transferring the fee to quotation contract. However, we are expecting the quotation contract to call this payable function with membership fee. This looks wrong.

Ideally, these are separate process and should be handled in 2 functions.

The function can execute with 2 conditions.

  1. only membership.
  2. membership with cover.
    In case (1), it should accept joining fee from user and should wait for KYC verdict.
    In case (2) , it will called by kycTrigger from quotation contract.. ie.,kyc verdict passed so we have to transfer membershipFee to tokenFunction contract(which user pays to quotation contract) and have to give him membership.

If I understand your problem correctly.... you are confused why quotation contract is transffering ETH to tokenFunction......answer is because user pay total amount to quotation contract while paying for (joiningfee + cover). so we have to forward that amount to tokenFunction.

If I understand your problem incorrectly, let me know.
@nitika-goel

I think the issue has been fixed. Closing issue.