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. Move vs Solidity

Memory management

Memory management in Move and Solidity is quite different.

Move is designed for developing smart contracts on the Libra blockchain. Move has a unique approach to memory management, where the ownership of data is transferred between resources in the program. Move uses a linear type system to enforce resource management, where a resource can only be consumed once. This means that once a resource is moved from one place to another, it can no longer be accessed by the original location. This helps prevent issues such as data races and use-after-free errors, which can be a problem in other programming languages.

Solidity is a programming language used to develop smart contracts on the Ethereum blockchain. Solidity uses a garbage collector to manage memory, which automatically frees memory that is no longer in use. Solidity has no concept of ownership or linear types, and instead relies on a heap-based memory management system similar to most general-purpose programming languages.

Overall, the memory management approach in Move is more strict and requires a different way of thinking about resource ownership and consumption compared to Solidity's garbage collector.

PreviousReentrancy attacksNextSmart contract verification

Last updated 2 years ago