Signer
A signer
is a type that represents the authorization and control of a resource or asset on the blockchain. The signer type is used to indicate which account or entity is responsible for executing a particular transaction or operation on the blockchain.
You can think of the native implementation as being:
Signer values are special because they cannot be created via literals or instructions--only by the Move VM. Before the VM runs a script with parameters of type signer
, it will automatically create signer
values and pass them into the script:
signer
operations:
The std::signer
standard library module provides two utility functions over signer
values:
signer::address_of(&signer): address
- Return theaddress
wrapped by this&signer
.signer::borrow_address(&signer): &address
- Return a reference to theaddress
wrapped by this&signer
.
Ownership:
Unlike simple scalar values, signer
values are not copyable, meaning they cannot be copied(from any operation whether it be through an explicit copy
instruction or through a dereference *
.
Last updated