TRIP FINANCE TOKEN V2.0

Smart Contract Audit Report

Audit Summary

TRIP FINANCE TOKEN V2.0 Audit Report TRIP FINANCE TOKEN V2.0 is a new BEP-20 token that features automatic liquidity adds and pays holders dividends in BSC-USD.

For this audit, we reviewed the project team's TRIPFINANCEV2 and DividendDistributor contract at 0x9b09D900DE2212D622d3dD77A9FCf92A97aDe775 on the Binance Smart Chain Mainnet.

Audit Findings

Please ensure trust in the team prior to investing as they have substantial control in the ecosystem.
Date: April 29th, 2022.

Finding #1 - TRIPFINANCEV2 - Informational

Description: Several state variables can never be modified, but are not declared constant.
DEAD, WBNB, ZERO
Recommendation: These state variables should be declared constant for additional gas savings on each reference.

Contracts Overview

  • The current total supply of the token is ~999.9 million $TRIP [999,927,809].
  • No mint functions are present in the contract.
  • Any user can burn their own tokens to reduce the total supply.
  • At the time of writing this report, there are 799 total token holders. The token allocation is as follows:
    • 30% of the total supply has been sent to the 0x..dead address.
    • The next 3 EOAs own a cumulative 57.5% of the total supply.
    • 5.82% of the total supply is stored in the Farm contract. This contract was out of scope for the purpose of this audit.
    • 1.06% of the total supply is in Pancakeswap-Trip 13 liquidity.
    • Of that liquidity, 99% of the LP tokens are split between 6 EOAs.
    • 1.06% of the total supply is in Pancakeswap-Trip 18 liquidity.
    • Of that liquidity, 91.13% of the LP tokens are stored in an unverified contract.
    • 8.67% of the LP tokens belong to an EOA.

  • Trading must be enabled by the owner in order for all token transfers to successfully take place on the platform. Only Authorized addresses can participate in transfers when trading is disabled.
  • The contract enforces a maximum transaction amount (determined by the owner) which imposes a limit to the number of tokens that can be transferred during any given transaction.
  • The contract enforces a maximum wallet amount that prevents a transfer from occurring if the recipient's token balance will exceed the limit number of tokens (determined by the owner) after the transfer occurs.
  • The contract launch block will be set when a user that holds any number of tokens transfers tokens to the Pair address for the first time.
  • The contract features an Antisniper mechanism that is triggered when a user attempts to transfer tokens within 1 block of the contract launch block. The account initiating the transfer will be taxed at a ~99% rate.
  • The contract features a cool-down mechanism that prevents users from buying tokens via Pancakeswap if the cool-down time (set by the team) since the users' last buy transaction has not yet elapsed.
  • There is a Reflection fee, Liquidity Fee, Marketing Fee, Buyback Fee, Project fee, and Burn fee on all transfers where neither the sender nor the recipient is excluded from fees.
  • Fees are increased by a percentage (set by the team) on all sells via Pancakeswap.
  • Fees can also be increased during a sell to PancakeSwap up to a value proportional to the time left in the buyback multiplier period.
  • The tokens collected from fees are stored in the contract address. The tokens are swapped for BNB for the purpose of funding Pancakeswap liquidity when the following conditions are met:
    • The automatic liquidity add functionality is enabled by the team.
    • The threshold number of tokens (determined by the owner) in the contract address has been reached.
    • The contract is not currently performing an automatic liquidity add or a buyback.
    • The caller is not initiating a buy transaction via Pancakeswap.
  • Liquidity-adds are automatically performed by selling the tokens collected as fees, pairing the received BNB with the token, and adding it as liquidity to the BNB pair.
  • The LP tokens received through this process are sent to the Development address set by the team. We recommend that the team lock these newly acquired LP tokens.
  • The tokens collected from the Marketing Fee and Project fee are swapped for BNB and sent to the team's Marketing Wallet and Project wallet respectively.
  • The tokens collected from the Burn fee are burned to reduce the total supply.
  • The tokens collected from the Reflection Fee are swapped for BNB and sent to the DividendDistributor contract where they are swapped for BSC-USD and distributed as rewards.
  • An automatic buyback will be triggered on token transfers when the following conditions are met:
    • The automatic buyback functionality is enabled by the team.
    • The threshold amount of BNB in the contract address has been reached.
    • The contract is not currently performing an automatic liquidity add or a buyback.
    • The caller is not initiating a buy transaction via Pancakeswap.
    • The cool-down number of blocks (determined by the owner) since the previous buyback has passed.
  • An automatic buyback is performed by swapping an amount of BNB (determined by the owner) in the contract for $TRIP and sending it to the 0x..dead address.
  • Automatic buybacks will be disabled when the total amount of BNB used for buybacks reaches the buyback cap (set by the team).
  • The contract utilizes the SafeMath library to prevent overflows along with following the BEP-20 standard.

  • Any user that holds any amount of $TRIP tokens is eligible to claim dividends once the amount of dividends they are due reaches a minimum threshold value determined by the team.
  • Once dividends are distributed, they will need to be claimed; claiming happens automatically on each transfer.
  • Dividend rewards can also be claimed manually by kicking off the claim cycle, which will process all eligible token holders.
  • Alternatively, a user can manually claim dividends as an individual.
  • There is a wait-time (set by the team) between claiming dividend rewards.
  • Claimed dividends are sent to the user's wallet address.
