forked from starcoinorg/starcoin-framework
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSigner.move
28 lines (26 loc) · 772 Bytes
/
Signer.move
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
address StarcoinFramework {
/// Provide access methods for Signer.
module Signer {
spec module {
pragma verify;
pragma aborts_if_is_strict;
}
/// Borrows the address of the signer
/// Conceptually, you can think of the `signer` as being a resource struct wrapper around an
/// address
/// ```
/// resource struct Signer has key, store { addr: address }
/// ```
/// `borrow_address` borrows this inner field
native public fun borrow_address(s: &signer): &address;
/// Copies the address of the signer
public fun address_of(s: &signer): address {
*borrow_address(s)
}
spec address_of {
pragma opaque = true;
aborts_if false;
ensures result == address_of(s);
}
}
}