Smart Contract Audit Report

Audit Summary

FUJIRO IO Audit Report FUJIRO IO is a new BEP-20 token with an elastic supply that performs automatic liquidity adds.

For this audit, we reviewed the project team's FujiroIO contract at 0x746d6E755D7385688C837f95EFa5984aACb2E9aB 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: March 19th, 2022.

Finding #1 - FujiroIO - Medium (Acknowledged)

Description: The auto-rebase mechanism calls the sync() function on the Pair contract on all transfers; sync() cannot be called on buys otherwise the transaction will revert.
Risk/Impact: All buy transactions will revert on transfers that trigger the auto-rebase mechanism.
Recommendation: The _rebase() function should ensure that the sync() function is not called on a buy transaction. This can be remedied by checking the following condition: !automatedMarketMakerPairs[msg.sender]
Update: The team has acknowledged this issue and does not intend to use the auto-rebase mechanism.

Finding #2 - FujiroIO - Informational

Description: The else block in the _swapAndLiquify() function will never execute as isLiquidityInBnb will always be true.
if (isLiquidityInBnb) {
else {
Recommendation: The else block should either be removed or the team should add functionality that toggles isLiquidityInBnb.

Finding #3 - FujiroIO - Informational

Description: The MAX_FEE_RATE state variable is not used in the contract.
Recommendation: This state variable should either be removed or utilized in a way that fits the project team's intended functionality.

Finding #4 - FujiroIO - Informational

Description: Several state variables can never be modified, but are not declared constant.
DEAD, ZERO, burnFeeBuy, burnFeeSell, busdToken, buyFeeFAF, feeDenominator, isLiquidityInBnb, liquidityFee, sellFeeFAFAdded, sellFeeTreasuryAdded, targetLiquidity, targetLiquidityDenominator, treasuryFee
Recommendation: These state variables should be declared constant for additional gas savings on each call.

Contract Overview

  • The initial supply of the token is set to 5 billion $FUJIRO.
  • The maximum supply of the token is 340,282,366,920,938,463,463,374,607,431,768,211,455 tokens.
  • The owner can trigger a manual rebase; this serves as a frictionless token redistribution which automatically adds tokens for all token holders proportionally at the time of each total supply change.
  • The rebase function calls sync() on the Pancakeswap Pair contract to prevent theft-of-liquidity attacks that have occurred with other rebase tokens.
  • No burn functions are present though the circulating supply can be decreased by sending tokens to the 0x..dead address.
  • At the time of writing this report, there are 1,340 total token holders. The token allocation is as follows:
    • 77% of the total supply is split between 10 separate FujiroVesting contracts. These contracts were out of scope for the purpose of this audit.
    • 18.74% of the total supply belongs to the owner.
    • 0.78% of the total supply has been sent to the 0x..dead address.
    • 0.30% of the total supply is in Pancakeswap liquidity.
    • Of that liquidity, 93.37% of the LP tokens are stored in an unverified contract.

  • The initial distribution period of the contract must be manually disabled by the owner in order for all trading to take place on the platform. Only users that are excluded can transfer tokens while the initial distribution period is enabled.
  • Once the initial distribution period is disabled, it can never be re-enabled.
  • The contract enforces a maximum sell amount (determined by the owner) when selling tokens via Pancakeswap for all accounts that are not excluded.
  • There is a Liquidity fee, Treasury fee, FAF fee, and Burn fee on all transfers where neither the sender nor the recipient is excluded from fees. A separate fee structure is set by the team that applies different fee percentages depending on whether the user is buying or selling during the transfer.
  • The fees charged during transfers 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 in the contract address (determined by the owner) has been reached.
    • The contract is not currently performing an automatic liquidity add.
    • The current total fee amount is greater than 0.
    • The caller is not initiating a buy transaction via Pancakeswap.
  • If the Liquidity during the swap is greater than the target value set by the team, no liquidity will be added. Otherwise, the Liquidity fee is used for an automatic Liquidity-add.
  • 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 Liquidity wallet controlled by the team. We recommend that the team lock these newly acquired LP tokens.
  • The tokens collected from the Treasury fee are swapped for BNB and sent to the team's Treasury wallet.
  • The tokens collected from the FAF fee are swapped for BUSD and sent to the team's Fujiro Assistance wallet.
  • The tokens collected from the Burn fee are sent to the 0x..dead address.
  • Also during transfers, if the "next rebase" time has passed and auto rebase is enabled, tokens are automatically added to the total supply. The newly added tokens are distributed proportionally amongst holders in a frictionless manner.
  • The number of tokens added is dependent on the current total supply, and the ratio between the "reward yield" and the "reward yield denominator"; this ratio defaults to ~0.024% of the current total supply.
  • The contract utilizes SafeMath libraries to prevent any overflows/underflows.
Ownership Controls:
  • The owner can exclude accounts from transfer fees and the maximum sell amount.
  • The owner can toggle the auto rebase functionality and update the next rebase timestamp at any time.
  • The owner can update the rebase frequency to any value up to 15 minutes (in seconds).
  • The owner can update the reward yield and the reward yield denominator to any values at any time.
  • The owner can enable/disable automatic liquidity adds at any time.
  • The owner can update the threshold number of tokens that triggers an automatic liquidity add to any value at any time.
  • The owner can update the maximum sell amount to any value at any time.
  • The owner can add/remove accounts as a Pancakeswap Pair address at any time.
  • The owner can update the team's Liquidity wallet, Treasury wallet, and Fujiro Assistance wallet to any addresses at any time.
  • The owner can enable/disable fees taken on transfers that do not involve Pancakeswap.
  • The owner can withdraw any BNB or tokens from the contract at any time.
  • The owner can manually sync the Pancakeswap Pair contract 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 team's Liquidity wallet.
  • The owner can manually trigger a rebase at any time.
  • The owner can withdraw any tokens and BNB from the contract.
    Compiler IssuesN/APASS
    Delegate Call to Untrusted ContractN/APASS
    Dependence on Predictable VariablesN/APASS
    Ether/Token TheftN/APASS
    Flash LoansN/APASS
    Front RunningN/APASS
    Improper EventsN/APASS
    Improper Authorization SchemeN/APASS
    Integer Over/UnderflowN/APASS
    Logical IssuesThe auto-rebase mechanism calls the sync() function on the Pair contract on buy transactions which will cause the transaction to revert.WARNING
    Oracle IssuesN/APASS
    Outdated Compiler VersionN/APASS
    Race ConditionsN/APASS
    Signature IssuesN/APASS
    Unbounded LoopsN/APASS
    Unused Code
  • The else block in the _swapAndLiquify() function will never execute as isLiquidityInBnb will always be true.
  • The MAX_FEE_RATE state variable is not used in the contract.
  • 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
     + [Lib] SafeMathInt 
        - [Int] mul
        - [Int] div
        - [Int] sub
        - [Int] add
        - [Int] abs
     + [Int] IERC20 
        - [Ext] totalSupply
        - [Ext] balanceOf
        - [Ext] allowance
        - [Ext] transfer #
        - [Ext] approve #
        - [Ext] transferFrom #
     + [Lib] SafeMath 
        - [Int] add
        - [Int] sub
        - [Int] sub
        - [Int] mul
        - [Int] div
        - [Int] div
        - [Int] mod
     + [Int] InterfaceLP 
        - [Ext] sync #
     + [Lib] Roles 
        - [Int] add #
        - [Int] remove #
        - [Int] has
     +  ERC20Detailed (IERC20)
        - [Pub]  #
        - [Pub] name
        - [Pub] symbol
        - [Pub] decimals
     + [Int] IDEXRouter 
        - [Ext] factory
        - [Ext] WETH
        - [Ext] addLiquidity #
        - [Ext] addLiquidityETH ($)
        - [Ext] swapExactTokensForTokensSupportingFeeOnTransferTokens #
        - [Ext] swapExactETHForTokensSupportingFeeOnTransferTokens ($)
        - [Ext] swapExactTokensForETHSupportingFeeOnTransferTokens #
     + [Int] IDEXFactory 
        - [Ext] createPair #
     +  Ownable 
        - [Pub]  #
        - [Pub] owner
        - [Pub] renounceOwnership #
           - modifiers: onlyOwner
        - [Pub] transferOwnership #
           - modifiers: onlyOwner
        - [Int] _transferOwnership #
     +  FujiroIO (ERC20Detailed, Ownable)
        - [Pub]  #
           - modifiers: ERC20Detailed
        - [Ext]  ($)
        - [Ext] totalSupply
        - [Ext] allowance
        - [Pub] balanceOf
        - [Ext] checkFeeExempt
        - [Ext] checkSwapThreshold
        - [Int] shouldRebase
        - [Int] shouldTakeFee
        - [Pub] shouldSwapBack
        - [Pub] getCirculatingSupply
        - [Pub] getLiquidityBacking
        - [Pub] isOverLiquified
        - [Pub] manualSync #
        - [Ext] transfer #
           - modifiers: validRecipient
        - [Int] _basicTransfer #
        - [Int] _transferFrom #
        - [Ext] transferFrom #
           - modifiers: validRecipient
        - [Prv] _swapAndLiquify #
        - [Prv] _addLiquidity #
        - [Prv] _addLiquidityBusd #
        - [Prv] _swapTokensForBNB #
        - [Prv] _swapTokensForBusd #
        - [Int] swapBack #
           - modifiers: swapping
        - [Int] takeFee #
        - [Ext] decreaseAllowance #
        - [Ext] increaseAllowance #
        - [Ext] approve #
        - [Prv] _rebase #
        - [Prv] coreRebase #
        - [Ext] manualRebase #
           - modifiers: onlyOwner
        - [Pub] setAutomatedMarketMakerPair #
           - modifiers: onlyOwner
        - [Ext] setInitialDistributionFinished #
           - modifiers: onlyOwner
        - [Ext] setFeeExempt #
           - modifiers: onlyOwner
        - [Ext] setRebaseFrequency #
           - modifiers: onlyOwner
        - [Ext] setSwapBackSettings #
           - modifiers: onlyOwner
        - [Ext] setFeeReceivers #
           - modifiers: onlyOwner
        - [Ext] clearStuckBalance #
           - modifiers: onlyOwner
        - [Ext] rescueToken #
           - modifiers: onlyOwner
        - [Ext] setAutoRebase #
           - modifiers: onlyOwner
        - [Ext] setRewardYield #
           - modifiers: onlyOwner
        - [Ext] setFeesOnNormalTransfers #
           - modifiers: onlyOwner
        - [Ext] setNextRebase #
           - modifiers: onlyOwner
        - [Ext] setMaxSellTransaction #
           - modifiers: onlyOwner

    About SourceHat

    SourceHat (formerly Solidity Finance - founded in 2020) has quickly grown to have one of the most experienced and well-equipped smart contract auditing teams in the industry. Our team has conducted 1700+ 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.