CertiK reviewed Dora Factory (Aptos Grant DAO-Audit) on 28 Oct 2022: 12 findings, 0 critical; 8 marked fixed, 4 open.
Report hosted on skynet.certik.com.
Trustblock does not review code.
Statuses are the security firm’s own, from its report.
| Severity | Open | Acknowledged | Fixed |
|---|---|---|---|
| Critical | 0 | 0 | 0 |
| High | 2 | 0 | 0 |
| Medium | 0 | 0 | 1 |
| Low | 2 | 0 | 7 |
The `min_area` is updated mistakenly. In the `else-if` condition, the `min_area` may not be the current project's `area`. Because the current project's `area` increases at this time, the real `min_area` may come from the previous second smallest project. For example: - Project A has the smallest area at this moment, and its `area` is 10. - Project B is the second smallest project at this moment,, and its `area` is 12. - Someone votes the project A again, and its `area` is 15 now. In this time, the `else-if` condition is met and the `min_area` will be updated to `15`. However, the real `min_area` should be 12, and the `min_area_index` should be the id of project B. ```rust=538 if(area < round.min_area || round.min_area == 0) { round.min_area = area; round.min_area_index = project_id; } else if(round.min_area_index == project_id) { round.min_area = area; }; ``` ```rust=550 if(area < track.min_area || track.min_area == 0) { track.min_area = area; track.min_area_index = project_id; } else if(track.min_area_index == project_id) { track.min_area = area; }; ```
Please confirm which one of following restrictions is more suitable. - `amount > pow_10_decimals / round.voting_unit` - `amount >= pow_10_decimals / round.voting_unit`
The `round_id` is never changed in the while-loop, so it only needs to be checked once. It would be a waste of gas to check every iteration. ```rust=474 while(i < length) { let project_id = *vector::borrow(&project_ids, i); check_project_id(round_id, project_id); let amount = *vector::borrow(&amounts, i); let data = borrow_global_mut<Data>(@QF); let round = vector::borrow_mut(&mut data.rounds, round_id-1); assert!( round.status == ROUND_STATUS__OK, error::invalid_state(ERR_ROUND_STATUS_NOT_OK) ); ... ```
The `event` module is declared in the `aptos_framework`. However, the module `qf` import `event` from the package `aptos_std` as below. ```rust=13 use aptos_std::event; ```
```rust=144 assert!( exists<Data>(@QF), error::already_exists(ERR_NOT_PUBLISHED), ); ``` The error code will be issued when `@QF` has no resource `Data`, so it is not appropriate to use `error::already_exists` here.
Accuracy loss may occur in the calculation of the `votes`. ```rust=508 let votes = amount * round.voting_unit / pow_10_decimals; ```
Many constant variables are declared but never used in the project.
```rust=557 event::emit_event(&mut data.events, QFEvent { type: EVENT_TYPE__VOTE, account: account_addr, round: round_id, project: round.project_number, amount, }); ``` According to the logic of the function `batch_vote()`, the event emitted should record the id of the project being voted.
The report names a repository or files. Open the report to see its scope.
1,044 projects reviewed · 1,393 reports · latest May 2025
See CertiK’s auditsSomething wrong on this page? A missing report, a wrong date, a finding that was fixed since. Tell us and we check it against its source.
Tell us