EthereumCommonwealth / Auditing

Ethereum Commonwealth Security Department conducted over 400 security audits since 2018. Not even a single contract that we audited was hacked. You can access our audit reports in the ISSUES of this repo. We are accepting new audit requests.
https://audits.callisto.network/
GNU General Public License v3.0
132 stars 34 forks source link

BloomThis NFT #677

Closed yuriy77k closed 1 year ago

yuriy77k commented 1 year ago

BloomThis Audit request

... Briefly describe your smart-contract and its main purposes here ...

BloomThis NFT token

https://github.com/Realmstack/BloomThisSmartContracts/tree/main/contracts/README.md

Source code

... Give a link to the source code of contracts ...

https://github.com/Realmstack/BloomThisSmartContracts/blob/main/contracts/BloomThis.sol

Payment plan

... Write [x] at the checkbox of the payment plan that suits your needs ...

Disclosure policy

... Do you want us to publish the report as it is or to notify you privately in case of finding critical mistakes? ...

... provide your conditions for publishing the report or leave only standard disclosure policy link ...

Standard disclosure policy.

Contact information (optional)

... Provide information to contact you or the smart contract-developer in case high severity issues will be found ...

... Provide information about the media resources of the project you want us to audit (website/ twitter account/ reddit/ telegram channel/ etc.) ...

team@realmstack.com

Platform

... In which network will your contract be deployed? (EOS/TRX/ETC/ETH/CLO/UBQ/something else ) ...

Polygon Matic

yuriy77k commented 1 year ago

the audit fee is 1000 USDT. You may send USDT (ERC20 or BEP20) to: 0x6317c6944bd1cD3932d062cce39d7Fd602119529

The estimated auditing time - is 7 days after payment.

yuriy77k commented 1 year ago

payment received: https://bscscan.com/tx/0x126bc0666ee7f79b47c4ec3b4cff7b1fe328050bc187b93b249a1ea1f5347a97

yuriy77k commented 1 year ago

High-severity issues were found in the contract. The audit report was sent to the developer.

yuriy77k commented 1 year ago

BloomThis NFT (V2) Security Audit Report

1. Summary

BloomThis NFT smart contract security audit report performed by Callisto Security Audit Department

2. In scope

Commit 717807a5e20928a007f76cbac9046c14c0fa647a

BloomThis.sol

3. Findings

In total, 0 issues were reported, including:

In total, 6 notes were reported, including:

3.1. Owner Privileges

Severity: owner privileges

Description

  1. New NFT tokens can only be minted by an authorized admin using the function mint().

  2. Token fusion rules can only be added by an authorized admin using the function addFusionRule().

  3. 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.

3.2. Infinite minting of tokens possible

Severity: note

Description

If _maxTokens is initialized as zero, it would allow the admin to mint unlimited tokens.

Code snippet

3.3. Follow good coding practice

Severity: note

Description

  1. Missing docstrings.

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. When writing docstrings, consider following the Ethereum Natural Specification Format (NatSpec).

  1. Unspecific compiler version pragma

Contracts should be deployed with the same compiler version and flags that they have been tested the most 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.

3.4. Transfer function dependent on gas costs

Severity: note

Description

Gas refers to the unit that measures the amount of computational effort required to execute specific operations on the Ethereum network. Since each Ethereum transaction requires computational resources to execute, each transaction requires a fee. Gas refers to the fee required to conduct a transaction on Ethereum successfully. Gas fees are paid in Ethereum's native currency, ether (ETH). Gas prices are denoted in gwei, which itself is a denomination of ETH - each gwei is equal to 0.000000001 ETH (10-9 ETH).

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).

Code snippet

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.

4. Security practices

5. 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.

6. Revealing audit reports

Previous audit report: https://gist.github.com/yuriy77k/77fa9584d2e96c0b75236a89c2ad10ce