Skip to main content
When your contract sends attached NEAR tokens in a cross-contract call and that call fails, the tokens return to your contract. They do not automatically return to the user who started the operation. If the user should receive those tokens back, refund them in the callback.

The refund pattern

Save the original user and amount when creating the promise, then pass both to a private callback:
Rust: safe flow