_strategy

Represents a single strategy which can be used to register accounts. It is composed of three parts:

  • an operation, used to represent the usage of this strategy

  • a function that extracts account_details from the operation arguments

  • a function that performs any action required by the strategy, given the account and the operation arguments

The transaction that will actually perform the registration will be composed of:

  • optionally, evm_signers

  • the operation defined here

  • register_account

evm_signers must contain the signatures of all the EVM participants to the account that will be registered. If the account will be registered with two auth descriptors, all EVM signers of both auth descriptors must add their signatures there. The message to sign can be retrieved by get_register_account_message. FT signers must simply sign the whole transaction instead. If all signers are FT signers, evm_signers must be omitted.

The operation will contain some parameters which will be used by account_details and action. It should not run any code, except checking requirements to call the operation. One common requirement is that it is being used to register an account, and it can be checked with require_register_account_next_operation. Most other requirements should be checked in the action function. The mount name of the operation must be the name of the strategy in the map returned by strategy.

The register_account operation will take the name of the previous operation, find out the _strategy it represents, use the parameters in conjunction with _strategy.account_details to extract information about the account it needs to create, and call the _strategy.action function to run the code for the strategy.

See also

external.auth.evm_signers

for info on how to get EVM signatures for account registration

Properties

Link copied to clipboard

Used to extract details for the account that will be registered. If this function throws, the registration will be reverted.

Link copied to clipboard
val action: (account, gtv) -> unit

Allows custom logic to be executed after the account is created. If this function throws, the registration will be reverted.

Link copied to clipboard
val op: meta

The operation that this strategy uses. It must have the same mount name as the strategy name itself, as registered through extensions of strategy