neo-one icon indicating copy to clipboard operation
neo-one copied to clipboard

Finalize `@receive` decorator and how contracts receive assets

Open spencercorwin opened this issue 3 years ago • 2 comments

The receive decorator did a lot of work behind the scenes with native assets, especially with allowing a way for callers of the contract method to get their assets back if the invocation failed. How are we to handle that kind of thing now? Need to look at documentation to understand exactly what the receive decorator was doing and how to implement that now.

My notes:

  • How to deal with receiving assets in a contract method? Would you just look in Blockchain.currentTransaction? What would you need to do if a method was receiving transfers?
  • Change how receive decorator is compiled and how it helps the user check for fund transfers. Check invocation counter like in CS contract

Make sure to update tests, docs, and client types with this.

spencercorwin avatar Jun 17 '21 05:06 spencercorwin

This includes changing some types in client-common/src/types.ts- specifically need to update or remove the InvokeSendUnsafeReceiveTransactionOptions, InvokeSendUnsafeTransactionOptions, and InvokeReceiveTransactionOptions. And should sendTo and sendFrom be included in TransactionOptions interface?

spencercorwin avatar Aug 12 '21 01:08 spencercorwin

Make sure the generated client API for mintTokens functions includes the correct types for sendTo

spencercorwin avatar Aug 12 '21 01:08 spencercorwin