Skip to content

Latest commit

 

History

History
146 lines (71 loc) · 2.6 KB

Version.md

File metadata and controls

146 lines (71 loc) · 2.6 KB

Module 0x1::Version

Version tracks version of something, like current VM version.

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;