Keyboard shortcuts

Press or to navigate between chapters

Press ? to show this help

Press Esc to hide this help

openzeppelin_account

Fully qualified path: openzeppelin_account

Modules


Re-exports:


Modules

Modules

account

Fully qualified path: openzeppelin_account::account

Modules

Modules

Modules

AccountComponent

Account Component

The Account component enables contracts to behave as accounts.

Fully qualified path: openzeppelin_account::account::AccountComponent

Modules

Free functions

Structs

Enums

Event

Traits

Modules

Modules

Errors

Fully qualified path: openzeppelin_account::account::AccountComponent::Errors

Constants

Constants

Constants

INVALID_CALLER

Fully qualified path: openzeppelin_account::account::AccountComponent::Errors::INVALID_CALLER

pub const INVALID_CALLER: felt252 = 6262948757243068301173483364169975331325598907448976754;

INVALID_SIGNATURE

Fully qualified path: openzeppelin_account::account::AccountComponent::Errors::INVALID_SIGNATURE

pub const INVALID_SIGNATURE: felt252 =
    105074844097198521391540583873086336848321434922596230638170725;

INVALID_TX_VERSION

Fully qualified path: openzeppelin_account::account::AccountComponent::Errors::INVALID_TX_VERSION

pub const INVALID_TX_VERSION: felt252 =
    26899160088882821476234389471510102233170292334138446031203430254;

UNAUTHORIZED

Fully qualified path: openzeppelin_account::account::AccountComponent::Errors::UNAUTHORIZED

pub const UNAUTHORIZED: felt252 = 95565013996018498247890117593540195050286445389156;

__external_SRC6Impl

Fully qualified path: openzeppelin_account::account::AccountComponent::__external_SRC6Impl

__l1_handler_SRC6Impl

Fully qualified path: openzeppelin_account::account::AccountComponent::__l1_handler_SRC6Impl

__constructor_SRC6Impl

Fully qualified path: openzeppelin_account::account::AccountComponent::__constructor_SRC6Impl

__external_DeclarerImpl

Fully qualified path: openzeppelin_account::account::AccountComponent::__external_DeclarerImpl

__l1_handler_DeclarerImpl

Fully qualified path: openzeppelin_account::account::AccountComponent::__l1_handler_DeclarerImpl

__constructor_DeclarerImpl

Fully qualified path: openzeppelin_account::account::AccountComponent::__constructor_DeclarerImpl

__external_DeployableImpl

Fully qualified path: openzeppelin_account::account::AccountComponent::__external_DeployableImpl

__l1_handler_DeployableImpl

Fully qualified path: openzeppelin_account::account::AccountComponent::__l1_handler_DeployableImpl

__constructor_DeployableImpl

Fully qualified path: openzeppelin_account::account::AccountComponent::__constructor_DeployableImpl

__external_PublicKeyImpl

Fully qualified path: openzeppelin_account::account::AccountComponent::__external_PublicKeyImpl

__l1_handler_PublicKeyImpl

Fully qualified path: openzeppelin_account::account::AccountComponent::__l1_handler_PublicKeyImpl

__constructor_PublicKeyImpl

Fully qualified path: openzeppelin_account::account::AccountComponent::__constructor_PublicKeyImpl

__external_SRC6CamelOnlyImpl

Fully qualified path: openzeppelin_account::account::AccountComponent::__external_SRC6CamelOnlyImpl

__l1_handler_SRC6CamelOnlyImpl

Fully qualified path: openzeppelin_account::account::AccountComponent::__l1_handler_SRC6CamelOnlyImpl

__constructor_SRC6CamelOnlyImpl

Fully qualified path: openzeppelin_account::account::AccountComponent::__constructor_SRC6CamelOnlyImpl

__external_PublicKeyCamelImpl

Fully qualified path: openzeppelin_account::account::AccountComponent::__external_PublicKeyCamelImpl

__l1_handler_PublicKeyCamelImpl

Fully qualified path: openzeppelin_account::account::AccountComponent::__l1_handler_PublicKeyCamelImpl

__constructor_PublicKeyCamelImpl

Fully qualified path: openzeppelin_account::account::AccountComponent::__constructor_PublicKeyCamelImpl

__external_AccountMixinImpl

Fully qualified path: openzeppelin_account::account::AccountComponent::__external_AccountMixinImpl

__l1_handler_AccountMixinImpl

Fully qualified path: openzeppelin_account::account::AccountComponent::__l1_handler_AccountMixinImpl

__constructor_AccountMixinImpl

Fully qualified path: openzeppelin_account::account::AccountComponent::__constructor_AccountMixinImpl

Free functions

Free functions

unsafe_new_component_state

Fully qualified path: openzeppelin_account::account::AccountComponent::unsafe_new_component_state

pub fn unsafe_new_component_state<TContractState>() -> ComponentState<TContractState>

Structs

Structs

Storage

Fully qualified path: openzeppelin_account::account::AccountComponent::Storage

[storage]
pub struct Storage {
    pub Account_public_key: felt252,
}

