Smart Contract Audit Report

Audit Summary

OracleCapital Audit Report OracleCapital is a new BEP-20 token on the Binance Smart Chain with an elastic supply that performs automatic liquidity adds and pays dividends to holders in BUSD.

For this audit, we reviewed the project team's OracleCapital contract and DividendDistributor contract at 0x7B7c49DBa058d978aF747e8B4054cF0830A9b491 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: June 9th, 2022.

Finding #1 - OracleCapital - High

Description: The totalFee denominator includes the reflectionFee percentage, but the tokens collected through the reflectionFee are not allocated to any fund in the takeFee() function.
Risk/Impact: 3% of the tokens collected from fees on all transfers are removed from the circulating supply and are not allocated to any fund. As a result, the total supply and percentages of tokens owned by each holder will be inaccurate.
Recommendation: The tokens collected through the reflectionFee should be allocated to the contract address in the takeFee() function, or the totalFee denominator should not include the reflectionFee.
Resolution: The team has not yet addressed this issue.

Finding #2 - OracleCapital - Low

Description: There are nine instances in the takeFee() function where multiplication is performed on the result of a division.

uint256 feeAmount = gonAmount.div(feeDenominator).mul(_totalFee);

uint256 _uplineBuyerReward = gonAmount.div(feeDenominator).mul(15);

feeAmount = gonAmount.div(feeDenominator).mul(_totalFee - 5);

uint256 _uplineReward = gonAmount.div(feeDenominator).mul(15);

feeAmount = gonAmount.div(feeDenominator).mul(_totalFee - 5);

