@@ -20,11 +20,18 @@ contract StudentManagerImpl is Initializable, SwMileageTokenFactory, Admin, Paus
2020
2121 SwMileageTokenImpl public _mileageToken;
2222
23- constructor (address mileageToken_ , address tokenImpl ) SwMileageTokenFactory (tokenImpl) {
23+ constructor (
24+ address mileageToken_ ,
25+ address tokenImpl
26+ ) SwMileageTokenFactory (tokenImpl) {
2427 _mileageToken = SwMileageTokenImpl (mileageToken_);
2528 }
2629
27- function initialize (address mileageToken_ , address tokenImpl , address admin ) external initializer {
30+ function initialize (
31+ address mileageToken_ ,
32+ address tokenImpl ,
33+ address admin
34+ ) external initializer {
2835 _mileageToken = SwMileageTokenImpl (mileageToken_);
2936 _addAdmin (admin);
3037 setImplementation (tokenImpl);
@@ -152,17 +159,18 @@ contract StudentManagerImpl is Initializable, SwMileageTokenFactory, Admin, Paus
152159
153160 uint256 documentIndex = documentsCount++ ;
154161 docSubmissions[documentIndex] = DocumentSubmission ({
155- studentId: studentId,
156- docHash: docHash,
157- createdAt: block .timestamp ,
158- status: SubmissionStatus.Pending
162+ studentId: studentId, docHash: docHash, createdAt: block .timestamp , status: SubmissionStatus.Pending
159163 });
160164
161165 emit DocSubmitted (documentIndex, studentId, docHash);
162166 return documentIndex;
163167 }
164168
165- function approveDocument (uint256 documentIndex , uint256 amount , bytes32 reasonHash ) external onlyAdmin {
169+ function approveDocument (
170+ uint256 documentIndex ,
171+ uint256 amount ,
172+ bytes32 reasonHash
173+ ) external onlyAdmin {
166174 if (documentIndex >= documentsCount) revert InvalidDocIndex (documentIndex, documentsCount);
167175 DocumentSubmission storage document = docSubmissions[documentIndex];
168176 if (document.status != SubmissionStatus.Pending) revert NotPendingDocument ();
@@ -197,7 +205,11 @@ contract StudentManagerImpl is Initializable, SwMileageTokenFactory, Admin, Paus
197205
198206 ////////////////////////// admin utilities
199207
200- function mint (bytes32 studentId , address account , uint256 amount ) external onlyAdmin {
208+ function mint (
209+ bytes32 studentId ,
210+ address account ,
211+ uint256 amount
212+ ) external onlyAdmin {
201213 // is valid account, studentId?
202214 if (account == address (0 )) {
203215 account = students[studentId];
@@ -212,7 +224,11 @@ contract StudentManagerImpl is Initializable, SwMileageTokenFactory, Admin, Paus
212224 emit MileageMinted (studentId, account, msg .sender , amount);
213225 }
214226
215- function burnFrom (bytes32 studentId , address account , uint256 amount ) external onlyAdmin {
227+ function burnFrom (
228+ bytes32 studentId ,
229+ address account ,
230+ uint256 amount
231+ ) external onlyAdmin {
216232 // is valid account, studentId?
217233 if (account == address (0 )) {
218234 account = students[studentId];
@@ -227,7 +243,10 @@ contract StudentManagerImpl is Initializable, SwMileageTokenFactory, Admin, Paus
227243 emit MileageBurned (studentId, account, msg .sender , amount);
228244 }
229245
230- function changeAccount (bytes32 studentId , address targetAccount ) external onlyAdmin {
246+ function changeAccount (
247+ bytes32 studentId ,
248+ address targetAccount
249+ ) external onlyAdmin {
231250 if (studentByAddr[targetAccount] != bytes32 (0 )) revert TargetInUse ();
232251 if (targetAccount == address (0 )) revert InvalidTargetAccount ();
233252 address currentAccount = students[studentId];
@@ -251,7 +270,10 @@ contract StudentManagerImpl is Initializable, SwMileageTokenFactory, Admin, Paus
251270 emit AccountChanged (studentId, currentAccount, targetAccount);
252271 }
253272
254- function migrateStudentId (bytes32 currentId , bytes32 nextId ) external onlyAdmin {
273+ function migrateStudentId (
274+ bytes32 currentId ,
275+ bytes32 nextId
276+ ) external onlyAdmin {
255277 if (currentId == bytes32 (0 ) || nextId == bytes32 (0 )) revert EmptyStudentId ();
256278 if (currentId == nextId) revert SameStudentId ();
257279
@@ -271,7 +293,11 @@ contract StudentManagerImpl is Initializable, SwMileageTokenFactory, Admin, Paus
271293 }
272294
273295 // Imediately update student record
274- function updateStudentRecord (bytes32 studentId , address targetAccount , bool _clear ) external onlyAdmin {
296+ function updateStudentRecord (
297+ bytes32 studentId ,
298+ address targetAccount ,
299+ bool _clear
300+ ) external onlyAdmin {
275301 if (studentId == bytes32 (0 )) revert EmptyStudentId ();
276302
277303 address currentAccount = students[studentId];
@@ -290,7 +316,11 @@ contract StudentManagerImpl is Initializable, SwMileageTokenFactory, Admin, Paus
290316 emit StudentRecordUpdated (studentId, currentAccount, targetAccount);
291317 }
292318
293- function transferFromToken (bytes32 fromStudentId , bytes32 toStudentId , uint256 amount ) external onlyAdmin {
319+ function transferFromToken (
320+ bytes32 fromStudentId ,
321+ bytes32 toStudentId ,
322+ uint256 amount
323+ ) external onlyAdmin {
294324 address from = students[fromStudentId];
295325 address to = students[toStudentId];
296326 if (from == address (0 ) || to == address (0 )) revert StudentNotRegistered ();
@@ -307,7 +337,10 @@ contract StudentManagerImpl is Initializable, SwMileageTokenFactory, Admin, Paus
307337 return studentId;
308338 }
309339
310- function _rejectDocument (uint256 documentIndex , bytes32 reasonHash ) internal {
340+ function _rejectDocument (
341+ uint256 documentIndex ,
342+ bytes32 reasonHash
343+ ) internal {
311344 DocumentSubmission storage document = docSubmissions[documentIndex];
312345 document.status = SubmissionStatus.Rejected;
313346
0 commit comments