Skip to content

Commit

Permalink
feat: proposal can change amm address
Browse files Browse the repository at this point in the history
  • Loading branch information
DaveVodrazka committed Dec 21, 2023
1 parent 12f8e3c commit 07770aa
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/proposals.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ mod Proposals {

fn assert_correct_contract_type(contract_type: ContractType) {
let contract_type_u: u64 = contract_type.try_into().unwrap();
assert(contract_type_u <= 4, 'invalid contract type')
assert(contract_type_u <= 5, 'invalid contract type')
}

fn assert_voting_in_progress(prop_id: felt252) {
Expand Down
9 changes: 7 additions & 2 deletions src/upgrades.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ mod Upgrades {
use governance::contract::Governance::unsafe_new_contract_state;
use governance::contract::Governance::proposal_appliedContractMemberStateTrait;
use governance::contract::Governance::proposal_detailsContractMemberStateTrait;
use governance::contract::Governance::amm_addressContractMemberStateTrait;
use governance::contract::Governance::airdrop_component::UnsafeNewContractStateTraitForAirdropImpl;
use governance::contract::Governance::airdrop_component;
use governance::contract::Governance::airdrop_component::ComponentState;
Expand Down Expand Up @@ -66,10 +67,14 @@ mod Upgrades {
let mut airdrop_component_state: ComponentState<ContractState> =
Governance::airdrop_component::unsafe_new_component_state();
airdrop_component_state.merkle_root.write(impl_hash);
} else if (contract_type == 4) {
let new_amm_address: ContractAddress = impl_hash.try_into().unwrap();
let mut state = Governance::unsafe_new_contract_state();
state.amm_address.write(new_amm_address);
} else {
assert(
contract_type == 4, 'invalid contract_type'
); // type 4 is no-op, signal vote
contract_type == 5, 'invalid contract_type'
); // type 5 is no-op, signal vote
}
}
}
Expand Down

0 comments on commit 07770aa

Please sign in to comment.