Allow stream senders to cancel/renounce through a Stream Management contract #977
-
Hi, As stated here, if a Stream Management contract is used, any stream sender should be allowed to cancel/renounce it. However, the Therefore, any call made by a stream sender through a Stream Management contract to the How should one allow stream senders to cancel or renounce it directly through a Stream Management-like contract? Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 7 replies
-
Hi Gabriel, thanks for the question.
This is correct.
The solution to this is to pass the Stream Management contract address as the sender parameter in the P.S. since this is more of a question, it is more suited to be in the discussion section rather than an issue. So, I will convert it. |
Beta Was this translation helpful? Give feedback.
-
Hi Andrei, Thanks for your feedback! Your proposal might be a solution but it would mean that all streams created through the Stream Management will be displayed on the front-end side with the contract address as the As you can see, this approach has its downsides, as in my case I want to create a stream through the Stream Management as part of multiple actions and want to keep the user's address as the sender. One solution I can see here is to add a mapping in the Stream Management keeping track of each stream "created" on the user's behalf, but still is not the natural approach. Have you considered checking for the |
Beta Was this translation helpful? Give feedback.
-
Hi @andreivladbrg, @smol-ninja! I've found a workaround for this that solves the "problem". In the
When a new stream gets created, the On the front-end side, there is an event that logs the payment of an invoice together with the initial stream sender so we can display all invoices (+ their streams) with regard to their payers. Thanks for your support! |
Beta Was this translation helpful? Give feedback.
Hi @andreivladbrg, @smol-ninja!
I've found a workaround for this that solves the "problem".
In the
StreamManager
contract I've added a mapping called_initialStreamSender
defined as follows:mapping(uint256 streamId => address initialSender) private _initialStreamSender;
When a new stream gets created, the
sender
will be theInvoiceManager
and the_initialStreamSender[streamId]
will be set tomsg.sender
which is the payer of the invoice. This will guard thecancel
method call and allow only the right user to cancel a stream.On the front-end side, there is an event that logs the payment of an invoice together with the initial stream sender so we can display all invoices (+ their streams) …