Aptos Move by Example
  • 🚀Getting Started
  • Set-Up
  • Why is Move Secure
    • Move prover
  • Move vs Solidity
    • Resources
    • Parallel Processing
    • Reentrancy attacks
    • Memory management
    • Smart contract verification
    • Compiled language
  • Basic Concepts
    • Move.toml
    • Primary data-types
    • Strings
    • Comments
    • Functions
    • Function Visibilities
    • Control flow and expressions
    • Loops
    • Error
    • Struct and its Abilities
    • Scripts
    • Operations
  • Intermediate Concepts
    • Local variables
    • Constants
    • Signer
    • Vector
    • Address
    • Uses and Aliases
    • Maps
    • Hash functions
    • References
    • Unit test
    • Generics
    • Type Arguments
    • Type Inference
  • Advanced Concepts
    • Global Storage Structure
    • Global Storage Operations
    • Phantom Type Parameters
    • Timestamps
    • Ownership
    • Move coding conventions
    • View functions
    • Aptos account
    • Aptos Coin
    • Aptos Token(Nft)
    • Object
    • Token V2
  • Applications
    • First App
    • ToDoList
    • Voting System
    • Basic Tokens
    • Storage using Generics
    • Company
    • Collection
    • Football Card
    • Staking Module
    • MultiSender Wallet
    • English Auction
    • Dutch Auction
    • Attendance Sheet
    • Polling Contract
    • Lottery Contract
  • Decentralized Finance
    • Simple Swap Protocol Contract
    • Code of Swapping Protocol
  • Hacks
    • Coming soon
  • Hands on tutorials
    • Indexer tutorials
Powered by GitBook
On this page
Edit on GitHub
  1. Basic Concepts

Primary data-types

Move supports three primitive data types : integer, boolean and addresses.

Integer: u8,u64,u128
Boolean: true,false
Addresses: address

Move does not have string type or floating type.

module my_addrx::PrimitiveTypes
{
    use std::debug::print;

    fun primitive_types() {
        
        //Integers: u8,u64,u128
        let a:u8=10;
        let b:u64=1000;
        let c:u128=10000;
        print(&a); print(&b); print(&c);

        //Boolean: true,false
        let b1:bool=true;
        let b2:bool=false;
        print(&b1); print(&b2);

        //Address: addresses in move are represented by @Variable_name
        let addx1:address=@std;
        let addx2:address=@0x123;
        print(&addx1); print(&addx2);


    }
    
    #[test]
    fun test_primitive_types() {
        primitive_types();
    }
}
PreviousMove.tomlNextStrings

Last updated 1 year ago