Skip to content
This repository has been archived by the owner on Mar 20, 2024. It is now read-only.

Specification of entry functions in solana-move #380

Open
ksolana opened this issue Sep 21, 2023 · 0 comments
Open

Specification of entry functions in solana-move #380

ksolana opened this issue Sep 21, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@ksolana
Copy link
Collaborator

ksolana commented Sep 21, 2023

As per sui doc:
https://docs.sui.io/build/move#entry-functions

In general, an entry function must satisfy the following properties:

    Has the entry modifier. The visibility does not matter. The function can be public, public(friend), or internal.
    Has no return value
    (Optional) Has a mutable reference to an instance of the TxContext struct defined in the [TxContext module](https://github.com/MystenLabs/sui/tree/main/crates/sui-framework/packages/sui-framework/sources/tx_context.move) as the last parameter.

More concretely, the transfer function is public, has no return value, and has three parameters:

    c - Represents a gas object whose ownership is to be transferred.
    recipient - The [address](https://github.com/move-language/move/blob/main/language/documentation/book/src/address.md) of the intended recipient
    _ctx - A mutable reference to an instance of the TxContext struct (in this particular case, this parameter is not actually used in the function's body as indicated by its name starting with _). Because it is unused, the parameter could be removed. The mutable reference to the TxContext is optional for entry functions.

We probably will have something similar and we should be able to check it at compile time.

@ksolana ksolana added the bug Something isn't working label Sep 21, 2023
@ksolana ksolana changed the title Speficiation of entry functions Specification of entry functions in solana-move Sep 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant