UP
Smart Contract Audit Report
Audit Summary
UP is a new BEP-20 token on the Binance Smart Chain that can be minted in exchange for BNB and BUSD.
For this audit, we reviewed the project team's UP contract at 0x5376a83112100ff1567b2782e0d99c6d949b5509 on the Binance Smart Chain Mainnet.
Audit Findings
Informational findings were identified and the team may want to review them. In addition, centralized aspects are present.
Date: December 15th, 2022.
Updated: December 19th, 2022 to reflect the contract's Mainnet address.Finding #1 - UP - Informational
Description: Although the SafeMath library is utilized, the contract is deployed with Solidity v0.8.14 which has built-in overflow checks.
Recommendation: SafeMath could be safely removed to reduce contract size, deployment costs, and gas costs on all transactions that utilize it.
Contract Overview
- The total supply of the token is currently 583,250 $UP.
- At the time of writing this report, there are 339 total token holders. The token allocation is as follows:
- 17.49% of the total supply belongs to an EOA.
- The next five EOAs own a cumulative 22.94% of the total supply.
- Any user can execute a native mint transaction by providing an amount of BNB and specifying a recipient address and a minimum out value.
- The contract's full BNB balance will be sent to the Zapper contract which intends to exchange the received BNB for an amount of BUSD and send it back to this contract. The Zapper contract was out of scope for this audit and therefore our team cannot provide an assessment with regard to security.
- The contract's new BUSD balance must exceed the sum of the contract's previous BUSD balance and the minimum amount value.
- A number of UP tokens will be minted to the recipient based on the ratio of the number of exchanged BUSD to the total amount of BUSD in the contract.
- A Mint fee will be charged and a percentage of the collected tokens is minted to the Fee Receiver.
- When the Presale is enabled by the team, the caller must have been added to the team's Presale whitelist in order to mint tokens.
- A native mint transaction is automatically triggered when any amount of BNB is sent directly to the contract.
- Any user can initiate a BUSD mint transaction by specifying an amount of BUSD and a recipient address.
- A number of UP tokens will be minted to the recipient based on the ratio of the amount of provided BUSD to the full BUSD balance of the contract.
- The Mint fee will be charged and a percentage of the collected tokens is minted to the Fee Receiver.
- When the Presale is enabled by the team, the caller must have been added to the team's Presale whitelist in order to mint tokens.
- Any user can initiate a sell transaction by specifying a number of UP tokens to exchange for BUSD.
- A Sell fee will be charged and a percentage of the collected tokens is minted to the Fee Receiver.
- The amount of BUSD sent to the caller is based on the current price of the token.
- The specified number of UP tokens are burned and the BUSD is sent to the user's wallet address.
- Users can elect to have the received BUSD sent to a specified recipient address.
- There is a Transfer fee charged on all token transfers.
- If either the sender or the recipient has been added to the team's contract list, the Contract fee will be charged instead.
- The tokens collected through the fee are removed from the total supply.
- A percentage of the number of tokens collected through the fee is minted to the team's Fee Receiver address.
- The ratio of the number of BUSD in this contract to the UP token total supply must increase in order for transfers, sells, mints, and burns to successfully occur.
- If any UP tokens are currently in the contract, they are automatically burned and a percentage of the number of burned tokens is minted to the Fee Receiver address on all mints.
- The contract utilizes ReentrancyGuard to prevent reentrancy attacks in applicable functions.
- As the contract is deployed with Solidity v0.8.14, it is safe from any possible overflows/underflows.
- The owner can enable/disable all mint transactions at any time.
- The owner can enable/disable the Presale at any time.
- The owner can update the Zapper address that is responsible for swapping BNB for BUSD to any address at any time.
- The owner can assign a custom Mint fee and Sell fee to any number of addresses at any time.
- The owner can add users to the Presale whitelist and assign each address a number of tokens at any time.
- The owner can set the Mint fee, Transfer fee, Contract fee, and Sell fee to any values up to 5% at any time.
- The owner can include and exclude accounts from fees at any time.
- The owner can add/remove addresses from the contract list at any time.
- The owner can initiate a sell transaction on any user's behalf for their full UP token balance at any time.
- The owner can withdraw any tokens besides BUSD from the contract at any time.
- The owner can set the percentage of tokens minted to the Fee Receiver to any percentage up to 90%.
- The owner can update the Fee Receiver address at any time.
Audit Results
Vulnerability Category | Notes | Result |
---|---|---|
Arbitrary Jump/Storage Write | N/A | PASS |
Centralization of Control |
|
WARNING |
Compiler Issues | N/A | PASS |
Delegate Call to Untrusted Contract | N/A | PASS |
Dependence on Predictable Variables | N/A | PASS |
Ether/Token Theft | N/A | PASS |
Flash Loans | N/A | PASS |
Front Running | N/A | PASS |
Improper Events | N/A | PASS |
Improper Authorization Scheme | N/A | PASS |
Integer Over/Underflow | N/A | PASS |
Logical Issues | N/A | PASS |
Oracle Issues | N/A | PASS |
Outdated Compiler Version | N/A | PASS |
Race Conditions | N/A | PASS |
Reentrancy | N/A | PASS |
Signature Issues | N/A | PASS |
Sybil Attack | N/A | PASS |
Unbounded Loops | N/A | PASS |
Unused Code | N/A | PASS |
Overall Contract Safety | PASS |
Inheritance Chart
Function 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] mod
- [Int] mod
+ ReentrancyGuard
- [Pub] #
+ Ownable
- [Pub] #
- [Pub] changeOwner #
- modifiers: onlyOwner
- [Ext] getOwner
+ [Int] IERC20
- [Ext] totalSupply
- [Ext] symbol
- [Ext] name
- [Ext] balanceOf
- [Ext] decimals
- [Ext] transfer #
- [Ext] allowance
- [Ext] approve #
- [Ext] transferFrom #
+ UP (IERC20, Ownable, ReentrancyGuard)
- [Pub] #
- [Ext] totalSupply
- [Pub] balanceOf
- [Ext] allowance
- [Pub] name
- [Pub] symbol
- [Pub] decimals
- [Pub] approve #
- [Ext] transfer #
- modifiers: nonReentrant
- [Ext] transferFrom #
- modifiers: nonReentrant
- [Int] _transferFrom #
- [Ext] mintWithNative ($)
- [Ext] mintWithBacking #
- modifiers: nonReentrant
- [Ext] sell #
- modifiers: nonReentrant
- [Ext] sellTo #
- modifiers: nonReentrant
- [Ext] burn #
- modifiers: nonReentrant
- [Int] _mintWithNative #
- modifiers: nonReentrant
- [Int] _mintWithBacking #
- [Int] _sell #
- [Prv] _mintTo #
- [Int] _takeFee #
- [Int] _getUnderlying #
- [Int] _requirePriceRises #
- [Int] _transferIn #
- [Prv] _mint #
- [Prv] _burn #
- [Int] _checkGarbageCollector #
- [Pub] underlyingBalance
- [Ext] calculatePrice
- [Int] _calculatePrice
- [Pub] amountOut
- [Pub] getValueOfHoldings
- [Ext] activateToken #
- modifiers: onlyOwner
- [Ext] presaleToggle #
- modifiers: onlyOwner
- [Ext] setFeeReceiver #
- modifiers: onlyOwner
- [Ext] setFeeReceiverPercentage #
- modifiers: onlyOwner
- [Ext] setZapper #
- modifiers: onlyOwner
- [Ext] withdrawNonStableToken #
- modifiers: onlyOwner
- [Ext] setCustomFee #
- modifiers: onlyOwner
- [Ext] setPresale #
- modifiers: onlyOwner
- [Ext] sellDownExternalAccount #
- modifiers: nonReentrant,onlyOwner
- [Ext] setFees #
- modifiers: onlyOwner
- [Ext] setTransferFeeExempt #
- modifiers: onlyOwner
- [Ext] setContract #
- modifiers: onlyOwner
- [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.