Audit · firm’s term: review
QuillAudits reviewed Memeswap (Memeswap - Change Review) on 28 Nov 2024: 7 findings, 0 critical; 5 marked fixed, 2 open.
Report hosted on quillaudits.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 | 0 | 0 |
| Medium | 0 | 0 | 0 |
| Low | 2 | 0 | 5 |
The deployFarm function in the MemeswapFarmFactory contract does not enforce a minimum reward rate for farms during deployment. This allows deployers to create farms with a reward rate of zero. Users who stake in such farms will bear gas costs for staking and removing tokens without receiving any rewards, leading to a poor user experience.
The Check-Effects-Interactions (CFI) pattern ensures that internal state updates occur before any external calls. This minimizes the risk of reentrancy attacks and unintended side effects.In the MemeswapFarm contract, the stake and exit functions violate this pattern. External calls to untrusted contracts or tokens are made before updating internal state variables, creating potential risks. While the contract implements ReentrancyGuard, following the Check-Effects-Interactions pattern is still considered best practice to enhance security and robustness.
Within the smart contracts, the current use of postfix incrementation (i++) in loops is identified as a less gas-efficient practice. Switching to prefix incrementation (++i) to update uint variables inside loops can yield gas savings. This optimization opportunity applies to loop iterators and any increment operations within the loop's body. The efficiency gain stems from how Solidity handles these two operations at the bytecode level, with prefix incrementation slightly more gas-efficient due to its direct modification of the variable's state without storing an intermediate value.
In smart contracts, there is a recurring pattern of initializing loop variables and accu- mulators to their default values. While common and clear for understanding, this practice introduces unnecessary operations, as Solidity automatically initializes variables to their default values. Specifically, instances of loop counters being set to 0 (uint256 i = 0) and accumulators being initialized to 0 can be optimized by leveraging Solidity's default initialization to reduce bytecode size and potentially gas costs during contract deployment.
The Memeswap contracts import Ownable.sol from OpenZeppelin, which includes a renounceOwnership function. This function transfers ownership to the zero address (ad- dress(0)), effectively removing the contract owner. As a result, any functions restricted by the on- lyOwner modifier will become inaccessible if renounceOwnership is called, either intentionally, by mistake, or due to malicious activity. This can lead to a scenario where the contract is permanently locked, making it impossible to manage or upgrade the contract, or to access critical functionalities.
The report names a repository or files. Open the report to see its scope.
Repository and files the report names (15)
350 projects reviewed · 459 reports · latest Apr 2025
See QuillAudits’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