Ownership Controls:
  • The owner can assign addresses to an Authorized role which can be used to maintain control over various role-restricted functions within the contract.
  • Authorized addresses can set each fee to any percentage at any time.
  • Authorized addresses can set the extra sell fee to any percentage at any time.
  • Authorized addresses can exclude accounts from transfer fees, dividends, the cool-down restriction, and the maximum transaction amount at any time.
  • Authorized addresses can set the maximum transaction amount to any value greater than 0.1% of the current total supply at any time.
  • Authorized addresses can set the maximum wallet amount to any value at any time.
  • Authorized addresses can enable/disable automatic liquidity adds at any time.
  • Authorized addresses can update the threshold number of tokens that triggers automatic liquidity adds to any value at any time.
  • Authorized addresses can enable/disable the automatic buyback mechanism at any time.
  • Authorized addresses can set the automatic buyback cap, BNB threshold value, and block period to any values at any time.
  • Authorized addresses can set the last automatic buyback block to the current block.number at any time.
  • Authorized addresses can update the minimum threshold of dividends a user must be due in order to claim rewards to any value at any time.
  • Authorized addresses can update the wait time between claiming rewards to any value at any time.
  • Authorized addresses can update the maximum amount of gas used for processing to any value up to 750,000 at any time.
  • Authorized addresses can manually trigger a buyback at any time.
  • Authorized addresses can update the buyback multiplier to any value at any time.
  • Authorized addresses can update the Development address, Marketing address, and Project address at any time.
  • Authorized addresses can withdraw all of the BNB from the contract to the team's Marketing wallet at any time.
  • Authorized addresses can set the Reward token to any address at any time. The team should not set the Reward token to an ERC-777 token or a token that allows users to execute a fallback function.
  • The owner can enable/disable trading at any time.
  • The owner can enable/disable the cool-down mechanism at any time.
  • The owner can set the cool-down time to any value at any time.

Audit Results

Vulnerability CategoryNotesResult
Arbitrary Jump/Storage WriteN/APASS
Centralization of Control
  • The LP tokens generated through automatic liquidity adds are sent to the Development address set by the team.
  • The team can set each fee to any percentage at any time.
  • The team can set the Reward token to any address at any time.
