You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
in Sui Move). Consequently, it's best to simply follow this tutorial
40
+
to smart contract development in Sui. Consequently, it's best to simply follow this tutorial
43
41
and relevant Move documentation links provided in the tutorial.
44
42
45
43
Before we look at the Move code included with Sui, let's talk briefly
@@ -254,13 +252,10 @@ that it will do what it is intended to do.)
254
252
255
253
In general, an entry function, must satisfy the following properties:
256
254
257
-
-be public
255
+
-have `public(script)` visibility modifier
258
256
- have no return value
259
-
- have parameters ordered as follows:
260
-
- one or more Sui objects (or vectors of objects)
261
-
- one or more primitive types (or vectors of such types)
262
-
- a mutable reference to an instance of the `TxContext` struct
263
-
defined in the [TxContext module](https://github.com/MystenLabs/sui/tree/main/sui_programmability/framework/sources/TxContext.move)
257
+
- have a mutable reference to an instance of the `TxContext` struct
258
+
defined in the [TxContext module](https://github.com/MystenLabs/sui/tree/main/sui_programmability/framework/sources/TxContext.move) as the last parameter
264
259
265
260
More, concretely, the `transfer` function is public, has no return
266
261
value, and has three parameters:
@@ -659,11 +654,13 @@ struct available for function definitions:
659
654
660
655
We can now build the module extended with the new functions but still
661
656
have only one test defined. Let us change that by adding another test
662
-
function:
657
+
function. Note that this functionneeds to have `public(script)`
658
+
visibility modifier to be able to call other functions with the same
659
+
modifier, such as our entry function`sword_create`.
0 commit comments