starcoin-framework

Module 0x1::CoreAddresses

The module provide addresses used in stdlib.

use 0x1::Errors;
use 0x1::Signer;

Constants

const ENOT_GENESIS_ACCOUNT: u64 = 11;

Function GENESIS_ADDRESS

The address of the genesis

public fun GENESIS_ADDRESS(): address
Implementation
public fun GENESIS_ADDRESS(): address {
    @0x1
}

Function assert_genesis_address

Assert signer is genesis.

public fun assert_genesis_address(account: &signer)
Implementation
public fun assert_genesis_address(account: &signer) {
    assert!(Signer::address_of(account) == GENESIS_ADDRESS(), Errors::requires_address(ENOT_GENESIS_ACCOUNT))
}
Specification
pragma opaque;
include AbortsIfNotGenesisAddress;
Specifies that a function aborts if the account does not have the Diem root address.
schema AbortsIfNotGenesisAddress {
    account: signer;
    aborts_if Signer::address_of(account) != SPEC_GENESIS_ADDRESS();
}

Function ASSOCIATION_ROOT_ADDRESS

The address of the root association account. This account is created in genesis, and cannot be changed. This address has ultimate authority over the permissions granted (or removed) from accounts on-chain.

public fun ASSOCIATION_ROOT_ADDRESS(): address
Implementation
public fun ASSOCIATION_ROOT_ADDRESS(): address {
    @0xA550C18
}

Function VM_RESERVED_ADDRESS

The reserved address for transactions inserted by the VM into blocks (e.g. block metadata transactions). Because the transaction is sent from the VM, an account cannot exist at the 0x0 address since there is no signer for the transaction.

public fun VM_RESERVED_ADDRESS(): address
Implementation
public fun VM_RESERVED_ADDRESS(): address {
    @0x0
}

Module Specification

pragma verify;
pragma aborts_if_is_strict;

Specification version of Self::GENESIS_ACCOUNT.

fun SPEC_GENESIS_ADDRESS(): address {
   @0x1
}

Specification version of Self::ASSOCIATION_ROOT_ADDRESS.

fun SPEC_ASSOCIATION_ROOT_ADDRESS(): address {
   @0xA550C18
}

Specification version of Self::VM_RESERVED_ADDRESS.

fun SPEC_VM_RESERVED_ADDRESS(): address {
   @0x0
}