Replies: 4 comments 6 replies
-
I wrote an issue that implements this idea in #164. Two questions that came to mind:
|
Beta Was this translation helpful? Give feedback.
-
I dig this proposal mostly due to callbacks simplifying how our contracts can be extended, thus providing means to scale our systems.
Bit of nitpicking but this is not exactly a solution to address the problems raised by Astaria. Those discussions revolved around limiting what the funds from an NFT can do and when, thus lowering the work required to support complex behavior. This solution keeps the dynamics of funds intact, while adding some quality UX on top to allow integrators to react to changes. It improves the current system without replacing it. |
Beta Was this translation helpful? Give feedback.
-
@andreivladbrg asked an interesting question in #164 (comment), which has led me to consider a new feature - what if we attempted to call the hook on the The Cc @razgraf, would love your two cents on this. |
Beta Was this translation helpful? Give feedback.
-
Locking, since it's been implemented via #193. |
Beta Was this translation helpful? Give feedback.
-
While writing my feedback to #150, it dawned on me what is the solution to the problems raised by Astaria.
It's to make it possible for third-party contracts to "react" to Sablier stream interactions, i.e. cancelations and withdrawals, via cross-contract hooks.
How could this work, in practice? There are a couple of ways I can think of; both would require the drafting of an
IERCSablierResponder
interface with two functionsonCancelHook
andonWithdrawHook
.onCancelHook
at the bottom of the_cancel
function on therecipient
itself, but use something liketry/catch
to not revert if the recipient does not implement the hook.responder
field in the stream struct and check if this is defined and if it is, we call theonCancelHook
function on theresponder
.Both should cost the same in terms of gas, on average, though the second approach would cost more when setting the
responder
field due to the storage gas overhead.Needless to say that by doing this, Astaria could easily react to whatever happens to the streams, and update their internal state accordingly (e.g. account for the fact that ERC-20 tokens have been transferred in).
Beta Was this translation helpful? Give feedback.
All reactions