CertiK reviewed USDAntsColony (USDANT Stablecoin) on 15 Feb 2023: 7 findings, 0 critical; 5 marked fixed, 2 acknowledged.
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 | 0 | 2 | 2 |
| Medium | 0 | 0 | 0 |
| Low | 0 | 0 | 3 |
Both of the functions `increaseAllowance()` and `decreaseAllowance()` are incorrectly using `super.approve()`, which makes the two functions the same as the `approve()`. Currently, the `increaseAllowance()` may not increase allowance, and the `decreaseAllowance()` may not decrease allowance. In some cases, this may result in a loss of fund or a failed transaction. ```solidity=118 function increaseAllowance(address spender, uint256 addedValue) public override virtual returns (bool) { require(!blockedAccounts[spender]); require(!blockedAccounts[msg.sender]); if (deprecated) { // Forward user ERC20 methods to upgraded contract if this one is deprecated return UpgradedToken(upgradedAddress).increaseAllowanceByLegacy(spender, addedValue); } else { return super.approve(spender, addedValue); } } function decreaseAllowance(address spender, uint256 subtractedValue) public override virtual returns (bool) { require(!blockedAccounts[spender]); require(!blockedAccounts[msg.sender]); if (deprecated) { // Forward user ERC20 methods to upgraded contract if this one is deprecated return UpgradedToken(upgradedAddress).decreaseAllowanceByLegacy(spender, subtractedValue); } else { return super.approve(spender, subtractedValue); } } ```
Generally, token owner would like to approve some amount allowance to other EOAs or contracts who will be spenders. Then the spenders can spend these tokens from the owner account. This means there are two roles - **owner&spender** that need to be specified. However, the owner was dropped when increasing/decreasing allowance of upgraded tokens to the spender. ```solidty=124 return UpgradedToken(upgradedAddress).increaseAllowanceByLegacy(spender, addedValue); ``` ```solidity=136 return UpgradedToken(upgradedAddress).decreaseAllowanceByLegacy(spender, subtractedValue); ```
The **require** can be used to check for conditions and throw an exception if the condition is not met. It is better to provide a string message containing details about the error that will be passed back to the caller.
The contract is serving as the underlying entity to interact with third-party **UpgradedToken**. The scope of the audit treats third-party entities as black boxes and assumes their functional correctness. However, in the real world, third parties can be compromised and this may lead to lost or stolen assets.
According to the usage of the arguments declared in the function **transferFromByLegacy()**, we infer that the first argument is `spender` and the third argument is `to`. The same issue also exists in the following functions:\ **approveByLegacy**\ `from` -> `owner`\ **decreaseAllowanceByLegacy**\ `addedValue` -> `subtractedValue`
The report names a repository or files. Open the report to see its scope.
Repository and files the report names (1)
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