Anazir Info
Anazir takes place in a world filled with runic magic, where elemental Gods wage war against each other through the strength of Heroes and their army of Golems. The player incarnates an elemental hero whose mission is to destroy the opponent’s base by building Towers that generate Summons.
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.
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
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 not renounced
The owner retains significant control, which could potentially be used to modify key contract parameters.
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:
- Specification Review: Analyze the provided specifications, source code, and instructions to fully understand the smart contract's size, scope, and functionality.
- Manual Code Examination: Conduct a thorough line-by-line review of the source code to identify potential vulnerabilities and areas for improvement.
- Specification Alignment: Ensure that the code accurately implements the provided specifications and intended functionalities.
- Test Coverage Assessment: Evaluate the extent and effectiveness of test cases in covering the codebase, identifying any gaps in testing.
- Symbolic Execution: Analyze the smart contract to determine how various inputs affect execution paths, identifying potential edge cases and vulnerabilities.
- Best Practices Evaluation: Assess the smart contracts against established industry and academic best practices to enhance efficiency, maintainability, and security.
- 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
BoxOpener.sol
- The owner can modify the fee distribution percentages.
- The owner can set any price above 0 for all box types (regular/gold in BANZ/ANZ).
Note - This Audit report consists of a security analysis of the Anazir smart contract. This analysis did not include functional testing (or unit testing) of the contract’s logic. Moreover, we only audited the mentioned contract for the Anazir team. Other contracts associated with the project were not audited by our team. We recommend investors do their own research before investing.
Files and details
Functions
public
/
State variables
public
/
Total lines
of code
/
Capabilities
Hover on items
/
Findings and Audit result
medium Issues | 3 findings
Resolved
#1 medium Issue
On-chain randomization
The openBox function uses predictable blockchain data (block.timestamp, block.difficulty, msg.sender, and nonce) to generate randomness for NFT rarity determination, creating a critical vulnerability where attackers can manipulate or predict outcomes. Since all entropy sources are known before transaction execution, sophisticated users can calculate exact NFT rarities off-chain and only execute transactions that guarantee rare drops (like LEGENDARY items), while miners can manipulate block.timestamp within consensus rules to influence results. This breaks the intended economic model by giving unfair advantages to attackers over regular users and undermines trust in the randomness system.
Resolved
#2 medium Issue
Integer Division Precision Loss Can Render Contract Completely Unusable
The openBox function calculates token distribution amounts using integer division, which truncates fractional results and can cause the sum of distributed amounts to not equal the original price. The contract enforces strict equality with require(total == price, "Distribution amounts don't sum to price") on line 67, which will cause all transactions to revert when precision loss occurs. For example, if the owner sets distribution percentages to burnBP=3333, treasuryBP=3333, stakingBP=3334, farmingBP=0 (totaling exactly 10000), the calculations with PRICE_BOX = 5555 * 1e18 result in: burnAmt = 1851 * 1e18, treasuryAmt = 1851 * 1e18, stakingAmt = 1852 * 1e18, farmingAmt = 0, giving a total of 5554 * 1e18 instead of the required 5555 * 1e18. This 1-token difference causes the require statement to fail, making every openBox transaction revert and rendering the contract completely inoperable until distribution percentages are changed back to values that don't cause precision loss.
Resolved
#3 medium Issue
Missing Upper Bounds for Price Setting
The setPrices function in BoxOpener.sol has a critical security vulnerability due to missing upper price limits. While it checks that prices are greater than zero, it allows the owner to set arbitrarily high prices without any maximum cap. This could lead to users being unable to afford boxes or experiencing unexpected high costs, especially if they've pre-approved token spending. The recommended fix is to implement maximum price caps as contract constants and add corresponding validation checks in the setPrices function. Additionally, implementing a timelock mechanism and gradual price change limits would further enhance security and user trust. This issue is rated as High severity due to its potential impact on user funds and contract usability.
low Issues | 2 findings
Pending
#1 low Issue
Redundant Validation Checks Cause Unnecessary Gas Consumption
The openBox function performs multiple validation checks that are redundant because they duplicate validations already performed in the constructor or are unnecessary due to existing safeguards. These redundant checks include address zero validations for treasuryAddr, stakingAddr, and farmingAddr, address uniqueness validation (line 60), and a balance check (line 55) that is already handled by the subsequent safeTransferFrom calls. Since these addresses are immutable after deployment and were already validated during contract creation, re-checking them on every function call wastes approximately 10,500 gas per transaction. At current gas prices, this translates to roughly $0.05 extra cost per box opening, which scales to significant unnecessary expenses for high-volume usage - potentially costing users $50+ daily in wasted gas fees for 1000 transactions.
Pending
#2 low Issue
setDistribution Function Can Accidentally Break Contract.
The setDistribution function only validates that distribution percentages sum to exactly 10000 but doesn't check whether these percentages will cause precision loss in the openBox function's integer division calculations. When the owner sets certain distribution combinations (like burnBP=3333, treasuryBP=3333, stakingBP=3334, farmingBP=0), the resulting calculations in openBox produce amounts that don't sum back to the original price due to truncation in integer division. This causes the strict equality check require(total == price) in openBox to always fail, making every box opening transaction revert and rendering the entire contract completely unusable. The owner could unknowingly brick the contract by setting mathematically valid distributions (that sum to 100%) without realizing they create precision loss, requiring emergency intervention to restore functionality by changing back to safe distribution values.
informational Issues | 1 findings
Pending
#1 informational Issue
Floating pragma solidity version
Adding the constant version of solidity is recommended, as this prevents the unintentional deployment of a contract with an outdated compiler that contains unresolved bugs.