Members

Account_public_key

Fully qualified path: openzeppelin_account::account::AccountComponent::Storage::Account_public_key

pub Account_public_key: felt252

OwnerAdded

Fully qualified path: openzeppelin_account::account::AccountComponent::OwnerAdded

[derive(Drop, Debug, PartialEq, starknet::Event)]
pub struct OwnerAdded {
    pub new_owner_guid: felt252,
}

Members

new_owner_guid

Fully qualified path: openzeppelin_account::account::AccountComponent::OwnerAdded::new_owner_guid

pub new_owner_guid: felt252

OwnerRemoved

Fully qualified path: openzeppelin_account::account::AccountComponent::OwnerRemoved

[derive(Drop, Debug, PartialEq, starknet::Event)]
pub struct OwnerRemoved {
    pub removed_owner_guid: felt252,
}

Members

removed_owner_guid

Fully qualified path: openzeppelin_account::account::AccountComponent::OwnerRemoved::removed_owner_guid

pub removed_owner_guid: felt252

ComponentState

Fully qualified path: openzeppelin_account::account::AccountComponent::ComponentState

pub struct ComponentState<TContractState> {}

Enums

Enums

Event

Event

Fully qualified path: openzeppelin_account::account::AccountComponent::Event

pub enum Event {
    OwnerAdded: OwnerAdded,
    OwnerRemoved: OwnerRemoved,
}

Variants

OwnerAdded

Fully qualified path: openzeppelin_account::account::AccountComponent::Event::OwnerAdded

OwnerAdded: OwnerAdded

OwnerRemoved

Fully qualified path: openzeppelin_account::account::AccountComponent::Event::OwnerRemoved

OwnerRemoved: OwnerRemoved

Traits

Traits

HasComponent

Fully qualified path: openzeppelin_account::account::AccountComponent::HasComponent

pub trait HasComponent<TContractState>

Trait functions

get_component

Fully qualified path: openzeppelin_account::account::AccountComponent::HasComponent::get_component

fn get_component(self: @TContractState) -> @ComponentState<TContractState>

get_component_mut

Fully qualified path: openzeppelin_account::account::AccountComponent::HasComponent::get_component_mut

fn get_component_mut(ref self: TContractState) -> ComponentState<TContractState>

get_contract

Fully qualified path: openzeppelin_account::account::AccountComponent::HasComponent::get_contract

fn get_contract(self: @ComponentState<TContractState>) -> @TContractState

get_contract_mut

Fully qualified path: openzeppelin_account::account::AccountComponent::HasComponent::get_contract_mut

fn get_contract_mut(ref self: ComponentState<TContractState>) -> TContractState

emit

Fully qualified path: openzeppelin_account::account::AccountComponent::HasComponent::emit

fn emit<S, impl IntoImp: Into<S, openzeppelin_account::account::AccountComponent::Event>>(
    ref self: ComponentState<TContractState>, event: S,
)

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

UnsafeNewContractStateTraitForSRC6Impl

Fully qualified path: openzeppelin_account::account::AccountComponent::UnsafeNewContractStateTraitForSRC6Impl

pub trait UnsafeNewContractStateTraitForSRC6Impl<TContractState>

Trait functions

unsafe_new_contract_state

Fully qualified path: openzeppelin_account::account::AccountComponent::UnsafeNewContractStateTraitForSRC6Impl::unsafe_new_contract_state

fn unsafe_new_contract_state() -> TContractState

UnsafeNewContractStateTraitForDeclarerImpl

Fully qualified path: openzeppelin_account::account::AccountComponent::UnsafeNewContractStateTraitForDeclarerImpl

pub trait UnsafeNewContractStateTraitForDeclarerImpl<TContractState>

Trait functions

unsafe_new_contract_state

Fully qualified path: openzeppelin_account::account::AccountComponent::UnsafeNewContractStateTraitForDeclarerImpl::unsafe_new_contract_state

fn unsafe_new_contract_state() -> TContractState

UnsafeNewContractStateTraitForDeployableImpl

Fully qualified path: openzeppelin_account::account::AccountComponent::UnsafeNewContractStateTraitForDeployableImpl

pub trait UnsafeNewContractStateTraitForDeployableImpl<TContractState>

Trait functions

unsafe_new_contract_state

Fully qualified path: openzeppelin_account::account::AccountComponent::UnsafeNewContractStateTraitForDeployableImpl::unsafe_new_contract_state

fn unsafe_new_contract_state() -> TContractState

UnsafeNewContractStateTraitForPublicKeyImpl

Fully qualified path: openzeppelin_account::account::AccountComponent::UnsafeNewContractStateTraitForPublicKeyImpl

pub trait UnsafeNewContractStateTraitForPublicKeyImpl<TContractState>

Trait functions

unsafe_new_contract_state

Fully qualified path: openzeppelin_account::account::AccountComponent::UnsafeNewContractStateTraitForPublicKeyImpl::unsafe_new_contract_state

fn unsafe_new_contract_state() -> TContractState

