Memeswap

Smart Contract Audit Report

Audit Summary

Memeswap Audit Report Memeswap is building a new platform where users can buy and sell listed tokens.

For this audit, we reviewed the project team's MEMESWAPV1 contract at 0xf6F2637Ab8B5EC7f7E54B7D620062dcaa8F36A9e on the Binance Smart Chain Mainnet.

Audit Findings

No Findings were identified, though some centralized aspects are present.
Date: July 29th, 2022.

Contract Overview

  • Any user can list a token by specifying a token address, a router address, a buy and sell tax, and a fee receiver address.
  • Authorized addresses can also list a token by specifying a token address, a router address, a tax handler address, a buy and sell tax, a fee receiver address, and a token share value.
  • Users must exercise caution when listing a token to avoid using a fee-on-transfer token as it will not be supported by the platform. if a fee-on-transfer token is listed, the contract must be exempt from the token's fee mechanism.
  • Both the buy tax and sell tax cannot exceed 10,000.
  • Authorized addresses can unlist an already listed token at any time.
  • Any user can initiate a buy transaction by specifying a token address, an amount of BNB, and a minimum amount out value to account for slippage.
  • If a Tax handler address was assigned to the Token, the Base tax and Token tax are retrieved from the provided address. The Tax handler contract was out of scope for this audit so we are unable to provide an assessment in regards to security.
  • If a Tax handler address was not assigned to the Token, the Base tax is set to the Buy tax, and the Token tax is set to the token share value set upon the token listing.
  • An owner fee in BNB is charged and sent to the FeeReceiver contract by use of the receiveFees() function. The FeeReceiver contract was out of scope for this audit so we are unable to provide an assessment in regards to security.
  • The BNB collected through the Base tax is sent to the Tax receiver address.
  • The BNB provided by the user is swapped for the token and is sent to the TransferHelper contract.
  • The tokens collected through the Token tax are sent to the Fee receiver set upon the token listing.
  • The Slippage value must not exceed the TransferHelper contract's current token balance.
  • The TransferHelper contract's full token balance is sent to the user.

  • Any user can initiate a sell transaction by specifying a token address, a number of tokens, and a minimum amount out value to account for slippage.
  • If a Tax handler address was assigned to the Token, the Base tax and Token tax are retrieved from the provided address. The Tax handler contract was out of scope for this audit so we are unable to provide an assessment in regards to security.
  • If a Tax handler address was not assigned to the Token, the Base tax is set to the Sell tax, and the Token tax is set to the token share value set upon the token listing.
  • The tokens collected through the Token tax are sent to the fee receiver set upon the token listing.
  • The tokens supplied by the user are swapped for BNB in the TransferHelper contract and is stored in the MEMESWAPV1 contract.
  • An owner fee in BNB is charged and sent to the FeeReceiver contract by use of the receiveFees() function.
  • The BNB collected through the Base tax is sent to the Tax receiver address.
  • The Slippage value must not exceed the contract's current BNB balance.
  • The remaining BNB in the contract is sent to the user.
  • As the contract is implemented with Solidity v0.8.x, it is safe from any possible overflows/underflows.

  • The owner can update the Fee receiver contract address at any time.
  • The owner can add/remove accounts as an Authorized address at any time.
  • Authorized addresses can update the Router address associated with a token at any time.
  • Authorized addresses can update the Buy fee, Sell, fee, and Token share value associated with a token at any time.
  • Authorized addresses can update the Tax handler address associated with a token at any time.
  • Authorized addresses can update the Metadata associated with a token at any time.
  • The owner of a token or the current Tax receiver address can update the Tax receiver address associated with a token at any time.

Audit Results

Vulnerability Category Notes Result
Arbitrary Jump/Storage Write N/A PASS
Centralization of Control Authorized addresses can update the Buy fee, Sell, fee, and Token share value associated with a token at any time. PASS
Compiler Issues N/A PASS
Delegate Call to Untrusted Contract N/A PASS
Dependence on Predictable Variables N/A PASS
Ether/Token Theft N/A PASS
Flash Loans N/A PASS
Front Running N/A PASS
Improper Events N/A PASS
Improper Authorization Scheme N/A PASS
Integer Over/Underflow N/A PASS
Logical Issues N/A PASS
Oracle Issues N/A PASS
Outdated Compiler Version N/A PASS
Race Conditions N/A PASS
Reentrancy N/A PASS
Signature Issues N/A PASS
Unbounded Loops N/A PASS
Unused Code N/A PASS
Overall Contract Safety   PASS

Inheritance Chart

Smart Contract Audit - Inheritance

Function Graph

Smart Contract Audit - Graph

