The Peoples Coin
Smart Contract Audit Report
Audit Summary
The Peoples Coin is a new ERC-20 token on Ethereum.
For this audit, we reviewed the project team's ThePeoplesCoin contract at 0x5919dea604631016c15c805e3d948a0384879892 on the Ethereum Mainnet.
We previously reviewed the project team's token contract here.
Audit Findings
An Informational finding was identified and the team may want to review it. In addition, some centralized aspects are present.
Date: March 23rd, 2023.Finding #1 - ThePeoplesCoin - Informational
Description: Although the SafeMath library is utilized, the contract is deployed with Solidity v0.8.17 which has built-in overflow/underflow checks.
Recommendation: SafeMath could be safely removed to reduce contract size, deployment costs, and gas costs on all transactions that utilize it.
Contract Overview
Ownership Controls:
- The total supply of the token is currently ~996.47 million PEEP$ [996,466,201.8061].
- No public mint or burn functions are accessible, though the circulating supply can be decreased by sending tokens to the 0x..dead address.
- At the time of writing this report, there are 6,618 total token holders. The token allocation is as follows:
- 57.2% of the total supply has been sent to the 0x..dead address.
- 9.81% of the total supply belongs to the deployer.
- 3.03% of the total supply belongs to the Donation wallet.
- 3% of the total supply belongs to the Marketing wallet.
- 1.53% of the total supply is in Uniswap liquidity.
- Of that liquidity, 98% of the LP tokens are locked in a UNCX token locking contract and will unlock on April 30th, 2023.
- The next five EOAs own a cumulative 2.6% of the total supply.
- Trading must be enabled by the owner in order for all transfers to take place on the platform. Only the owner can initiate transfers when trading is disabled. Once trading is enabled, it cannot be disabled.
- Blacklisted accounts are prohibited from participating in transfers.
- The contract enforces a maximum transaction amount (determined by the owner) which imposes a limit to the number of tokens that can be transferred in a single transaction.
- There is a Platform fee, Rewards fee, Dev fee, and Burn fee on all buys and sells where neither the sender nor the recipient is excluded from fees. A separate fee structure can be set by the team to apply different Rewards fee, Dev fee, and Burn fee percentages on sell transactions.
- The Dev fee is increased by the Launch Sell fee percentage on all sells that take place within one year of trading being enabled by the team.
- The tokens collected through fees are stored in the contract address. The tokens are swapped for ETH and sent to their respective team wallets when the following conditions are met:
- The automatic token swapping 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 swapping tokens.
- The caller is not initiating a buy transaction.
- The tokens collected through the Rewards fee are swapped for ETH and allocated to the Rewards Tracker contract. This contract was not in scope for this audit, so our team is unable to provide an assessment with regard to its security.
- The tokens collected through the Platform fee and Dev fee are swapped for ETH and sent to the Platform wallet and Dev wallet respectively.
- The tokens collected through the Burn fee are burned from the contract when the Burn functionality is enabled by the team.
- If the recipient of the transfer is a Burn address set by the team, ~99% of the transferred tokens are burned from the Burn address's wallet.
- As the contract is deployed with Solidity v0.8.17, it is protected from overflows/underflows.
- The contract complies with the ERC-20 token standard.
- The owner can set the Rewards fee, Dev fee, and Burn fee for both fee structures to any percentages up to 10% each at any time.
- The owner can set the Platform fee to any percentage up to 10% at any time.
- The owner can set the Sell Launch fee to any percentage up to 25% at any time.
- The owner can exclude and include accounts from fees at any time.
- The owner can add accounts to the transfer blacklist within one year of trading being enabled by the team.
- The owner can remove accounts from the transfer blacklist at any time.
- The owner can enable/disable "generic transfers" which disables fees, the maximum transaction restriction, and the token swapping functionality on transfers.
- The owner can update the maximum transaction amount to any value greater than or equal to 5 million tokens. This value was set to 2 million tokens on deployment.
- The owner can enable/disable the automatic token swapping functionality at any time.
- The owner can update the threshold number of tokens needed to trigger the automatic token swapping functionality to any value at any time.
- The owner can manually swap all of the PEEP$ tokens in the contract for ETH at any time.
- The owner can manually send all of the ETH in the contract to the team's Dev wallet at any time.
- The owner can exclude and include accounts from rewards at any time.
- The owner can enable/disable the contract's Burn functionality at any time.
- The owner can add/remove addresses as a Pair address at any time.
- The owner can add/remove addresses as a Burn address at any time.
- The owner can set the Dev address, Platform address, and Rewards Tracker address to any addresses at any time.
- The owner can update the Uniswap Router 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 |
The automatic token swapping functionality may be susceptible to front running. The team should monitor, and if any suspicious activity is detected, should either lower the minTokensBeforeSwap threshold or disable this system altogether.
|
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] tryAdd
- [Int] trySub
- [Int] tryMul
- [Int] tryDiv
- [Int] tryMod
- [Int] add
- [Int] sub
- [Int] mul
- [Int] div
- [Int] mod
- [Int] sub
- [Int] div
- [Int] mod
+ [Lib] Address
- [Int] isContract
- [Int] sendValue #
- [Int] functionCall #
- [Int] functionCall #
- [Int] functionCallWithValue #
- [Int] functionCallWithValue #
- [Prv] _functionCallWithValue #
+ [Int] IERC20
- [Ext] totalSupply
- [Ext] balanceOf
- [Ext] transfer #
- [Ext] allowance
- [Ext] approve #
- [Ext] transferFrom #
+ [Int] IERC20Metadata (IERC20)
- [Ext] name
- [Ext] symbol
- [Ext] decimals
+ Context
- [Int] _msgSender
- [Int] _msgData
+ ERC20 (Context, IERC20, IERC20Metadata)
- [Pub] #
- [Pub] name
- [Pub] symbol
- [Pub] decimals
- [Pub] totalSupply
- [Pub] balanceOf
- [Pub] transfer #
- [Pub] allowance
- [Pub] approve #
- [Pub] transferFrom #
- [Pub] increaseAllowance #
- [Pub] decreaseAllowance #
- [Int] _transfer #
- [Int] _mint #
- [Int] _burn #
- [Int] _approve #
- [Int] _beforeTokenTransfer #
+ Ownable (Context)
- [Pub] #
- [Pub] owner
- [Ext] renounceOwnership #
- modifiers: onlyOwner
- [Ext] transferOwnership #
- modifiers: onlyOwner
+ RewardsToken (ERC20, Ownable)
- [Int] deleteExcluded #
- [Int] getExcludedBalances
- [Pub] excludeFromRewards #
- modifiers: onlyOwner
- [Ext] includeInRewards #
- modifiers: onlyOwner
- [Ext] isExcludedFromRewards
- [Ext] getAllExcludedFromRewards
- [Pub] getRewardsSupply
+ [Int] IUniswapV2Factory
- [Ext] createPair #
+ [Int] IUniswapV2Router
- [Ext] factory
- [Ext] WETH
- [Ext] swapExactTokensForETHSupportingFeeOnTransferTokens #
- [Ext] swapExactETHForTokensSupportingFeeOnTransferTokens ($)
+ [Int] IUniswapV2Pair
- [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] IRewardsTracker
- [Ext] addAllocation ($)
+ ThePeoplesCoin (RewardsToken)
- [Pub] #
- modifiers: ERC20
- [Pub] decimals
- [Int] _transfer #
- [Ext] ($)
- [Prv] _getValues
- [Prv] _takeFee #
- [Prv] calculateFee
- [Prv] removeAllFee #
- [Prv] restoreAllFee #
- [Prv] swapAndRedirectEthFees #
- modifiers: lockTheSwap
- [Prv] sendEthToWallet #
- [Prv] swapTokensForEth #
- [Ext] prepareForLaunch #
- modifiers: onlyOwner
- [Ext] setUseGenericTransfer #
- modifiers: onlyOwner
- [Pub] blacklistAddress #
- modifiers: onlyOwner
- [Ext] setMaxTxPercent #
- modifiers: onlyOwner
- [Ext] isExcludedFromFee
- [Ext] excludeFromFee #
- modifiers: onlyOwner
- [Ext] includeInFee #
- modifiers: onlyOwner
- [Ext] setFees #
- modifiers: onlyOwner
- [Ext] setLaunchSellFee #
- modifiers: onlyOwner
- [Ext] setDevWallet #
- modifiers: onlyOwner
- [Ext] setPlatformWallet #
- modifiers: onlyOwner
- [Ext] setRewardsTracker #
- modifiers: onlyOwner
- [Ext] setRouterAddress #
- modifiers: onlyOwner
- [Ext] setSwapAndRedirectEthFeesEnabled #
- modifiers: onlyOwner
- [Ext] setMinTokensBeforeSwap #
- modifiers: onlyOwner
- [Ext] manualSwap #
- modifiers: onlyOwner
- [Ext] manualSend #
- modifiers: onlyOwner
- [Int] calculateBurnFee
- [Pub] changeTrueBurn #
- modifiers: onlyOwner
- [Pub] addPairAddress #
- modifiers: onlyOwner
- [Pub] addBurnAddress #
- 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 1300+ 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 across 1500 projects!. 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.