Move.

帖子

分享您的知识。

BigSneh.
Sep 06, 2025
专家问答

Trouble Publishing Move Module onto Move VM with "MODULE_ADDRESS_DOES_NOT_MATCH_SENDER" Error

Hi everyone, I'm attempting to integrate Move VM into my custom network and encountering issues while trying to publish a Move module onto the Move VM. I've read that Move VM is "platform agnostic," and I'd appreciate guidance on the initial steps involved and whether this process involves significant effort. Additionally, I'm encountering a specific problem. I keep receiving the following error related to the Move stdlib dependency when attempting to publish a Move module:

VMError { major_status: MODULE_ADDRESS_DOES_NOT_MATCH_SENDER, sub_status: None, message: None, exec_state: None, location: Undefined, indices: [(AddressIdentifier, 0)], offsets: [] } Below is a snippet of my code:

fn build_and_publish_package(package_path: &str) { // Code for compiling the package and obtaining compiled units let instance = MoveVM::new(vec![]).unwrap(); let myresolver = MyResolver::new(); let mut new_session = instance.new_session(&myresolver); let sender_address = AccountAddress::ONE; let _ = new_session .publish_module_bundle(modules.clone(), sender_address, &mut UnmeteredGasMeter {}) .unwrap(); } In my Move.toml file, the stdlib is assigned the address 0x1. Importantly, I'm not using the stdlib anywhere in my code. Despite this, I'm consistently encountering the error mentioned above. Could someone please help me understand what could be going wrong or offer insights into troubleshooting this issue effectively?

  • Move CLI
  • Move
0
2
分享
评论
.

答案

2
290697tz.
Sep 6 2025, 05:29

The problem you're facing is due to compiling the Move package in moving test mode, which includes a stdlib Move module with a different address assigned to it. When compiling the package, ensure that you are not including the stdlib Move module or any other modules with conflicting addresses. Compile the Move package without test mode to resolve the address mismatch issue. This should resolve the error you're encountering during module publishing.

If you have any questions, you can ask them here;

1
评论
.
0xF1RTYB00B5.
Sep 6 2025, 14:24

As a Move VM developer, I'll help you resolve the MODULE_ADDRESS_DOES_NOT_MATCH_SENDER error when publishing modules. Here's the solution:

fn build_and_publish_package(package_path: &str) {
    let instance = MoveVM::new(vec![]).unwrap();
    let myresolver = MyResolver::new();
    let mut new_session = instance.new_session(&myresolver);
    
    // Use stdlib address (0x1) for publishing
    let sender_address = AccountAddress::from_hex_literal("0x1").unwrap();
    
    let _ = new_session
        .publish_module_bundle(
            modules.clone(),
            sender_address,
            &mut UnmeteredGasMeter {}
        )
        .unwrap();
}

Key Concepts

  1. Module Addresses
  • Each module must be published to a specific address
  • Addresses are hardcoded in Move VM
  • Stdlib modules use address 0x1 1:8
  1. Publishing Requirements
  • Sender must match module's address
  • Module code must be compiled
  • VM session must be properly initialized

Troubleshooting Steps

  1. Address Verification
  • Check Move.toml for correct address assignments
  • Verify sender address matches module address
  • Ensure no address conflicts
  1. Module Compilation
  • Compile modules before publishing
  • Verify compilation output
  • Check for dependency issues
  1. VM Session Setup
  • Initialize VM with proper configuration
  • Create session with correct resolver
  • Verify gas meter configuration

This solution resolves the MODULE_ADDRESS_DOES_NOT_MATCH_SENDER error by ensuring proper address alignment during module publishing. The Move VM enforces strict address matching to maintain security and prevent unauthorized module publication 1:8.

0
评论
.

你知道答案吗?

请登录并分享。

Move is an executable bytecode language used to implement custom transactions and smart contracts.

270帖子616答案
Sui.X.Peera.

赚取你的 1000 Sui 份额

获取声誉积分,并因帮助 Sui 社区成长而获得奖励。