Address
Addresses and Their Syntax
Named Addresses
Examples
script {
fun example() {
let a1: address = @0x1; // shorthand for 0x0000000000000000000000000000000000000000000000000000000000000001
let a2: address = @0x42; // shorthand for 0x0000000000000000000000000000000000000000000000000000000000000042
let a3: address = @0xDEADBEEF; // shorthand for 0x00000000000000000000000000000000000000000000000000000000DEADBEEF
let a4: address = @0x000000000000000000000000000000000000000000000000000000000000000A;
let a5: address = @std; // Assigns `a5` the value of the named address `std`
let a6: address = @66;
let a7: address = @0x42;
}
}
module 66::some_module { // Not in expression context, so no @ needed
use 0x1::other_module; // Not in expression context so no @ needed
use std::vector; // Can use a named address as a namespace item when using other modules
...
}
module std::other_module { // Can use a named address as a namespace item to declare a module
...
}Global Storage Operations
Ownership
Last updated
