CertiK reviewed AI Society (AI Society - Audit) on 25 Aug 2023: 5 findings, 1 critical; 1 marked fixed, 3 acknowledged, 1 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 | 1 |
| High | 0 | 2 | 0 |
| Medium | 0 | 1 | 0 |
| Low | 1 | 0 | 0 |
In the following Solidity code snippet, there is a loop intended to iterate through an array of minters and delete specific elements based on a condition. However, the code has a critical flaw that leads to an infinite loop. ```solidity while (i < minters.length) { _minter = minters[i]; if (!minter[_minter]) { minters[i] = minters[minters.length - 1]; delete minters[minters.length - 1]; // minters.length--; } else { i++; } } ``` The issue arises from the use of the `delete` keyword on the last element of the array. While this does reset the value at the specified index to its default value, it does not change the length of the array. As a result, if the last element of the array meets the deletion condition, the loop will continue to iterate over the last element indefinitely, leading to an infinite loop.
| Address | Chain | Source code |
|---|---|---|
| 0x42a7…2af90x42a7797351dfd281a80807196c8508eb70bb2af9 | Chain: Ethereum | Source code: Verified source |
1,044 projects reviewed · 1,375 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