Boolean Flag Module - Move Typing CST Test
Loading…
Boolean Flag Module — Move Code
Stores and toggles a boolean value.
module 0x1::Flag {
resource struct Flag { enabled: bool }
public fun new(): Flag {
Flag { enabled: false }
}
public fun toggle(f: &mut Flag) {
f.enabled = !f.enabled
}
}Move Language Guide
Move is a safe, resource-oriented programming language originally developed for the Libra (now Diem) blockchain. It focuses on correctness, security, and formal verification, particularly for digital assets and smart contracts.
Primary Use Cases
- ▸Digital assets and token management
- ▸NFT minting and transfers
- ▸Safe financial transactions
- ▸Blockchain governance modules
- ▸Custom resource-oriented logic
Notable Features
- ▸Resource types prevent accidental duplication or loss
- ▸Module-based architecture for composability
- ▸Formal verification support
- ▸Strong static typing
- ▸Explicit transaction scripts
Origin & Creator
Move was created by the Libra (Diem) team at Facebook around 2019. It evolved to provide safe resource management for blockchain assets and has been adopted by several new-generation blockchains.
Industrial Note
Move is highly focused on financial and asset management applications in blockchains, especially where strict ownership rules and resource safety are required. It’s ideal for token systems, NFT platforms, and DeFi primitives.