Fastswap Staking - Smart Contract Audit Report

Summary

FastSwap Staking FastSwap is a decentralized exchange and yield farming platform.

We reviewed Fastswap's MasterChef staking contract at 0x5c72CB5F3cf810fed7434FA4e789C1E68e89889a on the Binance Smart Chain mainnet.

Please note we have not reviewed the FastSwap token.

Notes on the Contract:
  • Users can stake various LP tokens into the MasterChef contract into order to earn FastSwap tokens.
  • There is a no fee associated with making a deposit to or withdrawing from the contract.
  • An emergencyWithdraw function exists so users can withdraw without collecting rewards.
  • The owner has the ability to add different types of tokens for staking and update reward rates.
  • The owner can change the start time, end time, and duration of the staking rewards contract.
  • Utilization of SafeMath (or similarily safe functions) across all contracts to prevent overflows.
  • The team must exercise caution when adding tokens to avoid fee-on-transfer and ERC777-compliant tokens.


  • Audit Findings Summary
    • No external threats were identified.
    • Date: September 5th, 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


    FastSwap MasterChef Contract - Details

    Contract Graph

    Multi-file Token

    
     ($) = payable function
     # = non-constant function
     
     Int = Internal
     Ext = External
     Pub = Public
     
     + [Int] IERC20 
        - [Ext] totalSupply
        - [Ext] balanceOf
        - [Ext] transfer #
        - [Ext] allowance
        - [Ext] approve #
        - [Ext] transferFrom #
    
     + [Lib] SafeMath 
        - [Int] tryAdd
        - [Int] trySub
        - [Int] tryMul
        - [Int] tryDiv
        - [Int] tryMod
        - [Int] add
        - [Int] sub
        - [Int] mul
        - [Int] div
        - [Int] mod
        - [Int] sub
        - [Int] div
        - [Int] mod
    
     + [Lib] Address 
        - [Int] isContract
        - [Int] sendValue #
        - [Int] functionCall #
        - [Int] functionCall #
        - [Int] functionCallWithValue #
        - [Int] functionCallWithValue #
        - [Int] functionStaticCall
        - [Int] functionStaticCall
        - [Int] functionDelegateCall #
        - [Int] functionDelegateCall #
        - [Prv] _verifyCallResult
    
     + [Lib] SafeERC20 
        - [Int] safeTransfer #
        - [Int] safeTransferFrom #
        - [Int] safeApprove #
        - [Int] safeIncreaseAllowance #
        - [Int] safeDecreaseAllowance #
        - [Prv] _callOptionalReturn #
    
     + [Lib] EnumerableSet 
        - [Prv] _add #
        - [Prv] _remove #
        - [Prv] _contains
        - [Prv] _length
        - [Prv] _at
        - [Int] add #
        - [Int] remove #
        - [Int] contains
        - [Int] length
        - [Int] at
        - [Int] add #
        - [Int] remove #
        - [Int] contains
        - [Int] length
        - [Int] at
        - [Int] add #
        - [Int] remove #
        - [Int] contains
        - [Int] length
        - [Int] at
    
     +  Context 
        - [Int] _msgSender
        - [Int] _msgData
    
     +  Ownable (Context)
        - [Int]  #
        - [Pub] owner
        - [Pub] renounceOwnership #
           - modifiers: onlyOwner
        - [Pub] transferOwnership #
           - modifiers: onlyOwner
    
     +  MasterChef (Ownable)
        - [Pub]  #
        - [Pub] changeStartTime #
           - modifiers: onlyOwner
        - [Pub] changeEndTime #
           - modifiers: onlyOwner
        - [Pub] changeReward #
           - modifiers: onlyOwner
        - [Pub] changeDuration #
           - modifiers: onlyOwner
        - [Ext] poolLength
        - [Ext] pendingFast
        - [Pub] add #
           - modifiers: onlyOwner
        - [Pub] token #
           - modifiers: onlyManager
        - [Pub] massUpdatePools #
        - [Pub] updatePool #
        - [Pub] deposit #
        - [Pub] withdraw #
        - [Pub] emergencyWithdraw #
        - [Pub] emergencyFastWithdraw #
           - modifiers: onlyOwner
        - [Int] safeFastTransfer #