Aurora

Smart Contract Audit Report

Audit Summary

Aurora Audit Report Aurora is a new ERC-20 token with an elastic supply that performs automatic liquidity adds.

For this audit, we reviewed the project team's Aurora and USDCReceiver contracts at 0xc8a251142722CeB4a524876b89CC4c0709585818 on the Avalanche Mainnet.

Audit Findings

Please ensure trust in the team prior to investing as they have substantial control in the ecosystem.
Date: March 22nd, 2022.
Updated: March 24th, 2022 to reflect the contract's newly deployed Mainnet address.

Finding #1 - Aurora - Medium (Resolved)

Description: In the rebase() function, the second 'if' condition will always be true after one year. As a result of this, the last two conditions will never be reached.
if (deltaTimeFromInit < (365 days)) {
	rebaseRate = 2355;
} else if (deltaTimeFromInit >= (365 days)) {
	rebaseRate = 211;
} else if (deltaTimeFromInit >= ((15 * 365 days) / 10)) {
	rebaseRate = 14;
} else if (deltaTimeFromInit >= (7 * 365 days)) {
	rebaseRate = 2;
}
Risk/Impact: The rebase rate will permanently remain the same after its first change.
Recommendation: The ordering of these 'if' conditions should be modified to fit the project team's intended functionality.
Resolution: The team has modified this function to fit their intended functionality.

Finding #2 - Aurora - Low

Description: There are four instances in the takeFee() function where multiplication is performed on the result of a division.
_gonBalances[blackhole] = _gonBalances[blackhole].add(
	gonAmount.div(feeDenominator).mul(blackholeFee)
);
_gonBalances[address(this)] = _gonBalances[address(this)].add(
	gonAmount.div(feeDenominator).mul(_treasuryFee.add(auraInsuranceFundFee))
);
_gonBalances[autoLiquidityReceiver] = _gonBalances[autoLiquidityReceiver].add(
	gonAmount.div(feeDenominator).mul(liquidityFee)
);
_gonBalances[nftFeeReceiver] = _gonBalances[nftFeeReceiver].add(
	gonAmount.div(feeDenominator).mul(_nftFee)
);
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 - Aurora - Informational

Description: Several functions are declared public, but are never called internally.
getLiquidityBacking, setPairAddress, setExcludeFromLimit, setLimit
Recommendation: These functions should be declared external for additional gas savings on each call.

Finding #4 - Aurora - Informational

Description: Several state variables can never be modified, but are not declared constant.
DEAD, USDC, ZERO, _decimals, _name, _symbol, auraInsuranceFundFee, blackholeFee, feeDenominator, limitDenominator, liquidityFee, nftFee, sellFee, swapEnabled, treasuryFee
Recommendation: These state variables should be declared constant for additional gas savings on each call.

