Closed NoahSaso closed 1 year ago
it occurs to me that a more descriptive name might be listener
it occurs to me that a more descriptive name might be
listener
hehe i'm down for whatever you think fits the aesthetic
i feel like ear
is equally as descriptive as note
and voice
(as opposed to sender
, executor
, and listener
for example), but i will not die on this hill
i just feel like the vibes of ear are more 🥩 while the vibes of note, voice, proxy are 🌌
i, also, will not die on this hill 😂
i just feel like the vibes of ear are more 🥩 while the vibes of note, voice, proxy are 🌌
fantastic. this is true
ear is to listener as mouth is to voice. listener is goooooooood with me 🌌👌
This creates a
listener
contract that expects callbacks from thenote
contract on ack'd messages.It is currently set up to be paired with exactly one
note
. This is nice because we can easily restrict it to exactly onenote
with authorization. The alternative is to maintain an allowlist of contracts that can submit callbacks and index by(note, initiator, initiator_msg)
.Maintaining an allowlist sounds annoying, and as we will be continuously adding more notes, I prefer the solution of instantiating a note and listener pair over using one giga-listener.
Instantiate
It requires one field, the
note
contract address that can register callbacks, which is immutable.Execute
It supports one message, which accepts the callback from a
note
contract and stores it in aMap
, indexed by(initiator, initiator_msg)
.Query
It supports two queries. One returns the
note
contract authorized to execute its callback message. The other allows querying for a callback given aninitiator
andinitiator_msg
.