From b1a1e445a5dd95e71e9f25a70f6cd3e4fcfa0d4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Sojka?= Date: Fri, 17 Nov 2023 13:24:20 +0000 Subject: [PATCH] Remove vote_investor as it's Carmine only --- src/proposals.cairo | 47 --------------------------------------------- 1 file changed, 47 deletions(-) diff --git a/src/proposals.cairo b/src/proposals.cairo index f7db6491..c7d3ad01 100644 --- a/src/proposals.cairo +++ b/src/proposals.cairo @@ -355,51 +355,4 @@ mod Proposals { return constants::MINUS_ONE; // yay_tally < nay_tally } } - - - fn vote_investor(prop_id: felt252, opinion: felt252) { - // Checks - assert( - (opinion == constants::MINUS_ONE) | (opinion == 1), 'opinion must be either 1 or -1' - ); - - let mut state = Governance::unsafe_new_contract_state(); - - let caller_addr = get_caller_address(); - let investor_voting_power: u128 = state.investor_voting_power.read(prop_id); - assert(investor_voting_power != 0, 'caller not whitelisted investor'); - - let curr_vote_status: felt252 = read.@state.proposal_voted_by; - assert(curr_vote_status == 0, 'already voted'); - - assert_voting_in_progress(prop_id); - - // Calculate real voting power - let gov_token_addr = state.governance_token_address.read(); - let total_supply_u256: u256 = IERC20Dispatcher { - contract_address: gov_token_addr - }.totalSupply(); - assert(total_supply_u256.high == 0, 'totalSupply weirdly high'); - let total_supply: u128 = total_supply_u256.low; - let real_investor_voting_power: u128 = total_supply - constants::TEAM_TOKEN_BALANCE; - assert(total_supply >= constants::TEAM_TOKEN_BALANCE, 'total_supply= 0, 'new_votes negative'); - state.proposal_total_nay.write(prop_id, new_votes.into()); - } else { - let curr_votes: u128 = state.proposal_total_yay.read(prop_id); - let new_votes: u128 = curr_votes + vote_power; - assert(new_votes >= 0, 'new_votes negative'); - state.proposal_total_yay.write(prop_id, new_votes.into()); - } - } }