Logo:
Name: Cold Beer 404
Ticker Symbol: BEER404
Network: Pulsechain
Contract Address: 0x0760F66ed7139aaa70Dc21c8f9E75167e295D4Ab

Purpose:
Who doesn’t love a Cold Beer?
If you obtain a whole token you will be gifted 1 of 5 mouthwatering pints of Cold Beer, in the form of an NFT. If beer spills and that value goes below 1 your NFT will be burned.
Cold Beer 404 was created using the PulseCoin ERC-404 Factory.
It was also launched in collaboration with CoinHub, a telegram channel affiliated with the 9inch DEX.
Enjoy a Cold Beer today!! 🍻

Project URL: https://pulsemarket.app/collection/0x0760f66ed7139aaa70dc21c8f9e75167e295d4ab
Project social media: Twitter, Telegram
Contract Source Code: Link
Audit(s): B9.xyz

REVIEWED BY: CapBurningWater

Review Date: 02/04/2024
Reviewer: Captain Burning Water
Contract Name: Cold Beer 404
Deployed at: https://scan.9mm.pro/token/0x0760F66ed7139aaa70Dc21c8f9E75167e295D4Ab?tab=contract

Initial notes: This review concerns the Cold Beer 404 (BEER404) token, which utilizes the PulseCoinERC404 contract for deployment.

Contract Purpose and Scope: PulseCoinERC404 is an ERC404 token implementation designed for minting Non-Fungible Tokens (NFTs) with customizable token URI and metadata.

Security Considerations:

  1. Access Control: Access control is enforced for certain functions, such as setting the token URI and modifying the name and symbol of the token.
  2. Data Validation: Input parameters are validated, such as ensuring the length of image URLs and colors match during contract initialization.
  3. State Changes: State changes are appropriately handled within functions, adhering to best practices.
  4. Error Handling: Error handling is implemented for critical operations, ensuring safe contract execution.
  5. Events and Logs: Events are emitted for important state changes, enhancing transparency.

Code Review:

  1. Code Quality: The code appears well-structured and follows Solidity best practices, except for the tokenUri function.
  2. Logic Flow: The logic flow is clear and easy to follow, with proper validation and control structures, except for the tokenUri function.
  3. Modularity: The contract is modular, with distinct functions for different purposes.
  4. Comments and Documentation: Comments are provided for functions and constructors, aiding in understanding the contract’s functionality.

Function-Specific Review:

– setDataURI: Sets the data URI for the token.

– setTokenURI: Sets the base token URI for the token.

– setNameSymbol: Sets the name and symbol of the token.

– tokenURI: Generates the token URI with dynamic metadata based on the token ID.

WARNING:

In the constructor or elsewhere in the code, there is no reference to a minimum or maximum number of images/colors. However, the tokenURI function makes use of 5 images/colors. The code as it is can cause two problems:

  1. If more than 5 images/colors are provided, those exceeding 5 will never be used.
  1. If fewer than 5 images/colors are provided, there will be an “index out of bounds” error, which could potentially break the deployment.

To handle this scenario properly, you should either ensure that the images array always has at least 5 elements before invoking the tokenURI function or modify the function to handle cases where the array may contain fewer elements, as described in the previous response.

Final notes: Cold Beer 404 (BEER404) was created with 5,000 tokens, each associated with a unique image URL.

Conclusion:

The Cold Beer 404 under the PulseCoinERC404 contract appears to be well-implemented and follows best practices, with the exception noted in the warning.

B9.xyz IS NOT OPTIMIZED TO BE VIEWED USING THE CURRENT RESOLUTION. IF YOU ARE USING A MOBILE PHONE, PLEASE ROTATE AND USE LANDSCAPE MODE.

Scroll to Top