Veraswap - Smart Contract Audit Report

Summary

Veraswap Token and DEX Veraswap is a decentralized framework for liquidity control and a liquidity bootstrapping protocol.

We reviewed Verasap's token contract at 0x271c418b045d05a1d52c6bf849d47b5b5b4d769e on the Binance Smart Chain mainnet. We reviewed Veraswap DEX using code provided to us by the team. That code, in flattened form, is available below.
We have now also reviewed Veraswap's staking contracts here.

Notes on the Token:
  • The Veraswap token is designed to be a governance token where 1 token = 1 vote.
  • Token holders can delegate their voting rights to any address. To save gas, users can also do so using an EIP-712 signature.
  • The total supply of the token is 100 million. No minting functions are present.
  • The team controls 8 wallets which hold between 5% and 19% of the token's total supply.
  • 4.5% of the supply is in a staking contract which has been reviewed by our team.
  • Pancakeswap holds 3.27% of the token's supply.
  • 98% of liquidity was locked but is currently unlocked and claimable by the team at any time.
  • The owner has the ability to pause transfers of the token at any time.
  • The owner can also blacklist users transferring using the token at any time.

  • Notes on the Veraswap AMM:
  • The Veraswap AMM is based on the battle-tested Uniswap codebase.
  • The Factory contract will allow users to create liquidity pairs for any token, thereby enabling trading on the platform.
  • The Router contract routes orders to the user-determined pair contract to swap assets.
  • The liquidity provider fee for token swaps is 0.3% of the value transacted.
  • When dealing with tokens that have a fee-on-transfer, the estimated output does not properly subtract the fee. As a result, users of fee-on-transfer tokens must set a slippage percentage prior to executing trades.
  • SafeMath is utilized to prevent overflow issues and TransferHelper to ensure safe transfers.


  • Audit Findings Summary
    • No vulnerabilities from external attackers were identified.
    • Ensure trust in the team as they control a extremely large amount of tokens in proportion to the liquidity pool and liquidity is unlocked. We recommend these tokens after the upcoming launch of the Veraswap AMM.
    • Date: April 25th, 2021

    External Threat Results

    Vulnerability CategoryNotesResult
    Arbitrary Storage WriteN/APASS
    Arbitrary JumpN/APASS
    Delegate Call to Untrusted ContractN/APASS
    Dependence on Predictable VariablesN/APASS
    Deprecated OpcodesN/APASS
    Ether ThiefN/APASS
    ExceptionsN/APASS
    External CallsN/APASS
    Integer Over/UnderflowN/APASS
    Multiple SendsN/APASS
    SuicideN/APASS
    State Change External CallsN/APASS
    Unchecked RetvalN/APASS
    User Supplied AssertionN/APASS
    Critical Solidity CompilerN/APASS
    Overall Contract Safety PASS


    VeraswapSwap Token - Details

    Contract Graph

    Multi-file Token

    
     ($) = payable function
     # = non-constant function
     
     Int = Internal
     Ext = External
     Pub = Public
     
     + [Int] IVrapERC20 
        - [Ext] name
        - [Ext] symbol
        - [Ext] decimals
        - [Ext] totalSupply
        - [Ext] balanceOf
        - [Ext] allowance
        - [Ext] approve #
        - [Ext] transfer #
        - [Ext] transferFrom #
        - [Ext] DOMAIN_SEPARATOR
        - [Ext] PERMIT_TYPEHASH
        - [Ext] nonces
        - [Ext] permit #
    
     + [Lib] SafeMath 
        - [Int] add
        - [Int] sub
        - [Int] mul
    
     +  VrapERC20 (IVrapERC20)
        - [Pub]  #
        - [Int] _mint #
        - [Int] _burn #
        - [Prv] _approve #
        - [Prv] _transfer #
        - [Ext] approve #
        - [Ext] transfer #
        - [Ext] transferFrom #
        - [Ext] permit #
    							


    VeraswapSwap Factory & Pair Contract - Details

    Contract Graph

    Multi-file Token

    
     ($) = payable function
     # = non-constant function
     
     Int = Internal
     Ext = External
     Pub = Public
     
     + [Int] IVrapFactory 
        - [Ext] feeTo
        - [Ext] feeToSetter
        - [Ext] getPair
        - [Ext] allPairs
        - [Ext] allPairsLength
        - [Ext] createPair #
        - [Ext] setFeeTo #
        - [Ext] setFeeToSetter #
    
     + [Int] IVrapPair 
        - [Ext] name
        - [Ext] symbol
        - [Ext] decimals
        - [Ext] totalSupply
        - [Ext] balanceOf
        - [Ext] allowance
        - [Ext] approve #
        - [Ext] transfer #
        - [Ext] transferFrom #
        - [Ext] DOMAIN_SEPARATOR
        - [Ext] PERMIT_TYPEHASH
        - [Ext] nonces
        - [Ext] permit #
        - [Ext] MINIMUM_LIQUIDITY
        - [Ext] factory
        - [Ext] token0
        - [Ext] token1
        - [Ext] getReserves
        - [Ext] price0CumulativeLast
        - [Ext] price1CumulativeLast
        - [Ext] kLast
        - [Ext] mint #
        - [Ext] burn #
        - [Ext] swap #
        - [Ext] skim #
        - [Ext] sync #
        - [Ext] initialize #
    
     + [Int] IVrapERC20 
        - [Ext] name
        - [Ext] symbol
        - [Ext] decimals
        - [Ext] totalSupply
        - [Ext] balanceOf
        - [Ext] allowance
        - [Ext] approve #
        - [Ext] transfer #
        - [Ext] transferFrom #
        - [Ext] DOMAIN_SEPARATOR
        - [Ext] PERMIT_TYPEHASH
        - [Ext] nonces
        - [Ext] permit #
    
     + [Lib] SafeMath 
        - [Int] add
        - [Int] sub
        - [Int] mul
    
     +  VrapERC20 (IVrapERC20)
        - [Pub]  #
        - [Int] _mint #
        - [Int] _burn #
        - [Prv] _approve #
        - [Prv] _transfer #
        - [Ext] approve #
        - [Ext] transfer #
        - [Ext] transferFrom #
        - [Ext] permit #
    
     + [Lib] Math 
        - [Int] min
        - [Int] sqrt
    
     + [Lib] UQ112x112 
        - [Int] encode
        - [Int] uqdiv
    
     + [Int] IERC20 
        - [Ext] name
        - [Ext] symbol
        - [Ext] decimals
        - [Ext] totalSupply
        - [Ext] balanceOf
        - [Ext] allowance
        - [Ext] approve #
        - [Ext] transfer #
        - [Ext] transferFrom #
    
     + [Int] IVrapCallee 
        - [Ext] VrapCall #
    
     +  VrapPair (IVrapPair, VrapERC20)
        - [Pub] getReserves
        - [Prv] _safeTransfer #
        - [Pub]  #
        - [Ext] initialize #
        - [Prv] _update #
        - [Prv] _mintFee #
        - [Ext] mint #
           - modifiers: lock
        - [Ext] burn #
           - modifiers: lock
        - [Ext] swap #
           - modifiers: lock
        - [Ext] skim #
           - modifiers: lock
        - [Ext] sync #
           - modifiers: lock
    
     +  VrapFactory (IVrapFactory)
        - [Pub]  #
        - [Ext] allPairsLength
        - [Ext] createPair #
        - [Ext] setFeeTo #
        - [Ext] setFeeToSetter #
      
    							


    VeraswapSwap Router Contract - Details

    Contract Graph

    Multi-file Token

    
     ($) = payable function
     # = non-constant function
     
     Int = Internal
     Ext = External
     Pub = Public
     
     + [Int] IUniswapV2Factory 
        - [Ext] feeTo
        - [Ext] feeToSetter
        - [Ext] getPair
        - [Ext] allPairs
        - [Ext] allPairsLength
        - [Ext] createPair #
        - [Ext] setFeeTo #
        - [Ext] setFeeToSetter #
    
     + [Lib] TransferHelper 
        - [Int] safeApprove #
        - [Int] safeTransfer #
        - [Int] safeTransferFrom #
        - [Int] safeTransferETH #
    
     + [Int] IVrapRouter01 
        - [Ext] factory
        - [Ext] WETH
        - [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] quote
        - [Ext] getAmountOut
        - [Ext] getAmountIn
        - [Ext] getAmountsOut
        - [Ext] getAmountsIn
    
     + [Int] IVrapRouter02 (IVrapRouter01)
        - [Ext] removeLiquidityETHSupportingFeeOnTransferTokens #
        - [Ext] removeLiquidityETHWithPermitSupportingFeeOnTransferTokens #
    
     + [Int] IUniswapV2Pair 
        - [Ext] name
        - [Ext] symbol
        - [Ext] decimals
        - [Ext] totalSupply
        - [Ext] balanceOf
        - [Ext] allowance
        - [Ext] approve #
        - [Ext] transfer #
        - [Ext] transferFrom #
        - [Ext] DOMAIN_SEPARATOR
        - [Ext] PERMIT_TYPEHASH
        - [Ext] nonces
        - [Ext] permit #
        - [Ext] MINIMUM_LIQUIDITY
        - [Ext] factory
        - [Ext] token0
        - [Ext] token1
        - [Ext] getReserves
        - [Ext] price0CumulativeLast
        - [Ext] price1CumulativeLast
        - [Ext] kLast
        - [Ext] mint #
        - [Ext] burn #
        - [Ext] swap #
        - [Ext] skim #
        - [Ext] sync #
        - [Ext] initialize #
    
     + [Lib] SafeMath 
        - [Int] add
        - [Int] sub
        - [Int] mul
    
     + [Lib] VrapLibrary 
        - [Int] sortTokens
        - [Int] pairFor
        - [Int] getReserves
        - [Int] quote
        - [Int] getAmountOut
        - [Int] getAmountIn
        - [Int] getAmountsOut
        - [Int] getAmountsIn
    
     + [Int] IERC20 
        - [Ext] name
        - [Ext] symbol
        - [Ext] decimals
        - [Ext] totalSupply
        - [Ext] balanceOf
        - [Ext] allowance
        - [Ext] approve #
        - [Ext] transfer #
        - [Ext] transferFrom #
    
     + [Int] IWETH 
        - [Ext] deposit ($)
        - [Ext] transfer #
        - [Ext] withdraw #
    
     +  VrapRouter02 (IVrapRouter02)
        - [Pub]  #
        - [Ext]  ($)
        - [Int] _addLiquidity #
        - [Ext] addLiquidity #
           - modifiers: ensure
        - [Ext] addLiquidityETH ($)
           - modifiers: ensure
        - [Pub] removeLiquidity #
           - modifiers: ensure
        - [Pub] removeLiquidityETH #
           - modifiers: ensure
        - [Ext] removeLiquidityWithPermit #
        - [Ext] removeLiquidityETHWithPermit #
        - [Pub] removeLiquidityETHSupportingFeeOnTransferTokens #
           - modifiers: ensure
        - [Ext] removeLiquidityETHWithPermitSupportingFeeOnTransferTokens #
        - [Int] _swap #
        - [Ext] swapExactTokensForTokens #
           - modifiers: ensure
        - [Ext] swapTokensForExactTokens #
           - modifiers: ensure
        - [Ext] swapExactETHForTokens ($)
           - modifiers: ensure
        - [Ext] swapTokensForExactETH #
           - modifiers: ensure
        - [Ext] swapExactTokensForETH #
           - modifiers: ensure
        - [Ext] swapETHForExactTokens ($)
           - modifiers: ensure
        - [Pub] quote
        - [Pub] getAmountOut
        - [Pub] getAmountIn
        - [Pub] getAmountsOut
        - [Pub] getAmountsIn
    							


    VeraswapSwap Migrator Contract - Details

    Contract Graph

    Multi-file Token

    
     ($) = payable function
     # = non-constant function
     
     Int = Internal
     Ext = External
     Pub = Public
     
     + [Lib] TransferHelper 
        - [Int] safeApprove #
        - [Int] safeTransfer #
        - [Int] safeTransferFrom #
        - [Int] safeTransferETH #
    
     + [Int] IVrapMigrator 
        - [Ext] migrate #
    
     + [Int] IVrapFactory 
        - [Ext] getExchange
    
     + [Int] IVrapExchange 
        - [Ext] balanceOf
        - [Ext] transferFrom #
        - [Ext] removeLiquidity #
        - [Ext] tokenToEthSwapInput #
        - [Ext] ethToTokenSwapInput ($)
    
     + [Int] IVrapRouter01 
        - [Ext] factory
        - [Ext] WETH
        - [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] quote
        - [Ext] getAmountOut
        - [Ext] getAmountIn
        - [Ext] getAmountsOut
        - [Ext] getAmountsIn
    
     + [Int] IERC20 
        - [Ext] name
        - [Ext] symbol
        - [Ext] decimals
        - [Ext] totalSupply
        - [Ext] balanceOf
        - [Ext] allowance
        - [Ext] approve #
        - [Ext] transfer #
        - [Ext] transferFrom #
    
     +  VrapMigrator (IVrapMigrator)
        - [Pub]  #
        - [Ext]  ($)
        - [Ext] migrate #