The module provide addresses used in stdlib.
- Constants
- Function
GENESIS_ADDRESS
- Function
assert_genesis_address
- Function
ASSOCIATION_ROOT_ADDRESS
- Function
VM_RESERVED_ADDRESS
- Module Specification
use 0x1::Errors;
use 0x1::Signer;
const ENOT_GENESIS_ACCOUNT: u64 = 11;
The address of the genesis
public fun GENESIS_ADDRESS(): address
Implementation
public fun GENESIS_ADDRESS(): address {
@0x1
}
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) != GENESIS_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
}
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
}
pragma verify;
pragma aborts_if_is_strict;