Keyboard shortcuts

Press or to navigate between chapters

Press ? to show this help

Press Esc to hide this help

InternalTrait

Fully qualified path: openzeppelin_governance::timelock::timelock_controller::TimelockControllerComponent::InternalTrait

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

Trait functions

initializer

Initializes the contract by registering support for SRC5 and AccessControl.

This function also configures the contract with the following parameters:

  • min_delay: initial minimum delay in seconds for operations.
  • proposers: accounts to be granted proposer and canceller roles.
  • executors: accounts to be granted executor role.
  • admin: optional account to be granted admin role; disable with zero address.

WARNING: The optional admin can aid with initial configuration of roles after deployment without being subject to delay, but this role should be subsequently renounced in favor of administration through timelocked proposals.

Emits two RoleGranted events for each account in proposers with PROPOSER_ROLE and CANCELLER_ROLE roles.

Emits a RoleGranted event for each account in executors with EXECUTOR_ROLE role.

May emit a RoleGranted event for admin with DEFAULT_ADMIN_ROLE role (if admin is not zero).

Emits MinDelayChanged event.

Fully qualified path: openzeppelin_governance::timelock::timelock_controller::TimelockControllerComponent::InternalTrait::initializer

fn initializer(
    ref self: ComponentState<TContractState>,
    min_delay: u64,
    proposers: Span<ContractAddress>,
    executors: Span<ContractAddress>,
    admin: ContractAddress,
)

assert_only_role

Validates that the caller has the given role. Otherwise it panics.

Fully qualified path: openzeppelin_governance::timelock::timelock_controller::TimelockControllerComponent::InternalTrait::assert_only_role

fn assert_only_role(self: @ComponentState<TContractState>, role: felt252)

assert_only_role_or_open_role

Validates that the caller has the given role. If role is granted to the zero address, then this is considered an open role which allows anyone to be the caller.

Fully qualified path: openzeppelin_governance::timelock::timelock_controller::TimelockControllerComponent::InternalTrait::assert_only_role_or_open_role

fn assert_only_role_or_open_role(self: @ComponentState<TContractState>, role: felt252)

assert_only_self

Validates that the caller is the timelock contract itself. Otherwise it panics.

Fully qualified path: openzeppelin_governance::timelock::timelock_controller::TimelockControllerComponent::InternalTrait::assert_only_self

fn assert_only_self(self: @ComponentState<TContractState>)

_before_call

Private function that checks before execution of an operation’s calls.

Requirements:

  • id must be in the Ready OperationState.
  • predecessor must either be zero or be in the Done OperationState.

Fully qualified path: openzeppelin_governance::timelock::timelock_controller::TimelockControllerComponent::InternalTrait::_before_call

fn _before_call(self: @ComponentState<TContractState>, id: felt252, predecessor: felt252)

_after_call

Private function that checks after execution of an operation’s calls and sets the OperationState of id to Done.

Requirements:

  • id must be in the Ready OperationState.

Fully qualified path: openzeppelin_governance::timelock::timelock_controller::TimelockControllerComponent::InternalTrait::_after_call

fn _after_call(ref self: ComponentState<TContractState>, id: felt252)

_schedule

Private function that schedules an operation that is to become valid after a given delay.

Fully qualified path: openzeppelin_governance::timelock::timelock_controller::TimelockControllerComponent::InternalTrait::_schedule

fn _schedule(ref self: ComponentState<TContractState>, id: felt252, delay: u64)

_execute

Private function that executes an operation’s calls.

Fully qualified path: openzeppelin_governance::timelock::timelock_controller::TimelockControllerComponent::InternalTrait::_execute

fn _execute(ref self: ComponentState<TContractState>, call: Call)