Siz Token

Smart Contract Audit Report

Siz Token Audit Report

Executive Summary

This report presents the outcomes of our collaborative engagement with the Siz Token team, focusing on the comprehensive evaluation of the siz contract.

Our team conducted an initial security assessment from April 28th to May 1st, 2024.

Siz Token is a new BEP-20 token deployed on the Binance Smart Chain, designed for use within the team's innovative gaming platform.


Audit Scope

Name

Source Code

Visualized

siz

BSC Mainnet

Inheritance Chart.  Function Graph.

Name/Source Code

Visualized

BSC Mainnet

Inheritance Chart.  Function Graph.


Audit Findings

Low findings were identified and the team should consider resolving these issues. In addition, some centralized aspects are present.

Finding #1

siz

LowOpen

Finding #1 - siz
LowOpen

Description: The _beforeTokenTransfer() function enforces a restriction that limits each address, including those designated as approved DEX addresses, to participate in only one transfer per block.

if (from != address(0)) {
    require(_lastTradeBlock[from] != block.number, "Cannot trade twice in one block");
    _lastTradeBlock[from] = block.number;
}


if (to != address(0)) {
    require(_lastTradeBlock[to] != block.number, "Cannot trade twice in one block");
    _lastTradeBlock[to] = block.number;
}

Risk/Impact: This restriction can impede trading on DEXes where high-frequency trading is typical, resulting in failed buy and sell transactions.

Recommendation: The block-restriction logic in the _beforeTokenTransfer() function should be modified to exclude addresses that have been added as a _dexAddresses.

Resolution: The team has not yet addressed this issue.

Finding #2

siz

LowOpen

Finding #2 - siz
LowOpen

Description: In the _beforeTokenTransfer() function, the _maxSellToken value does not enforce a limit on the number of tokens that can be sold in a single transaction but rather prevents any non-buy transfer from occurring if the sender's balance before the transfer occurs exceeds its value.

function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual {
...

    if (!_dexAddresses[from]){
        require(_balances[from] <= _maxSellToken, "trasaction failed.");
    }

Risk/Impact: The _maxSellToken restriction is potentially misleading and may not operate as the team intended as it does not act as a maximum sell limit. Non-buy transactions may fail if the sender's balance exceeds the _maxSellToken value.

Recommendation: The maximum sell limit logic in the _beforeTokenTransfer() function should be modified to ensure that amount does not exceed _maxSellToken when transferring tokens to an approved DEX to properly enforce a maximum sell limit.

Resolution: The team has not yet addressed this issue.

Finding #3

siz

LowOpen

Finding #3 - siz
LowOpen

Description: In the _beforeTokenTransfer() function, the _lastTradeBlock for the recipient of a transfer is updated to the current block number. The recipient is then prohibited from transferring tokens within the same block.

Risk/Impact: A malicious user could exploit this feature by repeatedly transferring a small amount of tokens to the same recipient each block. This repetitive action could result in a denial-of-service, effectively preventing the recipient from selling their tokens, as they would be unable to initiate a transfer within the same block.

Recommendation: The _lastTradeBlock logic should only be updated for the tx.origin of the transaction. Alternatively, the team could increase the contract's minimum transfer amount to a value that would discourage users from engaging in such activity.

Resolution: The team has not yet addressed this issue.

Finding #4

siz

InformationalOpen

Finding #4 - siz
InformationalOpen

Description: The following two conditions in the _beforeTokenTransfer() function are redundant as the _transfer() function, which triggers the _beforeTokenTransfer() function, already enforces that the sender and the recipient cannot be address(0).

if (from != address(0)) {
...
if (to != address(0)) {

Recommendation: The above if-statements could be removed from the _beforeTokenTransfer() function for additional gas savings on each call.

Finding #5

siz

InformationalOpen

Finding #5 - siz
InformationalOpen

Description: The _tokenTotalSupply state variable is redundant as it serves as a maximum supply cap but is set equal to the total supply, and additionally, no minting functionality is permitted beyond deployment.

Recommendation: The _tokenTotalSupply state variable should either be removed to reduce contract size and deployment costs or utilized in a way that fits the project team's intended functionality.

Finding #6

siz

InformationalOpen

Finding #6 - siz
InformationalOpen

Description: The taxAddress and owner state variables are not used in the contract.

Recommendation: The taxAddress and owner state variables should either be removed to reduce contract size and deployment costs or utilized in a way that fits the project team's intended functionality.


System Overview

MINTS AND BURNS

The total supply of the token is set to 10 million $SIZ (10,000,000). No mint or burn functions are publicly accessible though the total supply of the token can be reduced by transferring tokens to the 0x..dead address.

CURRENT TOKEN HOLDERS

At the time of writing this report there are 11,497 token holders. The token allocation is as follows:

TRANSFERS

Transfers are prohibited from occurring if the sender's address has been added to the transfer blacklist. Sells and peer-to-peer transfers are prohibited from occurring if the sender's balance at the time of the transaction exceeds the "max sell token" value set by the owner. The contract enforces a minimum transfer amount on all buys via an approved DEX address and all peer-to-peer transfers. Each address, including approved DEX addresses, is restricted from participating in more than one transfer per block.

There are no fees associated with transferring tokens. As the contract is deployed with Solidity 0.8.18, it is protected from any possible overflows/underflows. The contract complies with the BEP-20 standard.

OWNERSHIP CONTROLS

The owner can add/remove any address from the transfer blacklist at any time. The owner can set the max sell token value to any value at any time. The owner can set the minimum buy amount to any value at any time. The owner can add/remove any address from the approved DEX list at any time.


Vulnerability Analysis

Vulnerability Category Notes Result
Arbitrary Jump/Storage Write N/A PASS
Centralization of Control
  • The owner can add any address to the transfer blacklist at any time.
  • The owner can set the max sell token value to any value at any time.
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
  • The _beforeTokenTransfer() function enforces a restriction that limits each address, including those designated as approved DEX addresses, to participate in only one transfer per block.
  • In the _beforeTokenTransfer() function, the _maxSellToken value does not enforce a limit on the number of tokens that can be sold in a single transaction but rather prevents any non-buy transfer from occurring if the sender's balance before the transfer occurs exceeds its value.
  • In the _beforeTokenTransfer() function, the _lastTradeBlock for the recipient of a transfer is updated to the current block number. The recipient is then prohibited from transferring tokens within the same block.
WARNING
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 The taxAddress and owner state variables are not used in the contract. PASS
Overall Contract Safety   PASS

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.