@@ -24,6 +24,8 @@ pub enum DataKey {
2424 Backers ( String ) ,
2525 Votes ( String ) ,
2626 Milestones ( String ) ,
27+ WhitelistedTokens ( String ) ,
28+ RefundedTokens ( String ) ,
2729}
2830
2931#[ contracterror]
@@ -32,10 +34,15 @@ pub enum DataKey {
3234pub enum BoundlessError {
3335 /// Contract has already been initialized
3436 AlreadyInitialized = 1 ,
37+ /// Invalid user authorization for action
3538 Unauthorized = 2 ,
39+ /// Project with the given ID already exists
3640 AlreadyExists = 3 ,
41+ /// Project with the given ID does not exist
3742 NotFound = 4 ,
43+ /// Invalid funding target amount
3844 InvalidFundingTarget = 5 ,
45+ /// Invalid milestone count
3946 InvalidMilestone = 6 ,
4047 /// Project is closed
4148 ProjectClosed = 7 ,
@@ -63,6 +70,12 @@ pub enum BoundlessError {
6370 InvalidOperation = 18 ,
6471 /// Internal error
6572 InternalError = 19 ,
73+ /// Token contract has already been whitelisted
74+ AlreadyWhitelisted = 20 ,
75+ /// Token contract has not been whitelisted
76+ InvalidTokenContract = 21 ,
77+ /// No backers found for the project
78+ NoBackerContributions = 22 ,
6679}
6780
6881/// Enum representing the current status of a project
@@ -182,6 +195,8 @@ pub struct BackerContribution {
182195 pub backer : Address ,
183196 /// Amount contributed
184197 pub amount : u64 ,
198+ /// Token contract address
199+ pub token : Address ,
185200 /// Timestamp of contribution
186201 pub timestamp : u64 ,
187202}
@@ -201,23 +216,41 @@ pub struct Vote {
201216#[ derive( Clone ) ]
202217#[ contracttype]
203218pub struct Project {
219+ /// Unique identifier for the project
204220 pub project_id : String ,
221+ /// Project creator's address
205222 pub creator : Address ,
223+ /// Project metadata external URI
206224 pub metadata_uri : String ,
225+ /// Funding target amount
207226 pub funding_target : u64 ,
227+ /// Total number of milestones
208228 pub milestone_count : u32 ,
229+ /// Current milestone number (0-based index)
209230 pub current_milestone : u32 ,
231+ /// Total amount funded so far
210232 pub total_funded : u64 ,
211- pub backers : Vec < ( Address , u64 ) > ,
233+ /// List of backers and their contributions
234+ pub backers : Vec < ( Address , u64 , Address ) > ,
235+ /// List of votes cast on project
212236 pub votes : Vec < ( Address , i32 ) > ,
237+ /// Flag indicating if project has been validated
213238 pub validated : bool ,
239+ /// Flag indicating if project was successful
214240 pub is_successful : bool ,
241+ /// Flag indicating if project has been closed
215242 pub is_closed : bool ,
243+ /// Timestamp when the project was created
216244 pub created_at : u64 ,
245+ /// List of milestone approvals (milestone number and approval status)
217246 pub milestone_approvals : Vec < ( u32 , bool ) > ,
247+ /// List of milestone releases (milestone number and release timestamp)
218248 pub milestone_releases : Vec < ( u32 , u64 ) > ,
249+ /// Flag indicating if all refunds have been processed
219250 pub refund_processed : bool ,
251+ /// Timestamp when project funding period ends
220252 pub funding_deadline : u64 ,
253+ /// Timestamp when project voting period ends
221254 pub voting_deadline : u64 ,
222255 /// Current status of the project
223256 pub status : ProjectStatus ,
0 commit comments