CRYPTO NEWS

Trizzy Tre

#Trizzy Tre #TheSupremeTeam
Artist Name: Trizzy Tre

Who are you?

I am a rapper inspiring this world and leading the lost to the most high. From melodic rap to clean rap/hip hop, I’m a versatile artist.

Where are you from?

I was born in DC and started my music career in Greensboro, NC but now live in Tampa, Florida and the music scene is poppin in Florida.

How can we follow you?

https://linktr.ee/officialtrizzytre

Song Title: All Things

Listen to Trizzy Tre:

Source: https://supremepr.us/

require(condition, "message") vs revert with a custom Error(), which is better and why?

For Example: /** Custom Errors **/ ///`cid` is an invalid Ipfs-Cid /// @param cid Ipfs-Cid entered. error InvalidCid(string cid); ///Sender’s address isnt valid error InvalidSenderAddress(address sender); function _addCid(string memory _cid) public { /// @dev Check for valid Cid //check using require require(bytes(_cid).length > 0, "Cannot accept empty Cid"); //check using custom error if(bytes(_cid).length < 0)::Listen

For Example:

/** Custom Errors **/     ///`cid` is an invalid Ipfs-Cid     /// @param cid Ipfs-Cid entered.     error InvalidCid(string cid);          ///Sender's address isnt valid     error InvalidSenderAddress(address sender);    function _addCid(string memory _cid) public {                              /// @dev Check for valid Cid                  //check using require         require(bytes(_cid).length > 0, "Cannot accept empty Cid");                  //check using custom error         if(bytes(_cid).length < 0)          revert InvalidCid(_cid);                        /// @dev Check for valid sender's address                   //require function         require(msg.sender != address(0), "Cannot be called from 0x0 address.");              //revert function          if(msg.sender == address(0))         revert InvalidSenderAddress(msg.sender);  function proceed();  }      

In the above code, I’ve used both revert and require for each of the validations-

  • Valid Ipfs-Cid
  • Valid sender’s address

My question is which one should I use and why?

Trizzy Tre

Shopping cart
There are no products in the cart!
Continue shopping
0