Contract Overview

  • The current supply of the token is ~3 million [3,010,614] $AURA.
  • The maximum allowed supply of $AURA is 30 billion [30,000,000,000] tokens.
  • 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, there are 702 total token holders. The token allocation is as follows:
    • 16.6% of the total supply belongs to the owner.
    • 9.19% of the total supply is in JoeSwap liquidity.
    • Of that liquidity, 92.17% of the LP tokens belong to the owner
    • 7.78% of the LP tokens belong to the team's Liquidity wallet.

  • The contract enforces a maximum hold amount which prevents a transfer from occurring if the recipient's token balance exceeds the limit number of tokens (determined by the owner).
  • The contract enforces a maximum sell limit that prevents a user from selling more tokens than the sell limit value (determined by the owner) in 24 hours.
  • There is a Liquidity fee, Treasury fee, Insurance Fund Fee, and Blackhole fee on all transfers via JoeSwap where neither the sender nor the recipient is excluded from fees.
  • There is an additional Sell fee and NFT fee added on all sell transactions via JoeSwap.
  • Blacklisted contracts are not permitted to transfer tokens.
  • 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 JoeSwap.
    • The contract is not currently swapping tokens, performing a rebase, or performing an automatic liquidity add.
    • 15 minutes have 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 JoeSwap Pair contract to prevent theft-of-liquidity attacks that have occurred with other rebase tokens.
  • An automatic liquidity add will also occur on token transfers if at least 8 hours have passed since the previous automatic liquidity add.
  • The tokens collected through the Liquidity fee are swapped for USDC and sent to the USDCReceiver contract. The received USDC is subsequently sent back to the Aurora contract where it is paired with the token and added as liquidity to the USDC 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 through the Treasury fee and Insurance Fund Fee are swapped for USDC and sent to the team's Treasury wallet and Insurance Fund wallet respectively.
  • The tokens collected through the Blackhole fee are sent to the Blackhole address set by the team.
  • The tokens collected through the NFT fee are sent to the team's NFT wallet.
  • The contract utilizes SafeMath libraries to prevent any overflows/underflows.

  • The owner can enable/disable automatic liquidity adds and the auto-rebase mechanism at any time.
  • The owner can add/remove any contract address from the transfer blacklist at any time. EOAs cannot be blacklisted.
  • The owner can include/exclude accounts from transfer fees at any time.
  • The owner can swap all of the $AURA in the contract for USDC and send it to the team's Treasury wallet at any time.
  • The owner can update the JoeSwap Pair address, Liquidity wallet, Insurance Fund wallet, NFT wallet, and Blackhole address at any time.
  • The owner can pause all trading for all accounts besides their own at any time.
  • The owner can set both the maximum sell amount and maximum hold amount to any values greater than 0.05% of the current circulating supply at any time.
  • The owner can include/exclude accounts from the maximum sell amount and maximum hold amount restrictions.
  • The owner can withdraw any tokens or AVAX from the USDCReceiver 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 swap all of the $AURA in the contract for USDC and send it to the team's Treasury wallet.
  • PASS
    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 IssuesN/APASS
    Oracle IssuesN/APASS
    Outdated Compiler VersionN/APASS
    Race ConditionsN/APASS
    ReentrancyN/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] 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] IPancakeSwapRouter 
        - [Ext] factory
        - [Ext] WAVAX
        - [Ext] addLiquidity #
        - [Ext] addLiquidityAVAX ($)
        - [Ext] removeLiquidity #
        - [Ext] removeLiquidityAVAX #
        - [Ext] removeLiquidityWithPermit #
        - [Ext] removeLiquidityAVAXWithPermit #
        - [Ext] swapExactTokensForTokens #
        - [Ext] swapTokensForExactTokens #
        - [Ext] swapExactAVAXForTokens ($)
        - [Ext] swapTokensForExactAVAX #
        - [Ext] swapExactTokensForAVAX #
        - [Ext] swapAVAXForExactTokens ($)
        - [Ext] quote
        - [Ext] getAmountOut
        - [Ext] getAmountIn
        - [Ext] getAmountsOut
        - [Ext] getAmountsIn
        - [Ext] removeLiquidityAVAXSupportingFeeOnTransferTokens #
        - [Ext] removeLiquidityAVAXWithPermitSupportingFeeOnTransferTokens #
        - [Ext] swapExactTokensForTokensSupportingFeeOnTransferTokens #
        - [Ext] swapExactAVAXForTokensSupportingFeeOnTransferTokens ($)
        - [Ext] swapExactTokensForAVAXSupportingFeeOnTransferTokens #
    
     + [Int] IPancakeSwapFactory 
        - [Ext] feeTo
        - [Ext] feeToSetter
        - [Ext] getPair
        - [Ext] allPairs
        - [Ext] allPairsLength
        - [Ext] createPair #
        - [Ext] setFeeTo #
        - [Ext] setFeeToSetter #
    
     +  Ownable 
        - [Pub]  #
        - [Pub] owner
        - [Pub] isOwner
        - [Pub] renounceOwnership #
           - modifiers: onlyOwner
        - [Pub] transferOwnership #
           - modifiers: onlyOwner
        - [Int] _transferOwnership #
    
     +  ERC20Detailed (IERC20)
        - [Pub]  #
        - [Pub] name
        - [Pub] symbol
        - [Pub] decimals
    
     + [Int] IUSDCReceiver 
        - [Ext] initialize #
        - [Ext] withdraw #
        - [Ext] withdrawUnsupportedAsset #
        - [Ext] transferOwnership #
    
     +  USDCReceiver (Ownable)
        - [Pub]  #
           - modifiers: Ownable
        - [Pub] initialize #
           - modifiers: onlyOwner
        - [Pub] withdraw #
        - [Pub] withdrawUnsupportedAsset #
           - modifiers: onlyOwner
    
     +  Aurora (ERC20Detailed, Ownable)
        - [Pub]  #
           - modifiers: ERC20Detailed,Ownable
        - [Int] rebase #
        - [Ext] transfer #
           - modifiers: validRecipient
        - [Ext] transferFrom #
           - modifiers: validRecipient
        - [Int] _basicTransfer #
        - [Int] _transferFrom #
           - modifiers: checkLimit
        - [Int] takeFee #
        - [Int] addLiquidity #
           - modifiers: swapping
        - [Int] swapBack #
           - modifiers: swapping
        - [Ext] withdrawAllToTreasury #
           - modifiers: swapping,onlyOwner
        - [Int] shouldTakeFee
        - [Int] shouldRebase
        - [Int] shouldAddLiquidity
        - [Int] shouldSwapBack
        - [Ext] setAutoRebase #
           - modifiers: onlyOwner
        - [Ext] setAutoAddLiquidity #
           - modifiers: onlyOwner
    	- [Pub] toggleSwap #
    	   - modifiers: onlyOwner
        - [Ext] allowance
        - [Ext] decreaseAllowance #
        - [Ext] increaseAllowance #
        - [Ext] approve #
        - [Ext] checkFeeExempt
        - [Pub] getCirculatingSupply
        - [Pub] getCurrentDay
        - [Pub] getUserHoldLimit
        - [Pub] getUserSellLimit
        - [Ext] isNotInSwap
        - [Ext] manualSync #
        - [Ext] setFeeReceivers #
           - modifiers: onlyOwner
        - [Pub] getLiquidityBacking
        - [Ext] setWhitelist #
           - modifiers: onlyOwner
        - [Ext] setBotBlacklist #
           - modifiers: onlyOwner
        - [Pub] setPairAddress #
           - modifiers: onlyOwner
        - [Ext] setLP #
           - modifiers: onlyOwner
        - [Pub] setExcludeFromLimit #
           - modifiers: onlyOwner
        - [Pub] setLimit #
           - modifiers: onlyOwner
        - [Ext] totalSupply
        - [Ext] balanceOf
        - [Int] isContract
        - [Prv] minZero
        - [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.