Skip to content

Commit 6722ca3

Browse files
committed
Launched
1 parent 6f59c3a commit 6722ca3

11 files changed

+896
-307
lines changed

broadcast/Deploy.s.sol/137/run-1727893465.json

+70
Large diffs are not rendered by default.

broadcast/Deploy.s.sol/137/run-1727893616.json

+183
Large diffs are not rendered by default.

broadcast/Deploy.s.sol/137/run-latest.json

+183
Large diffs are not rendered by default.

broadcast/Deploy.s.sol/80002/run-1727888575.json

+70
Large diffs are not rendered by default.

broadcast/Deploy.s.sol/80002/run-1727888695.json

+72
Large diffs are not rendered by default.

broadcast/Deploy.s.sol/80002/run-1727888873.json

+183
Large diffs are not rendered by default.

broadcast/Deploy.s.sol/80002/run-1727893275.json

+70
Large diffs are not rendered by default.

broadcast/Deploy.s.sol/80002/run-latest.json

+21-134
Large diffs are not rendered by default.

deployContarctsAndUpdate.sh

-5
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,6 @@ LATEST_RUN_FILE=$(ls -t broadcast/Deploy.s.sol/$CHAIN_ID_DEC/run-*.json | head -
2929
DAO_ADDRESS=$(jq -r '.transactions[0].contractAddress' "$LATEST_RUN_FILE")
3030
FAUCET_ADDRESS=$(jq -r '.transactions[1].contractAddress' "$LATEST_RUN_FILE")
3131

32-
# Verify contracts
33-
echo "Verifying contracts..."
34-
forge verify-contract $DAO_ADDRESS DAO --chain-id $CHAIN_ID_DEC
35-
forge verify-contract $FAUCET_ADDRESS Faucet --chain-id $CHAIN_ID_DEC
36-
3732
# Update contractConfig.ts
3833
echo "Updating contractConfig.ts..."
3934
cat > client/src/contractConfig.ts << EOL

src/Faucet.sol

+5-5
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ import {IDAO} from "./interfaces/IDAO.sol";
5959
contract Faucet {
6060
IDAO private immutable dao;
6161
mapping(address => uint256) private s_lastRequest;
62-
uint256 private s_fundingAmount = 1e16;
62+
uint256 private s_fundingAmount = 5e17;
6363

6464
uint256 constant COOLDOWN_PERIOD = 3 weeks;
6565

@@ -98,14 +98,14 @@ contract Faucet {
9898
* @dev Only callable by members
9999
*/
100100
function makeFundingRequest() public balanceCheck {
101-
if(!dao.isMember(msg.sender)){
102-
revert OnlyMember();
103-
}
104-
105101
if((s_lastRequest[msg.sender] + COOLDOWN_PERIOD) > block.number){
106102
revert TooSoonSinceLastRequest();
107103
}
108104

105+
if(!dao.isMember(msg.sender)){
106+
revert OnlyMember();
107+
}
108+
109109
(bool success, bytes memory data) = payable(msg.sender).call{value: s_fundingAmount}("");
110110
s_lastRequest[msg.sender] = block.number;
111111

src/interfaces/IDAO.sol

+39-163
Original file line numberDiff line numberDiff line change
@@ -10,192 +10,68 @@ interface IDAO {
1010
bool open;
1111
}
1212

13+
struct Member {
14+
address memberAddress;
15+
string name;
16+
}
17+
1318
struct Proposal {
1419
string proposal;
20+
uint256 timeCreated;
1521
uint256 startBlock;
1622
uint256 endBlock;
1723
uint256 votesFor;
1824
bool passed;
1925
uint256 index;
2026
}
2127

22-
event NewPresident(address newPresident);
23-
event NewVP(address newVP);
24-
event NewProposal(string proposal, uint256 index);
25-
event ProposalPassed(uint256 index);
26-
27-
error OnlyPresident();
28-
error OnlyMember();
29-
error FaucetAlreadySet();
30-
error AlreadyPresident();
31-
error AlreadyVP();
28+
error AddressCantBeZero();
3229
error AlreadyBoard();
3330
error AlreadyMember();
31+
error AlreadyPresident();
32+
error AlreadyVP();
33+
error AlreadyVoted();
34+
error FaucetAlreadySet();
35+
error MeetingAlreadyOpen();
36+
error MeetingNotOpen();
37+
error MustHaveOnePresident();
38+
error NamesMustEqualAddresses();
39+
error NotBoard();
3440
error NotMember();
3541
error NotPresident();
3642
error NotVP();
37-
error NotBoard();
38-
error AddressCantBeZero();
39-
error MustHaveOnePresident();
40-
error MeetingAlreadyOpen();
41-
error MeetingNotOpen();
42-
error ProposalEnded();
43+
error OnlyMember();
44+
error OnlyPresident();
4345
error ProposalAlreadyPassed();
44-
error AlreadyVoted();
45-
error NamesMustEqualAddresses();
46+
error ProposalEnded();
4647

47-
/**
48-
* @notice Set the address of the faucet becuase the DAO must be deployed first
49-
* @dev Only able to be called once
50-
* @dev Only callable by a current president
51-
* @param _faucet Address of the faucet contract
52-
*/
53-
function setFaucet(address _faucet) external;
48+
event NewPresident(address newPresident);
49+
event NewProposal(string proposal, uint256 index);
50+
event NewVP(address newVP);
51+
event ProposalPassed(uint256 index);
5452

55-
/**
56-
* @notice Add a new president to the DAO
57-
* @dev Only callable by a current president
58-
* @param _newPresident Address of new president
59-
*/
53+
function addBoard(address _newBoard) external;
54+
function addMember(address _newMember, string memory _name) external;
55+
function addMultipleBoard(address[] memory _newBoardMembers) external;
56+
function addMultipleMembers(address[] memory _newMembers, string[] memory _newNames) external;
6057
function addPresident(address _newPresident) external;
61-
62-
/**
63-
* @notice Add a new VP to the DAO
64-
* @dev Only callable by a current president
65-
* @param _newVP Address of new VP
66-
*/
6758
function addVP(address _newVP) external;
68-
69-
/**
70-
* @notice Add a new Board member to the DAO
71-
* @dev Only callable by a current president
72-
* @param _newBoard Address of the new Board member
73-
*/
74-
function addBoard(address _newBoard) external;
75-
76-
/**
77-
* @notice Add a new member to the DAO
78-
* @dev Only callable by a current president
79-
* @param _newMember Address of the new member
80-
*/
81-
function addMember(address _newMember) external;
82-
83-
/**
84-
* @notice Add multiple board members at one time
85-
* @dev Only callable by a current president
86-
* @param _newBoardMembers Array of new board member addresses
87-
*/
88-
function addMultipleBoard(address[] calldata _newBoardMembers) external;
89-
90-
/**
91-
* @notice Add multiple members at one time
92-
* @dev Only callable by a current president
93-
* @param _newMembers Array of new member addresses
94-
*/
95-
function addMultipleMembers(address[] calldata _newMembers, string[] calldata _newNames) external;
96-
97-
/**
98-
* @notice Remove president
99-
* @dev Must have at least one president at all times
100-
* @dev Only callable by a current president
101-
* @param _president Address of president to be removed
102-
*/
103-
function removePresident(address _president) external;
104-
105-
/**
106-
* @notice Remove vp
107-
* @dev Only callable by a current president
108-
* @param _vp Address of vp to be removed
109-
*/
110-
function removeVP(address _vp) external;
111-
112-
/**
113-
* @notice Remove a board member from the DAO
114-
* @dev Only callable by a current president
115-
* @param _board Address of the board member to be removed
116-
*/
117-
function removeBoard(address _board) external;
118-
119-
/**
120-
* @notice Remove a member from the DAO
121-
* @dev Only callable by a current president
122-
* @param _member Address of the member to be removed
123-
*/
124-
function removeMember(address _member) external;
125-
126-
/**
127-
* @notice Check if address is a member of the DAO
128-
* @param _member Address to check
129-
*/
130-
function isMember(address _member) external view returns (bool);
131-
132-
/**
133-
* @notice Check is address is a president of the DAO
134-
* @param _president Address to check
135-
*/
136-
function isPresident(address _president) external view returns (bool);
137-
138-
/**
139-
* @notice Create a new meeting
140-
* @dev Only callable by a current president
141-
* @param _topic The topic of the meeting
142-
*/
143-
function newMeeting(string calldata _topic) external;
144-
145-
/**
146-
* @notice Allow a member to check in to the current meeting
147-
* @dev Only callable by members (including board, VP, and president)
148-
*/
14959
function checkIn() external;
150-
151-
/**
152-
* @notice End the current meeting
153-
* @dev Only callable by a current president
154-
*/
15560
function endMeeting() external;
156-
157-
/**
158-
* @notice Get all meetings
159-
* @return An array of all meetings
160-
*/
16161
function getMeetings() external view returns (Meeting[] memory);
162-
163-
/**
164-
* @notice Get if most recent meeting is open
165-
* @return Bool true if meeting is open
166-
*/
167-
function isMeetingOpen() external view returns (bool);
168-
169-
/**
170-
* @notice Check if address has checked into meeting
171-
* @param _member Address to check if it's checked in to meeting
172-
* @return bool is member check in
173-
*/
174-
function isCheckedIn(address _member) external view returns (bool);
175-
176-
/**
177-
* @notice Get the number of meetings a member has attended
178-
* @param _member Address of member to lookup
179-
*/
18062
function getNumberOfMeetingsAttended(address _member) external view returns (uint256);
181-
182-
/**
183-
* @notice Create a new proposal
184-
* @dev Only callable by members (including board, VP, and president)
185-
* @param _proposal The text of the proposal
186-
*/
187-
function newProposal(string calldata _proposal) external;
188-
189-
/**
190-
* @notice Get all proposals
191-
* @return An array of all proposals
192-
*/
19363
function getProposals() external view returns (Proposal[] memory);
194-
195-
/**
196-
* @notice Vote for a specific proposal
197-
* @dev Only callable by members (including board, VP, and president)
198-
* @param _index The index of the proposal to vote for
199-
*/
64+
function isCheckedIn(address _member) external view returns (bool);
65+
function isMeetingOpen() external view returns (bool);
66+
function isMember(address _member) external view returns (bool);
67+
function isPresident(address _president) external view returns (bool);
68+
function membersList() external view returns (Member[] memory);
69+
function newMeeting(string memory _topic) external;
70+
function newProposal(string memory _proposal) external;
71+
function removeBoard(address _board) external;
72+
function removeMember(address _member) external;
73+
function removePresident(address _president) external;
74+
function removeVP(address _vp) external;
75+
function setFaucet(address _faucet) external;
20076
function voteForProposal(uint256 _index) external;
20177
}

0 commit comments

Comments
 (0)