Trez Info

The TREZ decentralized mining protocol represents a new era of blockchain- native mining and token distribution. Unlike conventional cryptocurrencies, where mining operations are often dominated by specialized hardware or centralized pools, TREZ enforces a transparent and immutable on- chain mining process. All key mechanisms —including reward emission, difficulty adjustment, referral incentives, vesting releases, and the final reward —are locked permanently into the smart contract.

Trez Logo

TrustNet Score

The TrustNet Score evaluates crypto projects based on audit results, security, KYC verification, and social media presence. This score offers a quick, transparent view of a project's credibility, helping users make informed decisions in the Web3 space.

0.61
Poor Excellent

Real-Time Threat Detection

Real-time threat detection, powered by Cyvers.io, is currently not activated for this project.

This advanced feature provides continuous monitoring and instant alerts to safeguard your assets from potential security threats. Real-time detection enhances your project's security by proactively identifying and mitigating risks. For more information, click here.

Security Assessments

Select the audit
"\"\\\"Static Analysis Dynamic Analysis Symbolic Execution SWC Check Manual Review\\\"\""
Contract address
N/A
Network N/A
License N/A
Compiler N/A
Type N/A
Language Rust
Onboard date 2026/01/07
Revision date 2026/01/07

Summary and Final Words

No crucial issues found

The contract does not contain issues of high or medium criticality. This means that no known vulnerabilities were found in the source code.

Contract owner cannot mint

It is not possible to mint new tokens.

Contract owner cannot blacklist addresses.

It is not possible to lock user funds by blacklisting addresses.

Contract owner cannot set high fees

The fees, if applicable, can be a maximum of 25% or lower. The contract can therefore not be locked. Please take a look in the comment section for more details.

Contract cannot be locked

Owner cannot lock any user funds.

Token cannot be burned

There is no burning within the contract without any allowances

Ownership is renounced

The contract does not include owner functions that allow post-deployment modifications.

Contract is not upgradeable

The contract does not use proxy patterns or other mechanisms to allow future upgrades. Its behavior is locked in its current state.

Scope of Work

This audit encompasses the evaluation of the files listed below, each verified with a SHA-1 Hash. The team referenced above has provided the necessary files for assessment.

The auditing process consists of the following systematic steps:

  1. Specification Review: Analyze the provided specifications, source code, and instructions to fully understand the smart contract's size, scope, and functionality.
  2. Manual Code Examination: Conduct a thorough line-by-line review of the source code to identify potential vulnerabilities and areas for improvement.
  3. Specification Alignment: Ensure that the code accurately implements the provided specifications and intended functionalities.
  4. Test Coverage Assessment: Evaluate the extent and effectiveness of test cases in covering the codebase, identifying any gaps in testing.
  5. Symbolic Execution: Analyze the smart contract to determine how various inputs affect execution paths, identifying potential edge cases and vulnerabilities.
  6. Best Practices Evaluation: Assess the smart contracts against established industry and academic best practices to enhance efficiency, maintainability, and security.
  7. Actionable Recommendations: Provide detailed, specific, and actionable steps to secure and optimize the smart contracts.

A file with a different Hash has been intentionally or otherwise modified after the security review. A different Hash may indicate a changed condition or potential vulnerability that was not within the scope of this review.

Final Words

The following provides a concise summary of the audit report, accompanied by insightful comments from the auditor. This overview captures the key findings and observations, offering valuable context and clarity.


Ownership Privileges
  • The admin can send TREZ tokens to the distributor_token account.

Note - This audit report consists of a security analysis of the RewardPool contract. This analysis did not include functional testing (or unit testing) of the token’s logic. Furthermore, we only audited the mentioned contract associated with this project. Other contracts related to this project were not audited by our team. We recommend investors conduct their own research before engaging with the token.

Files and details

Functions
public

/

State variables
public

/

Total lines
of code

/

Capabilities
Hover on items

/

Functions
public

/

State variables
public

/

Total lines
of code

/

Capabilities
Hover on items

/

Findings and Audit result

high Issues | 1 findings

Pending

#1 high Issue
Genesis Pre-mine / Snipe
lib.rs
L176-332
Description

The 21M TREZ genesis reward is unprotected against pre-computation and low difficulty. It will almost certainly be captured by a bot or the deployer in the first seconds of the protocol.

medium Issues | 7 findings

Pending

#1 medium Issue
Initialization Front-Running Vulnerability
lib.rs
L88-110
Description