UnsafeNewContractStateTraitForSRC6CamelOnlyImpl

Fully qualified path: openzeppelin_account::account::AccountComponent::UnsafeNewContractStateTraitForSRC6CamelOnlyImpl

pub trait UnsafeNewContractStateTraitForSRC6CamelOnlyImpl<TContractState>

Trait functions

unsafe_new_contract_state

Fully qualified path: openzeppelin_account::account::AccountComponent::UnsafeNewContractStateTraitForSRC6CamelOnlyImpl::unsafe_new_contract_state

fn unsafe_new_contract_state() -> TContractState

UnsafeNewContractStateTraitForPublicKeyCamelImpl

Fully qualified path: openzeppelin_account::account::AccountComponent::UnsafeNewContractStateTraitForPublicKeyCamelImpl

pub trait UnsafeNewContractStateTraitForPublicKeyCamelImpl<TContractState>

Trait functions

unsafe_new_contract_state

Fully qualified path: openzeppelin_account::account::AccountComponent::UnsafeNewContractStateTraitForPublicKeyCamelImpl::unsafe_new_contract_state

fn unsafe_new_contract_state() -> TContractState

UnsafeNewContractStateTraitForAccountMixinImpl

Fully qualified path: openzeppelin_account::account::AccountComponent::UnsafeNewContractStateTraitForAccountMixinImpl

pub trait UnsafeNewContractStateTraitForAccountMixinImpl<TContractState>

Trait functions

unsafe_new_contract_state

Fully qualified path: openzeppelin_account::account::AccountComponent::UnsafeNewContractStateTraitForAccountMixinImpl::unsafe_new_contract_state

fn unsafe_new_contract_state() -> TContractState

eth_account

Fully qualified path: openzeppelin_account::eth_account

Modules

Modules

Modules

EthAccountComponent

EthAccount Component

The EthAccount component enables contracts to behave as accounts signing with Ethereum keys.

Fully qualified path: openzeppelin_account::eth_account::EthAccountComponent

Modules

Free functions

Structs

Enums

Event

Traits

Modules

Modules

Errors

Fully qualified path: openzeppelin_account::eth_account::EthAccountComponent::Errors

Constants

Constants

Constants

INVALID_CALLER

Fully qualified path: openzeppelin_account::eth_account::EthAccountComponent::Errors::INVALID_CALLER

pub const INVALID_CALLER: felt252 = 111609425190703942063128945407568851162756752710068754602288498;

INVALID_SIGNATURE

Fully qualified path: openzeppelin_account::eth_account::EthAccountComponent::Errors::INVALID_SIGNATURE

pub const INVALID_SIGNATURE: felt252 =
    1872495434060281228044599952954990650829421195675704593774326882595429;

INVALID_TX_VERSION

Fully qualified path: openzeppelin_account::eth_account::EthAccountComponent::Errors::INVALID_TX_VERSION

pub const INVALID_TX_VERSION: felt252 =
    479358831119431994379417587956477606612331826092985369960038669776154478;

UNAUTHORIZED

Fully qualified path: openzeppelin_account::eth_account::EthAccountComponent::Errors::UNAUTHORIZED

pub const UNAUTHORIZED: felt252 = 1703024676371825287828505636715884912155634219360997500260;

__external_SRC6Impl

Fully qualified path: openzeppelin_account::eth_account::EthAccountComponent::__external_SRC6Impl

__l1_handler_SRC6Impl

Fully qualified path: openzeppelin_account::eth_account::EthAccountComponent::__l1_handler_SRC6Impl

__constructor_SRC6Impl

Fully qualified path: openzeppelin_account::eth_account::EthAccountComponent::__constructor_SRC6Impl

__external_DeclarerImpl

Fully qualified path: openzeppelin_account::eth_account::EthAccountComponent::__external_DeclarerImpl

__l1_handler_DeclarerImpl

Fully qualified path: openzeppelin_account::eth_account::EthAccountComponent::__l1_handler_DeclarerImpl

__constructor_DeclarerImpl

Fully qualified path: openzeppelin_account::eth_account::EthAccountComponent::__constructor_DeclarerImpl

__external_DeployableImpl

Fully qualified path: openzeppelin_account::eth_account::EthAccountComponent::__external_DeployableImpl

__l1_handler_DeployableImpl

Fully qualified path: openzeppelin_account::eth_account::EthAccountComponent::__l1_handler_DeployableImpl

__constructor_DeployableImpl

Fully qualified path: openzeppelin_account::eth_account::EthAccountComponent::__constructor_DeployableImpl

__external_PublicKeyImpl

Fully qualified path: openzeppelin_account::eth_account::EthAccountComponent::__external_PublicKeyImpl

__l1_handler_PublicKeyImpl

Fully qualified path: openzeppelin_account::eth_account::EthAccountComponent::__l1_handler_PublicKeyImpl

__constructor_PublicKeyImpl

Fully qualified path: openzeppelin_account::eth_account::EthAccountComponent::__constructor_PublicKeyImpl

