callback pay refers to the pattern of a) the pair checking its balance, b) the pair calling a function on an address that would have to send tokens to the pair, and then c) the pair checking its balance to make sure it received enough tokens. if we're going to introduce callback pay anywhere, it probably makes sense to introduce it everywhere
this is in opposition to callback notify, which uses the callback simply to give an execution frame to flash swappers. if we use callback notify, it should only be used in swap, and only for flash swaps (indicated by data.length > 0)
a consideration in both cases is that all transferFrom calls should be sandwiched by balance checks enforcing correctness. we get this for free in callback pay, but it has to be enforced in callback notify
both variants have downstream implications for routers/integrations, which should also be explored as part of this decision
callback pay refers to the pattern of a) the pair checking its balance, b) the pair calling a function on an address that would have to send tokens to the pair, and then c) the pair checking its balance to make sure it received enough tokens. if we're going to introduce callback pay anywhere, it probably makes sense to introduce it everywhere
this is in opposition to callback notify, which uses the callback simply to give an execution frame to flash swappers. if we use callback notify, it should only be used in
swap
, and only for flash swaps (indicated bydata.length > 0
)a consideration in both cases is that all transferFrom calls should be sandwiched by balance checks enforcing correctness. we get this for free in callback pay, but it has to be enforced in callback notify
both variants have downstream implications for routers/integrations, which should also be explored as part of this decision