The initialize function allows any caller to become the program authority because it does not validate the caller's identity against a hardcoded admin key. A malicious actor can monitor the mempool for the deployment transaction and submit their own initialize call with a higher fee. Since the global state account uses a deterministic seed ([b"state"]), the attacker’s transaction will succeed first, permanently registering them as the authority. This effectively "bricks" the contract for the legitimate deployer, as the state account can only be initialized once.

Pending

#2 medium Issue
Genesis Reward Snipe via Predictable Challenge
lib.rs
L88-110
Description

The initial mining challenge is derived from clock.slot, which is publicly known before the transaction lands. Combined with the extremely low initial difficulty setting (23 bits, solvable in milliseconds), this allows an attacker to pre-calculate the winning solution for the first block off-chain. The attacker can then submit the solution in the very next slot to instantly claim the massive 21,000,000 TREZ Genesis Reward, bypassing the intended competition.

Pending

#3 medium Issue
Unprotected Account Reset (Data Loss)
lib.rs
L112-132
Description

The register_user instruction uses init_if_needed but fails to check if the account already contains data before overwriting it. Any call to this function wipes the user's total_mined balance and referral_count to zero. While it affects only the caller, it poses a severe usability risk where users can accidentally delete their own history.

Pending

#4 medium Issue
Partial Failure Mode (Missing Stats Update)
lib.rs
L133-173
Description

The function allows the referrer link to be established without updating the referrer's statistics if the account is missing from the transaction. This leads to a permanent desynchronization where the miner has a referrer, but the referrer has no record of it.

Pending

#5 medium Issue
Difficulty "Death Spiral" Risk
lib.rs
L176-376
Description

The difficulty adjustment algorithm is strictly linear, increasing or decreasing difficulty by exactly 1 bit per block. If the network hashrate drops significantly (e.g., due to a price crash), block times could extend to hours. Because the protocol cannot adjust faster than 1 bit per block, it would take an impractical amount of time to lower the difficulty, potentially causing the blockchain mining to stall permanently.

Pending

#6 medium Issue
Broken EMA Logic (Dead State)
lib.rs
L176-376
Description

The state variable ema_slots is intended to track an Exponential Moving Average of block times for smooth difficulty adjustment. However, this variable is never updated inside claim_reward. As a result, the difficulty adjustment relies on the high-variance single block time (dt), and the DifficultyAdjusted event emits incorrect, static data.

Pending

#7 medium Issue
Non-Standard Proof-of-Work Validation
lib.rs
L176-376
Description

The code reverses the hash buffer (buf.reverse()) before checking for leading zeros. This effectively checks for zeros at the end of the byte array (Little Endian) rather than the beginning (Big Endian), which conflicts with standard SHA256 PoW implementations like Bitcoin.

low Issues | 3 findings

Pending

#1 low Issue
Inefficient Difficulty Adjustment Ramp-Up
lib.rs
L88-110
Description

The difficulty is initialized to a low value (23 bits) and the adjustment algorithm is capped to change by only 1 bit per block. If modern hardware is used, the difficulty will be too low for the network's hashrate, leading to extremely fast block times. Because the difficulty can only rise slowly (one step at a time), early miners will be able to strip-mine a large portion of the token supply before the difficulty stabilizes to the target 3-minute block time.

Pending

#2 low Issue
Optional Referrer Token (Bonus Loss)
lib.rs
L176-332
Description

Users who have a referrer are not forced to provide the referrer's token account. If omitted, the protocol silently fails to pay out the referral bonuses, leading to loss of potential earnings.

Pending

#3 low Issue
Silent Referral Bonus Loss
lib.rs
L176-376
Description

If a miner has a registered referrer but fails to include the referrer's token account in the transaction, the protocol simply skips the bonus distribution (3 TREZ each) without error. This leads to accidental loss of funds for users who make a mistake in transaction construction.

informational Issues | 3 findings

Pending

#1 informational Issue
Unused State Variable
lib.rs
L382-396
Description

The State struct defines a difficulty_low field, but the initialize function never assigns it a meaningful value (leaving it as 0), and it is ignored throughout the rest of the program logic. This results in unnecessary storage costs and dead code.

Pending

#2 informational Issue
Global Miner Count Inflation
lib.rs
L112-132
Description

The global state.total_miners variable is incremented unconditionally on every call. Attackers can repeatedly call register_user to inflate this statistic arbitrarily, rendering the on-chain "Total Miners" metric useless.

Pending

#3 informational Issue
Non-Standard Account Management
lib.rs
L133-173
Description

Using remaining_accounts for core protocol logic is an anti-pattern in Anchor. It degrades developer experience and hides account dependencies from the generated IDL, making it harder for others to build on top of the protocol.