Memeswap - Change Review

QuillAuditsFiles named in the report

Audit · firm’s term: review

QuillAudits reviewed Memeswap (Memeswap - Change Review) on 28 Nov 2024: 7 findings, 0 critical; 5 marked fixed, 2 open.

No open critical findings
Open the reportOpen Memeswap’s security record

Report hosted on quillaudits.com.

Trustblock does not review code.

Findings7

Statuses are the security firm’s own, from its report.

SeverityOpenAcknowledgedFixed
Critical000
High000
Medium000
Low205
LowFarm Deployment Allows Zero Reward Rate, Leading to Unrewarded Staking and Gas CostsFixed

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.

LowMissing Check-Effects-Interactions PatternFixed

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.

LowOptimizing Gas Usage with Prefix Incrementation in LoopsFixed

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.

LowOptimizing Smart Contract Efficiency by Avoiding Redundant InitializationsFixed

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.

LowRisk of Permanent Contract Lockout due to renounce OwnershipFixed

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.

Contracts in scope

No deployed address is recorded for this audit.

The report names a repository or files. Open the report to see its scope.

Repository and files the report names (15)

  • MemeswapTokenFactory.sol
  • MemeswapPair.sol
  • src/MemeswapFarmFactory.sol
  • src/MemeswapFactory.sol
  • MememeswapFarmFactory.sol
  • MemeswapToken.sol
  • src/MemeswapFarmToken.sol
  • src/MemeswapToken.sol
  • src/MemeswapVault.sol
  • Ownable.sol
  • src/MemeswapFarm.sol
  • MemeswapFarmToken.sol
  • MemeswapVault.sol
  • src/MemeswapTokenFactory.sol
  • MemeswapFarm.sol

Part of Memeswap’s security record

Memeswap
Audits2 audits by 1 firmLast audit Nov 2024, by QuillAudits.
Critical findingsNo open critical findingsAcross 2 reports.
Open Memeswap’s security record

Security firm

QuillAudits

350 projects reviewed · 459 reports · latest Apr 2025

See QuillAudits’s audits

Something 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