0x1::CoreAddresses
The module provide addresses used in stdlib.
GENESIS_ADDRESS
assert_genesis_address
ASSOCIATION_ROOT_ADDRESS
VM_RESERVED_ADDRESS
use 0x1::Errors;
use 0x1::Signer;
const ENOT_GENESIS_ACCOUNT: u64 = 11;
GENESIS_ADDRESS
The address of the genesis
public fun GENESIS_ADDRESS(): address
public fun GENESIS_ADDRESS(): address {
@0x1
}
assert_genesis_address
Assert signer is genesis.
public fun assert_genesis_address(account: &signer)
public fun assert_genesis_address(account: &signer) {
assert!(Signer::address_of(account) == GENESIS_ADDRESS(), Errors::requires_address(ENOT_GENESIS_ACCOUNT))
}
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();
}
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
public fun ASSOCIATION_ROOT_ADDRESS(): address {
@0xA550C18
}
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
public fun VM_RESERVED_ADDRESS(): address {
@0x0
}
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
}