Skip to content

Commit

Permalink
fix: Remove the ability to configure the governor
Browse files Browse the repository at this point in the history
Re-configuration needs to be implemented so that it does not affect past proposals for safety reasons

So we need to store a versioned configuration instead of the current design which has a single configuration

This can be done in a future version of the governance contracts
  • Loading branch information
moodysalem committed May 6, 2024
1 parent 83c9e51 commit 2d6c9e6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 12 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ Contracts in this repository are designed so that they may be used together _or_
- Proposals can be canceled at any time by _anyone_ iff the voting weight of the proposer falls below the proposal creation threshold, up until it is executed
- The proposer may also cancel the proposal at any time before the end of the voting period
- Proposers may only have one active proposal at any time
- The contract can be reconfigured or upgraded via calls to self
- The contract can be upgraded via calls to self

## Testing

Expand Down
12 changes: 1 addition & 11 deletions src/governor.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ pub trait IGovernor<TContractState> {
// Attaches the given text to the proposal. Simply emits an event containing the proposal description.
fn describe(ref self: TContractState, id: felt252, description: ByteArray);

// Get the configuration for this governor contract.
// Get the staker that is used by this governor contract.
fn get_staker(self: @TContractState) -> IStakerDispatcher;

// Get the configuration for this governor contract.
Expand All @@ -71,9 +71,6 @@ pub trait IGovernor<TContractState> {
// Get the proposal info for the given proposal id.
fn get_proposal(self: @TContractState, id: felt252) -> ProposalInfo;

// Configure the delay and the window for call execution. This must be self-called via #queue.
fn configure(ref self: TContractState, config: Config);

// Replace the code at this address. This must be self-called via #queue.
fn upgrade(ref self: TContractState, class_hash: ClassHash);
}
Expand Down Expand Up @@ -403,13 +400,6 @@ pub mod Governor {
self.proposals.read(id)
}


fn configure(ref self: ContractState, config: Config) {
self.check_self_call();

self.config.write(config);
}

fn upgrade(ref self: ContractState, class_hash: ClassHash) {
self.check_self_call();

Expand Down

0 comments on commit 2d6c9e6

Please sign in to comment.