React to the updated balance

The following question has been asked on Telegram:

I need to make a interscore call with callback in a function and read the updated db below the interscore call. How can I implement this ?

It’s the same answer as here: Obtaining the user balance of a deployed FA2.

You can then place the reactive code in the setter_ entrypoint.

:warning: Remember to check the sender and add a mechanism to avoid replay because anyone can ask the balance and give your contract as the callback.

The code below the interscore call also uses that function parameters. So placing the reactive code in setter_ enrtypoint needs to send all those params in call back functions as well right? Is is the most efficient solution?

It is the solution in line with the FA2 standard. Note that the answer also provides a second solution that doesn’t use callbacks, but a view. This is not included in the standard, but more efficient and fine for many use cases.