0

I need to pass an empty byte array to a function derived from OpenZeppelin:

function mintTo(address to, uint256 tokenId, uint256 amount) 
{
    bytes memory data;
    _mint(to, tokenId, amount, data);
}

However, although this code compiles and works perfectly, Slither is complaining that this is

is a local variable never initialized

I'm curious how to achieve that?

1 Answer 1

1

You can shut slither up or just use an empty string:

_mint(to, tokenId, amount, "");
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.