starcoin-framework

Module 0x1::Version

Version tracks version of something, like current VM version.

use 0x1::Config;

Struct Version

Version.

struct Version has copy, drop, store
Fields
major: u64
major number.

Constants

const EMAJOR_TO_OLD: u64 = 101;

Function new_version

Create a new version.

public fun new_version(major: u64): Version::Version
Implementation
public fun new_version(major: u64): Version {
    Version { major }
}
Specification
aborts_if false;

Function get

Get version under addr.

public fun get(addr: address): u64
Implementation
public fun get(addr: address): u64 {
    let version = Config::get_by_address<Self::Version>(addr);
    version.major
}
Specification
aborts_if !exists<Config::Config<Version>>(addr);

Module Specification

pragma verify;
pragma aborts_if_is_strict;