sablier-labs / v2-periphery

🎛 Peripheral smart contracts for interacting with Sablier V2
https://docs.sablier.com
GNU General Public License v3.0
24 stars 7 forks source link

Implement MerkleLockupLD (LockupDynamic) #274

Closed PaulRBerg closed 7 months ago

PaulRBerg commented 8 months ago

As discussed in https://github.com/sablier-labs/company-discussions/discussions/23.

smol-ninja commented 8 months ago

I have two questions that I have been struggling to decide on:

1. For a given campaign, should we assume it to have the same segments for all users or not?

  1. The claim function does not need to have amount as the input argument. We can calculate it by adding up the amounts from the segments. Am I correct?

  2. When protocolFee > 0, unlike MerkleStreamerLL, we will have to collect the protocol fee in addition to the campaign total amount from the campaign creator. Then there are two approaches:

    1. We calculate the totalAmount as the sum of segments + protocol fee in claim function. So while creating the stream, the net amount would match with segment amounts. This will re-introduce the Comptroller and protocol fee in the v2-periphery.

    2. The UI calculate the segment amounts plus the protocol fee and passes it in the claim function as amount. So we wouldn't have to introduce the Comptroller but the calculation would be done externally. But this would introduce amount parameter in the claim which will require us to verify whether the amount matches the segment amount or not. Then it would again re-introduce Comptroller into v2-periphery.

      How should I proceed in this case? Or we get rid of protocol fee and don't deal with the 3rd problem.

    RFC from @PaulRBerg @andreivladbrg.

PaulRBerg commented 8 months ago

Good questions @smol-ninja.

  1. Correct

  2. I am in favor of completely removing protocol fees, see this. We just need to get Max on board with this proposal.

smol-ninja commented 7 months ago

Closing it for now as discussed in https://github.com/sablier-labs/v2-periphery/discussions/288.