InternalTrait
Fully qualified path: openzeppelin_account::account::AccountComponent::InternalTrait
pub trait InternalTrait<
TContractState,
+HasComponent<TContractState>,
impl SRC5: HasComponent<TContractState>,
+Drop<TContractState>,
>
Trait functions
initializer
Initializes the account with the given public key, and registers the ISRC6 interface ID.
Emits an OwnerAdded event.
Fully qualified path: openzeppelin_account::account::AccountComponent::InternalTrait::initializer
fn initializer(ref self: ComponentState<TContractState>, public_key: felt252)
assert_only_self
Validates that the caller is the account itself. Otherwise it reverts.
Fully qualified path: openzeppelin_account::account::AccountComponent::InternalTrait::assert_only_self
fn assert_only_self(self: @ComponentState<TContractState>)
assert_valid_new_owner
Validates that new_owner accepted the ownership of the contract.
WARNING: This function assumes that current_owner is the current owner of the
contract, and does not validate this assumption.
Requirements:
- The signature must be valid for the new owner.
Fully qualified path: openzeppelin_account::account::AccountComponent::InternalTrait::assert_valid_new_owner
fn assert_valid_new_owner(
self: @ComponentState<TContractState>,
current_owner: felt252,
new_owner: felt252,
signature: Span<felt252>,
)
validate_transaction
Validates the signature for the current transaction.
Returns the short string VALID if valid, otherwise it reverts.
Fully qualified path: openzeppelin_account::account::AccountComponent::InternalTrait::validate_transaction
fn validate_transaction(self: @ComponentState<TContractState>) -> felt252
_set_public_key
Sets the public key without validating the caller.
The usage of this method outside the set_public_key function is discouraged.
Emits an OwnerAdded event.
Fully qualified path: openzeppelin_account::account::AccountComponent::InternalTrait::_set_public_key
fn _set_public_key(ref self: ComponentState<TContractState>, new_public_key: felt252)
_is_valid_signature
Returns whether the given signature is valid for the given hash using the account’s current public key.
Fully qualified path: openzeppelin_account::account::AccountComponent::InternalTrait::_is_valid_signature
fn _is_valid_signature(
self: @ComponentState<TContractState>, hash: felt252, signature: Span<felt252>,
) -> bool