_gonBalances[firePit] = _gonBalances[firePit].add(
_gonBalances[address(this)] = _gonBalances[address(this)].add(
_gonBalances[liquidityFund] = _gonBalances[liquidityFund].add(
_gonBalances[sellFeeFund] = _gonBalances[sellFeeFund].add(gonAmount.div(feeDenominator).mul(sellFee));
Risk/Impact: Division can lead to integer truncation, therefore dividing and subsequently multiplying can cause results to lose precision and become less accurate.
Recommendation: We recommend modifying these calculations to perform all multiplication before division.
Resolution: The team has not yet addressed this issue.

Finding #3 - OracleCapital - Informational

Description: Several state variables can never be modified, but are not declared constant.
_decimals, _name, _symbol, distributorGas, feeDenominator, firepitFee, insuranceFee, liquidityFee, reflectionFee, sellFee, swapEnabled, 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 300,000 $OC.
  • The maximum supply of the token is 330 million [330,000,000] $OC.
  • No mint or burn functions are present, though the circulating supply can be reduced by sending tokens to the 0x..dead address.
  • At the time of writing this report, 100% of the total supply belongs to the owner.

  • Trading must be enabled by the owner before token transfers can take place on the platform. Only Authorized addresses can participate in transfers when trading is disabled. Once trading is enabled it can never be disabled.
  • Blacklisted contracts are not permitted to transfer tokens.
  • There is a 2% Liquidity fee, 3% Reflection fee, 5% Treasury fee, 3% Insurance fee, and 2% FirePit fee on all transfers via Pancakeswap where neither the sender nor the recipient is excluded from fees.
  • There is an additional 4% Sell fee added to all sell transactions via Pancakeswap. The tokens collected through this fee are sent to a wallet controlled by team.
  • The contract features an auto-rebase mechanism that is triggered on token transfers when the following conditions are met:
    • The auto-rebase mechanism is enabled by the team.
    • The token has not reached the maximum supply.
    • The caller is not initiating a buy transaction via Pancakeswap.
    • The contract is not currently swapping tokens, performing a rebase, or performing an automatic liquidity add.
    • 1 hour has passed since this functionality has previously occurred.
  • During a rebase, 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 to the total supply is dependent on the total supply at the time of rebasing and the time since deployment.
  • The rebase function properly calls sync() on the Pancakeswap Pair contract to prevent theft-of-liquidity attacks that have occurred with other rebase tokens.
  • Also during transfers, an automatic liquidity add will occur if at least 1 day has passed since the previous automatic liquidity add.
  • A liquidity-add is funded by selling half of the tokens collected as liquidity 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 address set by the team. We recommend that the team lock these newly acquired LP tokens.
  • The tokens collected through the Treasury fee and Insurance fee are swapped for BNB and sent to the team's Treasury wallet and Insurance wallet respectively.
  • The tokens collected through the FirePit fee are sent to the FirePit address set by the team.
  • The tokens collected through the Reflection fee are swapped for BNB and deposited into the DividendDistributor contract where it is swapped for BUSD and distributed as dividends amongst holders.
  • Any user can add an account as a referral address at any time.
  • If a user has added a referral address, the Treasury fee will be reduced by 2% on all buy and sell transactions via Pancakeswap. Of that 2%, 1.5% of the Treasury fee will be allocated to the user's referral address and the remaining 0.5% will be discounted from the transfer.

  • Any user that holds any number of tokens is eligible to claim dividends once the amount of dividends they are due reaches the minimum threshold value determined by the team.
  • Once dividends are distributed, they will need to be claimed; claiming happens automatically on each transfer.
  • Alternatively, a user can manually claim dividends as an individual.
  • There is a wait-time (determined by the owner) between claiming dividend rewards.
  • Claimed dividends are sent to the user's wallet address.

  • Authorized addresses can enable/disable automatic liquidity adds and the auto-rebase mechanism at any time.
  • Authorized addresses can include/exclude accounts from transfer fees and dividends at any time.
  • Authorized addresses can add/remove contract addresses from the transfer blacklist at any time. EOAs cannot be blacklisted.
  • Authorized addresses can send any BNB from the contract address to the team's Treasury wallet at any time.
  • Authorized addresses can swap all of the $OC in the contract for BNB and send it to the team's Treasury wallet 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 Pancakeswap Pair address, Liquidity address, Treasury address, Insurance address, FirePit address, and Sell fee address to any addresses at any time.
  • The owner can assign a referral address to any account 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 Liquidity address set by the team.
  • The team can withdraw any $OC tokens from the contract at any time.
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 EventsTransfer event not emitted upon burning reflection fee. As a result, the total supply and token allocation shown on BscScan will not be accurate.WARNING
Improper Authorization SchemeN/APASS
Integer Over/UnderflowN/APASS
Logical IssuesThe totalFee denominator includes the reflectionFee percentage, but the tokens collected through the reflectionFee are not allocated to any fund in the takeFee() function.WARNING
Oracle IssuesN/APASS
Outdated Compiler VersionN/APASS
Race ConditionsN/APASS
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] SafeMathInt 
    - [Int] mul
    - [Int] div
    - [Int] sub
    - [Int] add
    - [Int] abs

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

 + [Int] IERC20 
    - [Ext] totalSupply
    - [Ext] balanceOf
    - [Ext] allowance
    - [Ext] transfer #
    - [Ext] approve #
    - [Ext] transferFrom #

 + [Int] IPancakeSwapPair 
    - [Ext] name
    - [Ext] symbol
    - [Ext] decimals
    - [Ext] totalSupply
    - [Ext] balanceOf
    - [Ext] allowance
    - [Ext] approve #
    - [Ext] transfer #
    - [Ext] transferFrom #
    - [Ext] nonces
    - [Ext] permit #
    - [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] IPancakeSwapRouter 
    - [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
    - [Ext] removeLiquidityETHSupportingFeeOnTransferTokens #
    - [Ext] removeLiquidityETHWithPermitSupportingFeeOnTransferTokens #
    - [Ext] swapExactTokensForTokensSupportingFeeOnTransferTokens #
    - [Ext] swapExactETHForTokensSupportingFeeOnTransferTokens ($)
    - [Ext] swapExactTokensForETHSupportingFeeOnTransferTokens #

 + [Int] IPancakeSwapFactory 
    - [Ext] feeTo
    - [Ext] feeToSetter
    - [Ext] getPair
    - [Ext] allPairs
    - [Ext] allPairsLength
    - [Ext] createPair #
    - [Ext] setFeeTo #
    - [Ext] setFeeToSetter #

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

 +  ERC20Detailed (IERC20)
    - [Pub]  #
    - [Pub] name
    - [Pub] symbol
    - [Pub] decimals

 + [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 #
    - [Pub] getTotalReflectionEarned
    - [Pub] getTotalReflectionDistributed
    - [Ext] claimDividend #
    - [Pub] getUnpaidEarnings
    - [Int] getCumulativeDividends
    - [Int] addShareholder #
    - [Int] removeShareholder #

 +  OracleCapital (ERC20Detailed, Auth)
    - [Pub] getTotalUpline
    - [Pub] getUplineAddressByIndex
    - [Ext] addMember #
       - modifiers: onlyOwner
    - [Ext] approveReferral #
    - [Pub] getUpline
    - [Pub] getDownlines
    - [Pub] addReferralFee #
    - [Pub] getReferralTotalFee
    - [Pub]  #
       - modifiers: ERC20Detailed,Auth
    - [Int] rebase #
    - [Ext] transfer #
       - modifiers: validRecipient
    - [Ext] transferFrom #
       - modifiers: validRecipient
    - [Int] _basicTransfer #
    - [Ext] startTrading #
       - modifiers: onlyOwner
    - [Int] _transferFrom #
    - [Int] takeFee #
    - [Ext] clearStuckBalance #
       - modifiers: authorized
    - [Int] addLiquidity #
       - modifiers: swapping
    - [Int] swapBack #
       - modifiers: swapping
    - [Ext] withdrawAllToTreasury #
       - modifiers: swapping,authorized
    - [Int] shouldTakeFee
    - [Int] shouldRebase
    - [Int] shouldAddLiquidity
    - [Int] shouldSwapBack
    - [Ext] setAutoRebase #
       - modifiers: authorized
    - [Ext] setAutoAddLiquidity #
       - modifiers: authorized
    - [Ext] allowance
    - [Ext] decreaseAllowance #
    - [Ext] increaseAllowance #
    - [Ext] setIsDividendExempt #
       - modifiers: authorized
    - [Ext] approve #
    - [Ext] checkFeeExempt
    - [Pub] getCirculatingSupply
    - [Ext] isNotInSwap
    - [Ext] setDistributionCriteria #
       - modifiers: authorized
    - [Ext] manualSync #
    - [Ext] setFeeReceivers #
       - modifiers: authorized
    - [Ext] getLiquidityBacking
    - [Ext] setWhitelistAddress #
       - modifiers: authorized
    - [Ext] setBotBlacklist #
       - modifiers: authorized
    - [Ext] setPairAddress #
       - modifiers: authorized
    - [Ext] setLP #
       - modifiers: authorized
    - [Ext] totalSupply
    - [Pub] balanceOf
    - [Int] isContract
    - [Pub] gonsForBalance
    - [Pub] balanceForGons
    - [Pub] index
    - [Ext] getUnpaidReflection
    - [Ext] getTotalReflectionEarned
    - [Ext] getTotalReflectionDistributed
    - [Ext]  ($)

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.