Skip to content

Commit

Permalink
fix set state in withdrawn method
Browse files Browse the repository at this point in the history
  • Loading branch information
EmmanuelAR committed Nov 9, 2024
1 parent 47faf2c commit 5f7f4af
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions contracts/src/fund.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,10 @@ pub mod Fund {
let caller = get_caller_address();
let valid_address_1 = contract_address_const::<FundManagerConstants::VALID_ADDRESS_1>();
let valid_address_2 = contract_address_const::<FundManagerConstants::VALID_ADDRESS_2>();
assert!(valid_address_1 == caller || valid_address_2 == caller, "Only Admins can change the fund state.");
assert!(
valid_address_1 == caller || valid_address_2 == caller,
"Only Admins can change the fund state."
);
self.state.write(state);
}
fn getState(self: @ContractState) -> u8 {
Expand All @@ -224,7 +227,8 @@ pub mod Fund {
self.token_dispatcher().approve(valid_address, fund_manager_amount);
self.token_dispatcher().transfer(valid_address, fund_manager_amount);
assert(self.get_current_goal_state() == 0, 'Pending stks to withdraw');
self.setState(4);
self.state.write(FundStates::WITHDRAW);

self
.emit(
DonationWithdraw {
Expand Down

0 comments on commit 5f7f4af

Please sign in to comment.