How to pass empty bytes to a solidity function in Remix?

Viewed 2796

I couldnt figure out a way to pass empty bytes to a solidity function on remix. Here is my function

    function checkEmptyBytes(bytes calldata _data) external pure returns (string memory){
        if (_data.length > 0){
            return "NOT_ZERO";
        }
        return "ZER0";
        
    }

On remix, I have to pass _data such that it should return "ZERO"

2 Answers

You can input the [] expression representing an empty array.

screenshot

You can also use 0x (normally a bytes value is in the form of 0x123456, while 0x is basically an empty bytes).

Related