Modules and Initialization
In Move, the closest code-level equivalent of a Solidity contract is a module.
Solidity contract
Section titled “Solidity contract”pragma solidity ^0.8.20;
contract Billboard { constructor(address owner_) { // initialization }}Move module
Section titled “Move module”module billboard_address::billboard { use std::signer;
/// Caller is not the module publisher. const ENOT_AUTHORIZED: u64 = 1;
struct Billboard has key { /* fields */ }
public entry fun initialize(owner: &signer) { assert!(signer::address_of(owner) == @billboard_address, ENOT_AUTHORIZED); move_to(owner, Billboard { /* ... */ }); }}Key differences
Section titled “Key differences”- Solidity declares contracts with the
contractkeyword. Move declares modules asaddress::module_name. - Solidity constructors run once at deployment. In Move, run initialization logic from an explicit
public entry fun initializethat the publisher calls after publishing (see Modules on Aptos). - Package metadata and named addresses live in
Move.toml, not inline in the module.
[package]name = "billboard"version = "1.0.0"
[addresses]billboard_address = "_"For production deployments, also evaluate deploying code as an object and package upgrade policy. The core migration point is that initialization is still explicit, but the packaging and address model are different.