Skip to content

Commit

Permalink
Add funds constants
Browse files Browse the repository at this point in the history
Add discord channel in readme
  • Loading branch information
EmmanuelAR committed Sep 1, 2024
1 parent c53f290 commit 8c7cabf
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 4 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,11 @@ If you are interested in contributing to Go Stark Me, please follow these steps:
2. Comment on the issue you want to participate in, detailing how you plan to address it and how long you expect it to take.
3. Wait to be assigned to the issue.

Official Discord Channel:
- [Web3Wagers](https://discord.gg/sEpnC6JB2U)

You can also contact us on Telegram:

- [@adrian_vrj](https://t.me/adrian_vrj)
- [@EmmanuelDevCr](https://t.me/EmmanuelDevCr)

1 change: 1 addition & 0 deletions contracts/src/constants/funds.cairo
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
pub mod state_constants;
pub mod fund_constants;
8 changes: 8 additions & 0 deletions contracts/src/constants/funds/fund_constants.cairo
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// *************************************************************************
// FUND CONSTANTS
// *************************************************************************
pub mod FundConstants {
pub const UP_VOTES_NEED_IT: u32 = 1;
pub const INITIAL_UP_VOTES: u32 = 0;
pub const INITIAL_GOAL: u64 = 0;
}
9 changes: 5 additions & 4 deletions contracts/src/fund.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ mod Fund {
use starknet::ContractAddress;
use starknet::get_caller_address;
use gostarkme::constants::{funds::{state_constants::FundStates},};
use gostarkme::constants::{funds::{fund_constants::FundConstants},};


// *************************************************************************
// STORAGE
Expand Down Expand Up @@ -60,9 +62,9 @@ mod Fund {
self.owner.write(owner);
self.name.write(name);
self.reason.write(reason);
self.up_votes.write(0);
self.up_votes.write(FundConstants::INITIAL_UP_VOTES);
self.goal.write(goal);
self.current_goal_state.write(0);
self.current_goal_state.write(FundConstants::INITIAL_GOAL);
self.state.write(FundStates::RECOLLECTING_VOTES);
}

Expand Down Expand Up @@ -100,8 +102,7 @@ mod Fund {
);
self.up_votes.write(self.up_votes.read() + 1);
self.voters.write(get_caller_address(), self.up_votes.read());
// TODO: Validate this
if self.up_votes.read() >= 1 {
if self.up_votes.read() >= FundConstants::UP_VOTES_NEED_IT {
self.state.write(FundStates::RECOLLECTING_DONATIONS);
}
}
Expand Down

0 comments on commit 8c7cabf

Please sign in to comment.