@@ -22,7 +22,8 @@ program grant_disbursement.aleo {
22
22
recipient_principal_key : address , // The address that can withdraw the principal
23
23
start_timestamp : u64 , // The timestamp at which the grant was created
24
24
cliff_timestamp : u64 , // The timestamp at which the recipient can start withdrawing principal
25
- fully_vested_timestamp : u64 // The timestamp at which the recipient can withdraw the full principal
25
+ fully_vested_timestamp : u64 , // The timestamp at which the recipient can withdraw the full principal
26
+ is_processed : bool // Whether the grant has been processed
26
27
}
27
28
28
29
mapping grants: u8 => Grant;
@@ -44,7 +45,8 @@ program grant_disbursement.aleo {
44
45
recipient_principal_key : GRANTEE_PRINCIPAL_KEY,
45
46
start_timestamp : START_TIMESTAMP,
46
47
cliff_timestamp : CLIFF_TIMESTAMP,
47
- fully_vested_timestamp : FULLY_VESTED_TIMESTAMP
48
+ fully_vested_timestamp : FULLY_VESTED_TIMESTAMP,
49
+ is_processed : false
48
50
};
49
51
50
52
// Add the grant to the mapping
@@ -105,6 +107,8 @@ program grant_disbursement.aleo {
105
107
106
108
// Assert the credits amount is the same
107
109
assert_eq (credits_amount, grant.credits_amount );
110
+ // Assert that the grant has not been processed
111
+ assert (!grant.is_processed );
108
112
109
113
// Update the grant, with the new paleo amount
110
114
let updated_grant: Grant = Grant {
@@ -114,7 +118,8 @@ program grant_disbursement.aleo {
114
118
recipient_principal_key : grant.recipient_principal_key ,
115
119
start_timestamp : grant.start_timestamp ,
116
120
cliff_timestamp : grant.cliff_timestamp ,
117
- fully_vested_timestamp : grant.fully_vested_timestamp
121
+ fully_vested_timestamp : grant.fully_vested_timestamp ,
122
+ is_processed : true
118
123
};
119
124
grants.set (grant_id, updated_grant);
120
125
}
@@ -179,7 +184,8 @@ program grant_disbursement.aleo {
179
184
recipient_principal_key : grant.recipient_principal_key ,
180
185
start_timestamp : grant.start_timestamp ,
181
186
cliff_timestamp : grant.cliff_timestamp ,
182
- fully_vested_timestamp : grant.fully_vested_timestamp
187
+ fully_vested_timestamp : grant.fully_vested_timestamp ,
188
+ is_processed : grant.is_processed
183
189
};
184
190
grants.set (id, updated_grant);
185
191
}
@@ -251,7 +257,8 @@ program grant_disbursement.aleo {
251
257
recipient_principal_key : grant.recipient_principal_key ,
252
258
start_timestamp : grant.start_timestamp ,
253
259
cliff_timestamp : grant.cliff_timestamp ,
254
- fully_vested_timestamp : grant.fully_vested_timestamp
260
+ fully_vested_timestamp : grant.fully_vested_timestamp ,
261
+ is_processed : grant.is_processed
255
262
};
256
263
grants.set (id, updated_grant);
257
264
}
0 commit comments