Functions Overview


 ($) = payable function
 # = non-constant function
 
 Int = Internal
 Ext = External
 Pub = Public

 + [Int] IBEP20 
    - [Ext] totalSupply
    - [Ext] decimals
    - [Ext] symbol
    - [Ext] name
    - [Ext] getOwner
    - [Ext] balanceOf
    - [Ext] transfer #
    - [Ext] allowance
    - [Ext] approve #
    - [Ext] transferFrom #

 + [Int] IWETH (IBEP20)
    - [Ext] deposit ($)
    - [Ext] withdraw #

 + [Int] IDEXFactory 
    - [Ext] getPair

 + [Int] IDEXRouter 
    - [Ext] addLiquidity #
    - [Ext] addLiquidityETH ($)
    - [Ext] removeLiquidity #
    - [Ext] removeLiquidityETH #
    - [Ext] removeLiquidityWithPermit #
    - [Ext] removeLiquidityETHWithPermit #
    - [Ext] swapExactTokensForTokens #
    - [Ext] swapTokensForExactTokens #
    - [Ext] swapExactETHForTokens ($)
    - [Ext] swapTokensForExactETH #
    - [Ext] swapExactTokensForETH #
    - [Ext] swapETHForExactTokens ($)
    - [Ext] factory
    - [Ext] WETH
    - [Ext] quote
    - [Ext] getAmountOut
    - [Ext] getAmountIn
    - [Ext] getAmountsOut
    - [Ext] getAmountsIn
    - [Ext] removeLiquidityETHSupportingFeeOnTransferTokens #
    - [Ext] removeLiquidityETHWithPermitSupportingFeeOnTransferTokens #
    - [Ext] swapExactTokensForTokensSupportingFeeOnTransferTokens #
    - [Ext] swapExactETHForTokensSupportingFeeOnTransferTokens ($)
    - [Ext] swapExactTokensForETHSupportingFeeOnTransferTokens #

 +  Ownable 
    - [Pub]  #
    - [Pub] owner
    - [Pub] transferOwnership #
       - modifiers: onlyOwner
    - [Pub] safeTansferOwnership #
       - modifiers: onlyOwner
    - [Ext] acceptOwnership #

 + [Int] ITaxHandler 
    - [Ext] getBuyTax
    - [Ext] getSellTax

 + [Int] IFeeReceiver 
    - [Ext] receiveFees ($)

 +  SwapTransferHelper (Ownable)
    - [Ext] AnnounceRouterChange #
       - modifiers: onlyOwner
    - [Ext] FinalizeRouterChange #
       - modifiers: onlyOwner
    - [Pub]  #
    - [Ext] transferTokens #
    - [Ext] transferTokens #
    - [Ext] swapTokensForETH #
    - [Ext] swapTokensForTokens #

 +  MEMESWAPV1 (Ownable)
    - [Pub]  #
    - [Ext] setFeeReceiver #
       - modifiers: onlyOwner
    - [Ext] Authorize #
       - modifiers: onlyOwner
    - [Ext] ListToken #
    - [Ext] ListToken #
       - modifiers: auth
    - [Ext] UnlistToken #
       - modifiers: auth
    - [Ext] ChangeRouter #
       - modifiers: auth
    - [Ext] ChangeTaxes #
       - modifiers: auth
    - [Ext] ChangeTaxHandler #
       - modifiers: auth
    - [Ext] ChangeTaxReceiver #
    - [Ext] ChangeMetadata #
       - modifiers: auth
    - [Ext] getTaxes
    - [Pub] getTokenAmountOut
    - [Pub] getETHAmountOut
    - [Ext] SellTokens #
       - modifiers: lock
    - [Pub] getETHAmountOut
    - [Ext] BuyTokens ($)
       - modifiers: lock
    - [Pub] getTokenAmountOut
    - [Ext]  ($)
    - [Prv] _swapETHForTokens #

About Solidity Finance

Solidity Finance was founded in 2020 and quickly grew to have one of the most experienced and well-equipped smart contract auditing teams in the industry. Our team has conducted 1300+ solidity smart contract audits covering all major project types and protocols, securing a total of over $10 billion U.S. dollars in on-chain value.
Our firm is well-reputed in the community and is trusted as a top smart contract auditing company for the review of solidity code, no matter how complex. Our team of experienced solidity smart contract auditors performs audits for tokens, NFTs, crowdsales, marketplaces, gambling games, financial protocols, and more!

Contact us today to get a free quote for a smart contract audit of your project!

What is a Solidity Audit?

Typically, a smart contract audit is a comprehensive review process designed to discover logical errors, security vulnerabilities, and optimization opportunities within code. A Solidity Audit takes this a step further by verifying economic logic to ensure the stability of smart contracts and highlighting privileged functionality to create a report that is easy to understand for developers and community members alike.

How Do I Interpret the Findings?

Each of our Findings will be labeled with a Severity level. We always recommend the team resolve High, Medium, and Low severity findings prior to deploying the code to the mainnet. Here is a breakdown on what each Severity level means for the project:

  • High severity indicates that the issue puts a large number of users' funds at risk and has a high probability of exploitation, or the smart contract contains serious logical issues which can prevent the code from operating as intended.
  • Medium severity issues are those which place at least some users' funds at risk and has a medium to high probability of exploitation.
  • Low severity issues have a relatively minor risk association; these issues have a low probability of occurring or may have a minimal impact.
  • Informational issues pose no immediate risk, but inform the project team of opportunities for gas optimizations and following smart contract security best practices.