Skip to content

Commit

Permalink
feat: apply review updates
Browse files Browse the repository at this point in the history
  • Loading branch information
ericnordelo committed Dec 2, 2024
1 parent 17fc3e6 commit 0b9848d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 76 deletions.
7 changes: 4 additions & 3 deletions docs/modules/ROOT/pages/api/governance.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ Returns the weight of the vote.
[[IGovernor-cast_vote_with_reason_and_params_by_sig]]
==== `[.contract-item-name]#++cast_vote_with_reason_and_params_by_sig++#++(proposal_id: felt252, support: u8, voter: ContractAddress, reason: ByteArray, params: Span<felt252>, signature: Span<felt252>) → u256++` [.item-kind]#external#

Cast a vote on a proposal with a reason and additional encoded parameters using the voter's signature.
Cast a vote on a proposal with a reason and additional encoded parameters using the ``voter``'s signature.

Returns the weight of the vote.

Expand Down Expand Up @@ -954,7 +954,7 @@ Emits a {VoteCast} event.
[[GovernorComponent-cast_vote_with_reason_and_params_by_sig]]
==== `[.contract-item-name]#++cast_vote_with_reason_and_params_by_sig++#++(proposal_id: felt252, support: u8, voter: ContractAddress, reason: ByteArray, params: Span<felt252>, signature: Span<felt252>) → u256++` [.item-kind]#external#

Cast a vote with a `reason` and additional serialized `params` using the `voter`'s
Cast a vote with a `reason` and additional serialized `params` using the ``voter``'s
signature.

Requirements:
Expand Down Expand Up @@ -1953,7 +1953,8 @@ Ensures the caller is the executor (the timelock controller in this case).
[[GovernorTimelockExecutionComponent-timelock_salt]]
==== `[.contract-item-name]#++timelock_salt++#++(self: @ContractState, description_hash: felt252) → felt252++` [.item-kind]#internal#

Computes the `TimelockController` operation salt.
Computes the `TimelockController` operation salt as the XOR of
the governor address and `description_hash`.

It is computed with the governor address itself to avoid collisions across
governor instances using the same timelock.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,8 @@ pub mod GovernorTimelockExecutionComponent {
governor_component.assert_only_governance();
}

/// Computes the `TimelockController` operation salt.
/// Computes the `TimelockController` operation salt as the XOR of
/// the governor address and `description_hash`.
///
/// It is computed with the governor address itself to avoid collisions across
/// governor instances using the same timelock.
Expand Down
72 changes: 0 additions & 72 deletions packages/governance/src/governor/interface.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ pub const IGOVERNOR_ID: felt252 = 0x1100a1f8546595b5bd75a6cd8fcc5b015370655e66f2
#[starknet::interface]
pub trait IERC6372<TState> {
/// Clock used for flagging checkpoints.
/// Can be overridden to implement block number based checkpoints (and voting).
fn clock(self: @TState) -> u64;

/// Description of the clock.
Expand Down Expand Up @@ -215,74 +214,3 @@ pub trait IGovernor<TState> {
/// NOTE: If the executor is simply the governor itself, use of `relay` is redundant.
fn relay(ref self: TState, call: Call);
}

pub trait IGovernor2 {
fn name() -> felt252;

fn version() -> felt252;

fn COUNTING_MODE() -> ByteArray;

fn hash_proposal(calls: Span<Call>, description_hash: felt252) -> felt252;

// fn state(proposal_id: felt252) -> ProposalState;

fn proposal_threshold() -> u256;

fn proposal_snapshot(proposal_id: felt252) -> u64;

fn proposal_deadline(proposal_id: felt252) -> u64;

fn proposal_proposer(proposal_id: felt252) -> ContractAddress;

fn proposal_eta(proposal_id: felt252) -> u64;

fn proposal_needs_queuing(proposal_id: felt252) -> bool;

fn voting_delay() -> u64;

fn voting_period() -> u64;

fn quorum(timepoint: u64) -> u256;

fn get_votes(account: ContractAddress, timepoint: u64) -> u256;

fn get_votes_with_params(
account: ContractAddress, timepoint: u64, params: Span<felt252>
) -> u256;

fn has_voted(proposal_id: felt252, account: ContractAddress) -> bool;

fn propose(calls: Span<Call>, description: ByteArray) -> felt252;

fn queue(calls: Span<Call>, description_hash: felt252) -> felt252;

fn execute(calls: Span<Call>, description_hash: felt252) -> felt252;

fn cancel(calls: Span<Call>, description_hash: felt252) -> felt252;

fn cast_vote(proposal_id: felt252, support: u8) -> u256;

fn cast_vote_with_reason(proposal_id: felt252, support: u8, reason: ByteArray) -> u256;

fn cast_vote_with_reason_and_params(
proposal_id: felt252, support: u8, reason: ByteArray, params: Span<felt252>
) -> u256;

fn cast_vote_by_sig(
proposal_id: felt252, support: u8, voter: ContractAddress, signature: Span<felt252>
) -> u256;

fn cast_vote_with_reason_and_params_by_sig(
proposal_id: felt252,
support: u8,
voter: ContractAddress,
reason: ByteArray,
params: Span<felt252>,
signature: Span<felt252>
) -> u256;

fn nonces(voter: ContractAddress) -> felt252;

fn relay(call: Call);
}

0 comments on commit 0b9848d

Please sign in to comment.