Source file basics

File name

File names must be all lowercase and may include underscores (_), but no additional punctuation. Follow the convention that your project uses. Filenames’ extension must be .move

Whitespace characters

Aside from the line terminator sequence, the ASCII horizontal space character (0x20) is the only whitespace character that appears anywhere in a source file. This implies that

  1. All other whitespace characters in string literals are escaped, and
  2. Tab characters are not used for indentation.

Importing

When importing modules If you are importing multiple modules from the same name space do it all at once.

Allowed:

use sui::{
      balance::{Self, Balance},
      sui::SUI,
      coin::{Self, Coin},
      display,
      kiosk,
      table_vec::{Self, TableVec},
      transfer_policy,
  };

Disallowed:

use sui::display;
use sui::dynamic_field;
use sui::event;
use sui::hex;
use sui::package;
use sui::transfer::Receiving;
use sui::vec_map::{Self, VecMap};
use sui::vec_set::{Self, VecSet};

Formating