__external_SRC6CamelOnlyImpl

Fully qualified path: openzeppelin_account::eth_account::EthAccountComponent::__external_SRC6CamelOnlyImpl

__l1_handler_SRC6CamelOnlyImpl

Fully qualified path: openzeppelin_account::eth_account::EthAccountComponent::__l1_handler_SRC6CamelOnlyImpl

__constructor_SRC6CamelOnlyImpl

Fully qualified path: openzeppelin_account::eth_account::EthAccountComponent::__constructor_SRC6CamelOnlyImpl

__external_PublicKeyCamelImpl

Fully qualified path: openzeppelin_account::eth_account::EthAccountComponent::__external_PublicKeyCamelImpl

__l1_handler_PublicKeyCamelImpl

Fully qualified path: openzeppelin_account::eth_account::EthAccountComponent::__l1_handler_PublicKeyCamelImpl

__constructor_PublicKeyCamelImpl

Fully qualified path: openzeppelin_account::eth_account::EthAccountComponent::__constructor_PublicKeyCamelImpl

__external_EthAccountMixinImpl

Fully qualified path: openzeppelin_account::eth_account::EthAccountComponent::__external_EthAccountMixinImpl

__l1_handler_EthAccountMixinImpl

Fully qualified path: openzeppelin_account::eth_account::EthAccountComponent::__l1_handler_EthAccountMixinImpl

__constructor_EthAccountMixinImpl

Fully qualified path: openzeppelin_account::eth_account::EthAccountComponent::__constructor_EthAccountMixinImpl

Free functions

Free functions

unsafe_new_component_state

Fully qualified path: openzeppelin_account::eth_account::EthAccountComponent::unsafe_new_component_state

pub fn unsafe_new_component_state<TContractState>() -> ComponentState<TContractState>

Structs

Structs

Storage

Fully qualified path: openzeppelin_account::eth_account::EthAccountComponent::Storage

[storage]
pub struct Storage {
    pub EthAccount_public_key: Secp256k1Point,
}

Members

EthAccount_public_key

Fully qualified path: openzeppelin_account::eth_account::EthAccountComponent::Storage::EthAccount_public_key

pub EthAccount_public_key: Secp256k1Point

OwnerAdded

Fully qualified path: openzeppelin_account::eth_account::EthAccountComponent::OwnerAdded

[derive(Drop, Debug, PartialEq, starknet::Event)]
pub struct OwnerAdded {
    pub new_owner_guid: felt252,
}

Members

new_owner_guid

Fully qualified path: openzeppelin_account::eth_account::EthAccountComponent::OwnerAdded::new_owner_guid

pub new_owner_guid: felt252

OwnerRemoved

Fully qualified path: openzeppelin_account::eth_account::EthAccountComponent::OwnerRemoved

[derive(Drop, Debug, PartialEq, starknet::Event)]
pub struct OwnerRemoved {
    pub removed_owner_guid: felt252,
}

Members

removed_owner_guid

Fully qualified path: openzeppelin_account::eth_account::EthAccountComponent::OwnerRemoved::removed_owner_guid

pub removed_owner_guid: felt252

ComponentState

Fully qualified path: openzeppelin_account::eth_account::EthAccountComponent::ComponentState

pub struct ComponentState<TContractState> {}

Enums

Enums

Event

Event

Fully qualified path: openzeppelin_account::eth_account::EthAccountComponent::Event

pub enum Event {
    OwnerAdded: OwnerAdded,
    OwnerRemoved: OwnerRemoved,
}

Variants

OwnerAdded

Fully qualified path: openzeppelin_account::eth_account::EthAccountComponent::Event::OwnerAdded

OwnerAdded: OwnerAdded

OwnerRemoved

Fully qualified path: openzeppelin_account::eth_account::EthAccountComponent::Event::OwnerRemoved

OwnerRemoved: OwnerRemoved

Traits

Traits

HasComponent

Fully qualified path: openzeppelin_account::eth_account::EthAccountComponent::HasComponent

pub trait HasComponent<TContractState>

Trait functions

get_component

Fully qualified path: openzeppelin_account::eth_account::EthAccountComponent::HasComponent::get_component

fn get_component(self: @TContractState) -> @ComponentState<TContractState>

get_component_mut

Fully qualified path: openzeppelin_account::eth_account::EthAccountComponent::HasComponent::get_component_mut

fn get_component_mut(ref self: TContractState) -> ComponentState<TContractState>

get_contract

Fully qualified path: openzeppelin_account::eth_account::EthAccountComponent::HasComponent::get_contract

fn get_contract(self: @ComponentState<TContractState>) -> @TContractState

get_contract_mut

Fully qualified path: openzeppelin_account::eth_account::EthAccountComponent::HasComponent::get_contract_mut

fn get_contract_mut(ref self: ComponentState<TContractState>) -> TContractState

emit

Fully qualified path: openzeppelin_account::eth_account::EthAccountComponent::HasComponent::emit

