BloomThis NFT (V2) Security Audit Report
Are Your Funds Safe?
Our expert team at Callisto Network has conducted an in-depth security audit of the BloomThis NFT smart contract. This audit aims to ensure the security of your funds by identifying and assessing any potential vulnerabilities. Here, we present our findings:
Executive Summary
This report presents the results of the security audit conducted by the Callisto Network Security Department on the BloomThis NFT smart contract in February 2023. It analyzes the contract’s security posture in-depth and highlights any identified vulnerabilities.
1. Scope of the Audit
Commit 717807a5e20928a007f76cbac9046c14c0fa647a
2. Audit Findings
Our audit reported a total of 0 finding(s), categorized as follows:
- 0 high-severity issue(s).
- 0 medium severity issue(s).
- 0 low-severity issue(s).
In addition to these findings, our audit identified 6 additional points, detailed in the following sections:
- 3 note(s).
- 3 owner privilege(s).
2.1 Owner privileges
- New NFT tokens can only be minted by an authorized admin using the function
mint()
. - Token fusion rules can only be added by an authorized admin using the function
addFusionRule()
. - The royalty fee collected by admins can be changed by the admin using the function
setRoyaltyInfo()
for the rewards collected impacting the reward per token for the users.
[/bsf-info-box]
2.2 Infinite minting of tokens possible
_maxTokens
is initialized as zero, it will allow the admin to mint unlimited tokens.[/bsf-info-box][bsf-info-box icon_type=”custom” icon_img=”id^11679|url^https://callisto.network/wp-content/uploads/2023/04/star-svgrepo-com.png|caption^null|alt^null|title^star-svgrepo-com|description^null” img_width=”20″ icon_animation=”fadeIn” title=”Code snippet:”]
[/bsf-info-box]
2.3 Follow good coding practice
Many functions in the code base lack documentation. This hinders reviewers’ understanding of the code’s intention, which is fundamental to correctly assess not only security, but also correctness. Additionally, docstrings improve readability and ease maintenance. They should explicitly explain the purpose or intention of the functions, the scenarios under which they can fail, the roles allowed to call them, the values returned, and the events emitted.
Consider thoroughly documenting all functions (and their parameters) that are part of the contracts’ public API. Functions implementing sensitive functionality, even if not public, should be clearly documented as well. Consider following the Ethereum Natural Specification Format (NatSpec) when writing docstrings.
2.Unspecific compiler version pragma
Contracts should be deployed with the same compiler version and flags they have been most tested with. Locking the pragma helps ensure that contracts do not accidentally get deployed using, for example, the latest compiler, which may have higher risks of undiscovered bugs. Contracts may also be deployed by others, and the pragma indicates the compiler version intended by the original authors.[/bsf-info-box]
2.4 Transfer function dependent on gas costs
Each opcode supported by the EVM has an associated gas cost. For example, SLOAD, which reads a word from storage, currently costs 200 gas. The gas costs aren’t arbitrary. They’re meant to reflect the underlying resources consumed by each operation on the nodes that make up Ethereum. Any smart contract that uses transfer() or send() is taking a hard dependency on gas costs by forwarding a fixed amount of gas: 2300.
In case when associated gas costs increase the function would fail to leave admin/users unable to withdraw or claim royalty from the contract leading to a denial of service (DoS).[/bsf-info-box][bsf-info-box icon_type=”custom” icon_img=”id^11679|url^https://callisto.network/wp-content/uploads/2023/04/star-svgrepo-com.png|caption^null|alt^null|title^star-svgrepo-com|description^null” img_width=”20″ icon_animation=”fadeIn” title=”Code snippet:”]
- https://github.com/Realmstack/BloomThisSmartContracts/blob/717807a5e20928a007f76cbac9046c14c0fa647a/contracts/BloomThis.sol#L249
- https://github.com/Realmstack/BloomThisSmartContracts/blob/717807a5e20928a007f76cbac9046c14c0fa647a/contracts/BloomThis.sol#L277
[/bsf-info-box][bsf-info-box icon_type=”custom” icon_img=”id^11678|url^https://callisto.network/wp-content/uploads/2023/04/Mask-Group-7.png|caption^null|alt^null|title^Mask Group 7|description^null” img_width=”20″ icon_animation=”fadeIn” title=”Recommendation:”]
It is recommended to stop using the transfer() and send() in your code and switch to using call() instead. And follow the following protective measures to prevent re-entrancy attacks.
- Make sure all internal state changes are performed before the call is executed. This is known as the Checks-Effects-Interactions pattern.
- Use a reentrancy lock (ie. OpenZeppelin’s ReentrancyGuard.)
[/bsf-info-box]
3. Security Practices
4. Conclusion
The audited smart contract can be deployed. No security issues were found during the audit.
It is recommended to adhere to the security practices described in pt. 4 of this report to ensure the contract’s operability and prevent any issues that are not directly related to the code of this smart contract.
5. Revealing Audit Reports
About Callisto Network
Founded by Dexaran, co-founder of Ethereum Classic, Callisto Network is a blockchain platform that prioritizes security. We’ve conducted over 330 smart contract audits across platforms like Ethereum, Ethereum Classic, and EOS. In addition to our audits, we’ve developed the ERC 223 token standard and CallistoNFT standard, enhancements over existing standards that address flaws and offer new capabilities, further establishing us as industry leaders in crypto-security.