Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

IVersionGetter

Git Source

Functions

version

Get the version of the smart contract project.

Examples:

  • 1.2.3 --> (1, 2, 3, "", "" )
  • 1.2.3-alpha.0 --> (1, 2, 3, "alpha.0", "" )
  • 1.2.3+sha.a1b2c3 --> (1, 2, 3, "", "sha.a1b2c3")
  • 1.2.3-alpha.0+sha.a1b2c3 --> (1, 2, 3, "alpha.0", "sha.a1b2c3") You can learn more about semantic versioning at <semver.org>.
function version()
    external
    view
    returns (
        uint64 major,
        uint64 minor,
        uint64 patch,
        string memory preRelease,
        string memory buildMetadata
    );

Returns

NameTypeDescription
majoruint64The major version
minoruint64The minor version
patchuint64The patch version
preReleasestringThe pre-release version (can be empty)
buildMetadatastringThe build metadata (can be empty)