fn emit<S, impl IntoImp: Into<S, openzeppelin_account::eth_account::EthAccountComponent::Event>>(
    ref self: ComponentState<TContractState>, event: S,
)

InternalTrait

Fully qualified path: openzeppelin_account::eth_account::EthAccountComponent::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::eth_account::EthAccountComponent::InternalTrait::initializer

fn initializer(ref self: ComponentState<TContractState>, public_key: Secp256k1Point)

assert_only_self

Validates that the caller is the account itself. Otherwise it reverts.

Fully qualified path: openzeppelin_account::eth_account::EthAccountComponent::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::eth_account::EthAccountComponent::InternalTrait::assert_valid_new_owner

fn assert_valid_new_owner(
    self: @ComponentState<TContractState>,
    current_owner: Secp256k1Point,
    new_owner: Secp256k1Point,
    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::eth_account::EthAccountComponent::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::eth_account::EthAccountComponent::InternalTrait::_set_public_key

fn _set_public_key(ref self: ComponentState<TContractState>, new_public_key: Secp256k1Point)

_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::eth_account::EthAccountComponent::InternalTrait::_is_valid_signature

fn _is_valid_signature(
    self: @ComponentState<TContractState>, hash: felt252, signature: Span<felt252>,
) -> bool

UnsafeNewContractStateTraitForSRC6Impl

Fully qualified path: openzeppelin_account::eth_account::EthAccountComponent::UnsafeNewContractStateTraitForSRC6Impl

pub trait UnsafeNewContractStateTraitForSRC6Impl<TContractState>

Trait functions

unsafe_new_contract_state

Fully qualified path: openzeppelin_account::eth_account::EthAccountComponent::UnsafeNewContractStateTraitForSRC6Impl::unsafe_new_contract_state

fn unsafe_new_contract_state() -> TContractState

UnsafeNewContractStateTraitForDeclarerImpl

Fully qualified path: openzeppelin_account::eth_account::EthAccountComponent::UnsafeNewContractStateTraitForDeclarerImpl

pub trait UnsafeNewContractStateTraitForDeclarerImpl<TContractState>

Trait functions

unsafe_new_contract_state

Fully qualified path: openzeppelin_account::eth_account::EthAccountComponent::UnsafeNewContractStateTraitForDeclarerImpl::unsafe_new_contract_state

fn unsafe_new_contract_state() -> TContractState

UnsafeNewContractStateTraitForDeployableImpl

Fully qualified path: openzeppelin_account::eth_account::EthAccountComponent::UnsafeNewContractStateTraitForDeployableImpl

pub trait UnsafeNewContractStateTraitForDeployableImpl<TContractState>

Trait functions

unsafe_new_contract_state

Fully qualified path: openzeppelin_account::eth_account::EthAccountComponent::UnsafeNewContractStateTraitForDeployableImpl::unsafe_new_contract_state

fn unsafe_new_contract_state() -> TContractState

UnsafeNewContractStateTraitForPublicKeyImpl

Fully qualified path: openzeppelin_account::eth_account::EthAccountComponent::UnsafeNewContractStateTraitForPublicKeyImpl

pub trait UnsafeNewContractStateTraitForPublicKeyImpl<TContractState>

Trait functions

unsafe_new_contract_state

Fully qualified path: openzeppelin_account::eth_account::EthAccountComponent::UnsafeNewContractStateTraitForPublicKeyImpl::unsafe_new_contract_state

fn unsafe_new_contract_state() -> TContractState

UnsafeNewContractStateTraitForSRC6CamelOnlyImpl

Fully qualified path: openzeppelin_account::eth_account::EthAccountComponent::UnsafeNewContractStateTraitForSRC6CamelOnlyImpl

pub trait UnsafeNewContractStateTraitForSRC6CamelOnlyImpl<TContractState>

Trait functions

unsafe_new_contract_state

Fully qualified path: openzeppelin_account::eth_account::EthAccountComponent::UnsafeNewContractStateTraitForSRC6CamelOnlyImpl::unsafe_new_contract_state

fn unsafe_new_contract_state() -> TContractState

UnsafeNewContractStateTraitForPublicKeyCamelImpl

Fully qualified path: openzeppelin_account::eth_account::EthAccountComponent::UnsafeNewContractStateTraitForPublicKeyCamelImpl

pub trait UnsafeNewContractStateTraitForPublicKeyCamelImpl<TContractState>

Trait functions

unsafe_new_contract_state

Fully qualified path: openzeppelin_account::eth_account::EthAccountComponent::UnsafeNewContractStateTraitForPublicKeyCamelImpl::unsafe_new_contract_state

fn unsafe_new_contract_state() -> TContractState

UnsafeNewContractStateTraitForEthAccountMixinImpl

Fully qualified path: openzeppelin_account::eth_account::EthAccountComponent::UnsafeNewContractStateTraitForEthAccountMixinImpl

pub trait UnsafeNewContractStateTraitForEthAccountMixinImpl<TContractState>

Trait functions

unsafe_new_contract_state

Fully qualified path: openzeppelin_account::eth_account::EthAccountComponent::UnsafeNewContractStateTraitForEthAccountMixinImpl::unsafe_new_contract_state

fn unsafe_new_contract_state() -> TContractState

extensions

Fully qualified path: openzeppelin_account::extensions

Modules

src9

Re-exports:


Modules

Modules

src9

src9

Fully qualified path: openzeppelin_account::extensions::src9

Modules


Re-exports:



Modules

Modules

snip12_utils

Fully qualified path: openzeppelin_account::extensions::src9::snip12_utils

Constants

Impls

Constants

Constants

OUTSIDE_EXECUTION_TYPE_HASH

Fully qualified path: openzeppelin_account::extensions::src9::snip12_utils::OUTSIDE_EXECUTION_TYPE_HASH

pub const OUTSIDE_EXECUTION_TYPE_HASH: felt252 =
    1389993921274322046375090584689199791730207455988644802284406561556793335567;

CALL_TYPE_HASH

Fully qualified path: openzeppelin_account::extensions::src9::snip12_utils::CALL_TYPE_HASH

pub const CALL_TYPE_HASH: felt252 =
    1532494794213978114698445795943389740361164528080484821528531616582786100393;

Impls

Impls

CallStructHash

Fully qualified path: openzeppelin_account::extensions::src9::snip12_utils::CallStructHash

pub impl CallStructHash of StructHash<Call>;

Impl functions

hash_struct

Fully qualified path: openzeppelin_account::extensions::src9::snip12_utils::CallStructHash::hash_struct

fn hash_struct(self: @Call) -> felt252

OutsideExecutionStructHash

Fully qualified path: openzeppelin_account::extensions::src9::snip12_utils::OutsideExecutionStructHash

pub impl OutsideExecutionStructHash of StructHash<OutsideExecution>;

Impl functions

hash_struct

Fully qualified path: openzeppelin_account::extensions::src9::snip12_utils::OutsideExecutionStructHash::hash_struct

fn hash_struct(self: @OutsideExecution) -> felt252

src9

Fully qualified path: openzeppelin_account::extensions::src9::src9

Modules

Modules

Modules

SRC9Component

SRC9 Component (Outside Execution)

The SRC9 component allows a protocol to submit transactions on behalf of a user account, as long as they provide the relevant signatures.

This component is designed to be account agnostic, as long as the contract implements the ISRC6 interface.

Fully qualified path: openzeppelin_account::extensions::src9::src9::SRC9Component

Modules

Free functions

Structs

Enums

Event

Traits

Impls

Modules

Modules

Errors

Fully qualified path: openzeppelin_account::extensions::src9::src9::SRC9Component::Errors

Constants

Constants

Constants

INVALID_CALLER

Fully qualified path: openzeppelin_account::extensions::src9::src9::SRC9Component::Errors::INVALID_CALLER

pub const INVALID_CALLER: felt252 = 475680751081174049698716115999338770025514034546;

INVALID_AFTER

Fully qualified path: openzeppelin_account::extensions::src9::src9::SRC9Component::Errors::INVALID_AFTER

pub const INVALID_AFTER: felt252 = 133892228332280848098431280661449449936853217964070993327842674;

INVALID_BEFORE

Fully qualified path: openzeppelin_account::extensions::src9::src9::SRC9Component::Errors::INVALID_BEFORE

pub const INVALID_BEFORE: felt252 =
    34276410453063897113198408529895793025711350725551390250446582373;

DUPLICATED_NONCE

Fully qualified path: openzeppelin_account::extensions::src9::src9::SRC9Component::Errors::DUPLICATED_NONCE

pub const DUPLICATED_NONCE: felt252 = 31174213702855815911140334579741639588446766470423397;

INVALID_SIGNATURE

Fully qualified path: openzeppelin_account::extensions::src9::src9::SRC9Component::Errors::INVALID_SIGNATURE

pub const INVALID_SIGNATURE: felt252 = 7980598707931090565390095200801962697615335207267037797;

__external_OutsideExecutionV2Impl

Fully qualified path: openzeppelin_account::extensions::src9::src9::SRC9Component::__external_OutsideExecutionV2Impl

__l1_handler_OutsideExecutionV2Impl

Fully qualified path: openzeppelin_account::extensions::src9::src9::SRC9Component::__l1_handler_OutsideExecutionV2Impl

__constructor_OutsideExecutionV2Impl

Fully qualified path: openzeppelin_account::extensions::src9::src9::SRC9Component::__constructor_OutsideExecutionV2Impl

Free functions

Free functions

unsafe_new_component_state

Fully qualified path: openzeppelin_account::extensions::src9::src9::SRC9Component::unsafe_new_component_state

pub fn unsafe_new_component_state<TContractState>() -> ComponentState<TContractState>

Structs

Structs

Storage

Fully qualified path: openzeppelin_account::extensions::src9::src9::SRC9Component::Storage

[storage]
pub struct Storage {
    pub SRC9_nonces: Map<felt252, bool>,
}

Members

SRC9_nonces

Fully qualified path: openzeppelin_account::extensions::src9::src9::SRC9Component::Storage::SRC9_nonces

pub SRC9_nonces: Map<felt252, bool>

ComponentState

Fully qualified path: openzeppelin_account::extensions::src9::src9::SRC9Component::ComponentState

pub struct ComponentState<TContractState> {}

Enums

Enums

Event

Event

Fully qualified path: openzeppelin_account::extensions::src9::src9::SRC9Component::Event

pub enum Event {}

Traits

Traits

HasComponent

Fully qualified path: openzeppelin_account::extensions::src9::src9::SRC9Component::HasComponent

pub trait HasComponent<TContractState>

Trait functions

get_component

Fully qualified path: openzeppelin_account::extensions::src9::src9::SRC9Component::HasComponent::get_component

fn get_component(self: @TContractState) -> @ComponentState<TContractState>

get_component_mut

Fully qualified path: openzeppelin_account::extensions::src9::src9::SRC9Component::HasComponent::get_component_mut

fn get_component_mut(ref self: TContractState) -> ComponentState<TContractState>

get_contract

Fully qualified path: openzeppelin_account::extensions::src9::src9::SRC9Component::HasComponent::get_contract

fn get_contract(self: @ComponentState<TContractState>) -> @TContractState

get_contract_mut

Fully qualified path: openzeppelin_account::extensions::src9::src9::SRC9Component::HasComponent::get_contract_mut

fn get_contract_mut(ref self: ComponentState<TContractState>) -> TContractState

emit

Fully qualified path: openzeppelin_account::extensions::src9::src9::SRC9Component::HasComponent::emit

fn emit<
    S, impl IntoImp: Into<S, openzeppelin_account::extensions::src9::src9::SRC9Component::Event>,
>(
    ref self: ComponentState<TContractState>, event: S,
)

InternalTrait

Fully qualified path: openzeppelin_account::extensions::src9::src9::SRC9Component::InternalTrait

pub trait InternalTrait<
    TContractState,
    +HasComponent<TContractState>,
    impl SRC5: HasComponent<TContractState>,
    +Drop<TContractState>,
>

Trait functions

initializer

Initializes the account by registering the ISRC9_V2 interface ID.

Fully qualified path: openzeppelin_account::extensions::src9::src9::SRC9Component::InternalTrait::initializer

fn initializer(ref self: ComponentState<TContractState>)

UnsafeNewContractStateTraitForOutsideExecutionV2Impl

Fully qualified path: openzeppelin_account::extensions::src9::src9::SRC9Component::UnsafeNewContractStateTraitForOutsideExecutionV2Impl

pub trait UnsafeNewContractStateTraitForOutsideExecutionV2Impl<TContractState>

Trait functions

unsafe_new_contract_state

Fully qualified path: openzeppelin_account::extensions::src9::src9::SRC9Component::UnsafeNewContractStateTraitForOutsideExecutionV2Impl::unsafe_new_contract_state

fn unsafe_new_contract_state() -> TContractState

Impls

Impls

SNIP12MetadataImpl

Fully qualified path: openzeppelin_account::extensions::src9::src9::SRC9Component::SNIP12MetadataImpl

pub impl SNIP12MetadataImpl of SNIP12Metadata;

Impl functions

name

Fully qualified path: openzeppelin_account::extensions::src9::src9::SRC9Component::SNIP12MetadataImpl::name

fn name() -> felt252

version

Fully qualified path: openzeppelin_account::extensions::src9::src9::SRC9Component::SNIP12MetadataImpl::version

fn version() -> felt252

utils

Fully qualified path: openzeppelin_account::utils

Modules

Constants

Free functions

is_tx_version_validIf the transaction is a simulation (version >= QUERY_OFFSET ), it must be greater than or equal to QUERY_OFFSET + MIN_TRANSACTION_VERSION to be considered valid….

Re-exports:

is_valid_eth_signatureThis function assumes the s component of the signature to be positive for efficiency reasons. It is not recommended to use it other than for…
is_valid_p256_signatureThis function assumes the s component of the signature to be positive for efficiency reasons. It is not recommended to use it other than for…
is_valid_stark_signatureThis function assumes the s component of the signature to be positive for efficiency reasons. It is not recommended to use it other than for…

Modules

Modules

secp256_point

Fully qualified path: openzeppelin_account::utils::secp256_point

signature

Fully qualified path: openzeppelin_account::utils::signature

Free functions

is_valid_stark_signatureThis function assumes the s component of the signature to be positive for efficiency reasons. It is not recommended to use it other than for…
is_valid_eth_signatureThis function assumes the s component of the signature to be positive for efficiency reasons. It is not recommended to use it other than for…
is_valid_p256_signatureThis function assumes the s component of the signature to be positive for efficiency reasons. It is not recommended to use it other than for…

Structs

Secp256SignatureA signature format compatible with the family of secp256 curves.

Free functions

Free functions

is_valid_stark_signatureThis function assumes the s component of the signature to be positive for efficiency reasons. It is not recommended to use it other than for…
is_valid_eth_signatureThis function assumes the s component of the signature to be positive for efficiency reasons. It is not recommended to use it other than for…
is_valid_p256_signatureThis function assumes the s component of the signature to be positive for efficiency reasons. It is not recommended to use it other than for…

is_valid_stark_signature

This function assumes the s component of the signature to be positive for efficiency reasons. It is not recommended to use it other than for validating account signatures over transaction hashes since otherwise it’s not protected against signature malleability. See https://github.com/OpenZeppelin/cairo-contracts/issues/889.

Fully qualified path: openzeppelin_account::utils::signature::is_valid_stark_signature

pub fn is_valid_stark_signature(
    msg_hash: felt252, public_key: felt252, signature: Span<felt252>,
) -> bool

is_valid_eth_signature

This function assumes the s component of the signature to be positive for efficiency reasons. It is not recommended to use it other than for validating account signatures over transaction hashes since otherwise it’s not protected against signature malleability. See https://github.com/OpenZeppelin/cairo-contracts/issues/889.

Fully qualified path: openzeppelin_account::utils::signature::is_valid_eth_signature

pub fn is_valid_eth_signature(
    msg_hash: felt252, public_key: Secp256k1Point, signature: Span<felt252>,
) -> bool

is_valid_p256_signature

This function assumes the s component of the signature to be positive for efficiency reasons. It is not recommended to use it other than for validating account signatures over transaction hashes since otherwise it’s not protected against signature malleability. See https://github.com/OpenZeppelin/cairo-contracts/issues/889.

Fully qualified path: openzeppelin_account::utils::signature::is_valid_p256_signature

pub fn is_valid_p256_signature(
    msg_hash: felt252, public_key: Secp256r1Point, signature: Span<felt252>,
) -> bool

Structs

Structs

Secp256SignatureA signature format compatible with the family of secp256 curves.

Secp256Signature

A signature format compatible with the family of secp256 curves.

Fully qualified path: openzeppelin_account::utils::signature::Secp256Signature

[derive(Copy, Drop, Serde)]
pub struct Secp256Signature {
    pub r: u256,
    pub s: u256,
}

Members

r

Fully qualified path: openzeppelin_account::utils::signature::Secp256Signature::r

pub r: u256

s

Fully qualified path: openzeppelin_account::utils::signature::Secp256Signature::s

pub s: u256

Constants

Constants

MIN_TRANSACTION_VERSION

Fully qualified path: openzeppelin_account::utils::MIN_TRANSACTION_VERSION

pub const MIN_TRANSACTION_VERSION: u256 = 1;

QUERY_OFFSET

Fully qualified path: openzeppelin_account::utils::QUERY_OFFSET

pub const QUERY_OFFSET: u256 = 340282366920938463463374607431768211456;

QUERY_VERSION

Fully qualified path: openzeppelin_account::utils::QUERY_VERSION

pub const QUERY_VERSION: u256 = 340282366920938463463374607431768211457;

Free functions

Free functions

is_tx_version_validIf the transaction is a simulation (version >= QUERY_OFFSET ), it must be greater than or equal to QUERY_OFFSET + MIN_TRANSACTION_VERSION to be considered valid….

is_tx_version_valid

If the transaction is a simulation (version >= QUERY_OFFSET), it must be greater than or equal to QUERY_OFFSET + MIN_TRANSACTION_VERSION to be considered valid. Otherwise, it must be greater than or equal to MIN_TRANSACTION_VERSION.

Fully qualified path: openzeppelin_account::utils::is_tx_version_valid

pub fn is_tx_version_valid() -> bool

openzeppelin_interfaces

Fully qualified path: openzeppelin_interfaces

Modules

account

Modules

Modules

account

account

Fully qualified path: openzeppelin_interfaces::account

Modules

src9

Modules

Modules

src9

src9

Fully qualified path: openzeppelin_interfaces::account::src9

Structs

Structs

Structs

OutsideExecution

Fully qualified path: openzeppelin_interfaces::account::src9::OutsideExecution

[derive(Copy, Drop, Serde)]
pub struct OutsideExecution {
    pub caller: ContractAddress,
    pub nonce: felt252,
    pub execute_after: u64,
    pub execute_before: u64,
    pub calls: Span<Call>,
}

Members

caller

Fully qualified path: openzeppelin_interfaces::account::src9::OutsideExecution::caller

pub caller: ContractAddress

nonce

Fully qualified path: openzeppelin_interfaces::account::src9::OutsideExecution::nonce

pub nonce: felt252

execute_after

Fully qualified path: openzeppelin_interfaces::account::src9::OutsideExecution::execute_after

pub execute_after: u64

execute_before

Fully qualified path: openzeppelin_interfaces::account::src9::OutsideExecution::execute_before

pub execute_before: u64

calls

Fully qualified path: openzeppelin_interfaces::account::src9::OutsideExecution::calls

pub calls: Span<Call>