WARNING
Compiler IssuesN/APASS
Delegate Call to Untrusted ContractN/APASS
Dependence on Predictable VariablesN/APASS
Ether/Token TheftN/APASS
Flash LoansN/APASS
Front RunningThe Buyback and Automatic Reflection functionality may both be susceptible to front-running; The team must monitor and if suspicious activity is detected, the team must disable these systems. The team should also ensure that no more than 0.1 BNB is used when performing a buyback or when funding the DividendDistributor contract.PASS
Improper EventsN/APASS
Improper Authorization SchemeN/APASS
Integer Over/UnderflowN/APASS
Logical IssuesN/APASS
Oracle IssuesN/APASS
Outdated Compiler VersionN/APASS
Race ConditionsN/APASS
ReentrancyThe Reward token should not be set to an ERC-777 token or a token that allows users to execute a fallback function.WARNING
Signature IssuesN/APASS
Unbounded LoopsN/APASS
Unused CodeN/APASS
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

 + [Lib] SafeMath 
    - [Int] add
    - [Int] sub
    - [Int] sub
    - [Int] mul
    - [Int] div
    - [Int] div

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

 +  Auth 
    - [Pub]  #
    - [Pub] authorize #
       - modifiers: onlyOwner
    - [Pub] unauthorize #
       - modifiers: onlyOwner
    - [Pub] isOwner
    - [Pub] isAuthorized
    - [Pub] transferOwnership #
       - modifiers: onlyOwner

 + [Int] IDEXFactory 
    - [Ext] createPair #

 + [Int] IDEXRouter 
    - [Ext] factory
    - [Ext] WETH
    - [Ext] addLiquidity #
    - [Ext] addLiquidityETH ($)
    - [Ext] swapExactTokensForTokensSupportingFeeOnTransferTokens #
    - [Ext] swapExactETHForTokensSupportingFeeOnTransferTokens ($)
    - [Ext] swapExactTokensForETHSupportingFeeOnTransferTokens #

 + [Int] IDividendDistributor 
    - [Ext] setDistributionCriteria #
    - [Ext] setShare #
    - [Ext] deposit ($)
    - [Ext] process #

 +  DividendDistributor (IDividendDistributor)
    - [Pub]  #
    - [Ext] setDistributionCriteria #
       - modifiers: onlyToken
    - [Ext] setShare #
       - modifiers: onlyToken
    - [Ext] deposit ($)
       - modifiers: onlyToken
    - [Ext] process #
       - modifiers: onlyToken
    - [Int] shouldDistribute
    - [Int] distributeDividend #
    - [Ext] claimDividend #
       - modifiers: onlyToken
    - [Pub] getUnpaidEarnings
    - [Int] getCumulativeDividends
    - [Int] addShareholder #
    - [Int] removeShareholder #
    - [Ext] setDividendTokenAddress #
       - modifiers: onlyToken

 +  TRIPFINANCEV2 (IBEP20, Auth)
    - [Pub]  #
       - modifiers: Auth
    - [Ext]  ($)
    - [Ext] totalSupply
    - [Ext] decimals
    - [Ext] symbol
    - [Ext] name
    - [Ext] getOwner
    - [Pub] balanceOf
    - [Ext] allowance
    - [Pub] approve #
    - [Ext] approveMax #
    - [Ext] transfer #
    - [Ext] transferFrom #
    - [Ext] setMaxWalletPercent #
       - modifiers: onlyOwner
    - [Int] _transferFrom #
    - [Int] _basicTransfer #
    - [Int] checkTxLimit
    - [Int] shouldTakeFee
    - [Pub] getTotalFee
    - [Pub] getMultipliedFee
    - [Int] takeFee #
    - [Int] shouldSwapBack
    - [Int] swapBack #
       - modifiers: swapping
    - [Int] shouldAutoBuyback
    - [Ext] triggerManualBuyback #
       - modifiers: authorized
    - [Ext] clearBuybackMultiplier #
       - modifiers: authorized
    - [Int] triggerAutoBuyback #
    - [Int] buyTokens #
       - modifiers: swapping
    - [Ext] setIsTimelockExempt #
       - modifiers: authorized
    - [Ext] setAutoBuybackSettings #
       - modifiers: authorized
    - [Ext] setBuybackMultiplierSettings #
       - modifiers: authorized
    - [Int] launched
    - [Int] launch #
    - [Ext] setTxLimit #
       - modifiers: authorized
    - [Ext] setIsDividendExempt #
       - modifiers: authorized
    - [Ext] burn #
    - [Int] _burn #
    - [Ext] setIsFeeExempt #
       - modifiers: authorized
    - [Ext] setIsTxLimitExempt #
       - modifiers: authorized
    - [Ext] setFees #
       - modifiers: authorized
    - [Ext] setFeeReceivers #
       - modifiers: authorized
    - [Ext] setSwapBackSettings #
       - modifiers: authorized
    - [Ext] setTargetLiquidity #
       - modifiers: authorized
    - [Ext] manualSend #
       - modifiers: authorized
    - [Ext] setDistributionCriteria #
       - modifiers: authorized
    - [Ext] claimDividendFromOthers #
    - [Ext] claimDividend #
    - [Pub] getUnpaidEarnings
    - [Ext] setDistributorSettings #
       - modifiers: authorized
    - [Pub] getCirculatingSupply
    - [Pub] getLiquidityBacking
    - [Pub] isOverLiquified
    - [Pub] tradingStatus #
       - modifiers: onlyOwner
    - [Ext] setDividendToken #
       - modifiers: authorized
    - [Pub] cooldownEnabled #
       - modifiers: onlyOwner

About SourceHat

SourceHat has quickly grown to have one of the most experienced and well-equipped smart contract auditing teams in the industry. Our team has conducted 1800+ solidity smart contract audits covering all major project types and protocols, securing a total of over $50 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 SourceHat Audit?

Typically, a smart contract audit is a comprehensive review process designed to discover logical errors, security vulnerabilities, and optimization opportunities within code. A SourceHat 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.