Failed to publish the Move module(s), reason: [warning] Multiple source verification errors found

378 Views Asked by At

I try to publish the sui move after build it successfully. But it shows the error:

Failed to publish the Move module(s), reason: [warning] Multiple source verification errors found:

- Local dependency did not match its on-chain version at 0000000000000000000000000000000000000000000000000000000000000002::Sui::table_vec
- Local dependency did not match its on-chain version at 0000000000000000000000000000000000000000000000000000000000000002::Sui::tx_context
- Local dependency did not match its on-chain version at 0000000000000000000000000000000000000000000000000000000000000002::Sui::ecdsa_k1
- Local dependency did not match its on-chain version at 0000000000000000000000000000000000000000000000000000000000000002::Sui::kiosk_extension
- Local dependency did not match its on-chain version at 0000000000000000000000000000000000000000000000000000000000000002::Sui::transfer

This may indicate that the on-chain version(s) of your package's dependencies may behave differently than the source version(s) your package was built against.

Fix this by rebuilding your packages with source versions matching on-chain versions of dependencies, or ignore this warning by re-running with the --skip-dependency-verification flag.

I use sui client publish --gas-budget 3000000000 to run on my terminal.

[warn] Client/Server api version mismatch, client api version : 1.10.1, server api version : 1.11.0
UPDATING GIT DEPENDENCY https://github.com/MystenLabs/sui.git
INCLUDING DEPENDENCY Sui
INCLUDING DEPENDENCY MoveStdlib
BUILDING basic

Here is the module I made on VSCode:

module basic::DEMO {
    use sui::object::{Self, UID};
    use sui::tx_context::{Self, TxContext};
    use sui::transfer;

    struct Wallet has key {
        id: UID,
        balance: u128,
        name: vector<u8>
    }
    fun init(ctx: &mut TxContext) {
        let wallet = Wallet {
            id: object::new(ctx),
            balance: 1_000_000_000_000_000,
            name: b"Maythunguyen",
        };

        transfer::transfer(wallet, tx_context::sender(ctx));

    }
}

Move.toml:

[package]
name = "basic"
version = "0.0.1"

[dependencies]
Sui = { git = "https://github.com/MystenLabs/sui.git", subdir = "crates/sui-framework/packages/sui-framework", rev = "framework/testnet" }

[addresses]
basic = "0x0"

I've already built it successfully

UPDATING GIT DEPENDENCY https://github.com/MystenLabs/sui.git
INCLUDING DEPENDENCY Sui
INCLUDING DEPENDENCY MoveStdlib
BUILDING basic
3

There are 3 best solutions below

0
Giáp Chí Cường On

Please try to fix this

[dependencies]
sui = { git = "https://github.com/MystenLabs/sui.git", subdir = "crates/sui-framework/packages/sui-framework", rev = "framework/testnet" }

to this one

[dependencies]
sui = { git = "https://github.com/MystenLabs/sui.git", subdir = "crates/sui-framework/packages/sui-framework", rev = "framework/devnet" }

and run this on cmd

sui client switch --env devnet
0
Akshit Gupta On

This worked for me after capitalising the s in "sui = ..." to "Sui = ..."

So it should be this:

[dependencies] Sui = { git = "https://github.com/MystenLabs/sui.git", subdir = "crates/sui-framework/packages/sui-framework", rev = "framework/devnet" }

0
Karan Goraniya On

Try executing the following command:

sui client publish --gas-budget 10000000 --skip-dependency-verification

if If that doesn't work, you may need to verify the version of your sui binaries:

sui --version

The current version is sui 1.12.0-f839d7231. If your version is outdated, consider updating it. You can find the installation guide for the SUI binaries in the official documentation