InternalExtendedTrait
Fully qualified path: openzeppelin_governance::governor::governor::GovernorComponent::InternalExtendedTrait
pub trait InternalExtendedTrait<TContractState, +HasComponent<TContractState>, impl HasComponent<TContractState>: HasComponent<TContractState>, +GovernorCountingTrait<TContractState>, +GovernorExecutionTrait<TContractState>, impl GovernorSettings: GovernorSettingsTrait<TContractState>, impl GovernorVotes: GovernorVotesTrait<TContractState>, +Drop<TContractState>>
Trait functions
assert_only_governance
Asserts that the caller is the governance executor.
WARNING: When the executor is not the governor itself (i.e. a timelock), it can call functions that are restricted with this modifier, and also potentially execute transactions on behalf of the governor. Because of this, this module is designed to work with the TimelockController as the unique potential external executor. The timelock MUST have the governor as the only proposer, canceller, and executor.
Fully qualified path: openzeppelin_governance::governor::governor::GovernorComponent::InternalExtendedTrait::assert_only_governance
fn assert_only_governance(self: @ComponentState<TContractState>)
validate_state
Validates that the proposal is in one of the expected states.
Fully qualified path: openzeppelin_governance::governor::governor::GovernorComponent::InternalExtendedTrait::validate_state
fn validate_state(
self: @ComponentState<TContractState>,
proposal_id: felt252,
allowed_states: Span<ProposalState>,
)
use_nonce
Consumes a nonce, returns the current value, and increments nonce.
Fully qualified path: openzeppelin_governance::governor::governor::GovernorComponent::InternalExtendedTrait::use_nonce
fn use_nonce(ref self: ComponentState<TContractState>, voter: ContractAddress) -> felt252
_get_votes
Internal wrapper for GovernorVotesTrait::get_votes.
Fully qualified path: openzeppelin_governance::governor::governor::GovernorComponent::InternalExtendedTrait::_get_votes
fn _get_votes(
self: @ComponentState<TContractState>,
account: ContractAddress,
timepoint: u64,
params: Span<felt252>,
) -> u256
_proposal_threshold
Internal wrapper for GovernorProposeTrait::proposal_threshold.
Fully qualified path: openzeppelin_governance::governor::governor::GovernorComponent::InternalExtendedTrait::_proposal_threshold
fn _proposal_threshold(self: @ComponentState<TContractState>) -> u256
_state
Returns the state of a proposal, given its id.
Requirements:
- The proposal must exist.
Fully qualified path: openzeppelin_governance::governor::governor::GovernorComponent::InternalExtendedTrait::_state
fn _state(self: @ComponentState<TContractState>, proposal_id: felt252) -> ProposalState
_propose
Internal propose mechanism. Returns the proposal id.
Requirements:
- The proposal must not already exist.
Emits a ProposalCreated event.
Fully qualified path: openzeppelin_governance::governor::governor::GovernorComponent::InternalExtendedTrait::_propose
fn _propose(
ref self: ComponentState<TContractState>,
calls: Span<Call>,
description: @ByteArray,
proposer: ContractAddress,
) -> felt252
_cancel
Internal cancel mechanism with minimal restrictions. A proposal can be cancelled in any state other than Canceled or Executed.
NOTE: Once cancelled, a proposal can’t be re-submitted.
Fully qualified path: openzeppelin_governance::governor::governor::GovernorComponent::InternalExtendedTrait::_cancel
fn _cancel(
ref self: ComponentState<TContractState>, proposal_id: felt252, description_hash: felt252,
)
_count_vote
Internal wrapper for GovernorCountingTrait::count_vote.
Fully qualified path: openzeppelin_governance::governor::governor::GovernorComponent::InternalExtendedTrait::_count_vote
fn _count_vote(
ref self: ComponentState<TContractState>,
proposal_id: felt252,
account: ContractAddress,
support: u8,
total_weight: u256,
params: Span<felt252>,
) -> u256
_cast_vote
Internal vote-casting mechanism.
Checks that the vote is pending and that it has not been cast yet.
This function retrieves the voting weight using get_votes and then calls
the _count_vote internal function.
Emits either:
VoteCastevent if no params are provided.VoteCastWithParamsevent otherwise.
Fully qualified path: openzeppelin_governance::governor::governor::GovernorComponent::InternalExtendedTrait::_cast_vote
fn _cast_vote(
ref self: ComponentState<TContractState>,
proposal_id: felt252,
voter: ContractAddress,
support: u8,
reason: ByteArray,
params: Span<felt252>,
) -> u256