'How can i create a function to validate if an user can mint?

i used to use for erc720 this function isValidSignatureNow, but now i am working with erc1155 i need a function like that.

i am trying to mint but before i need to know if that wallet can mint for that i created a function isAvailable but right now i am getting

TypeError: Member "isValidSignatureNow" not found or not visible after argument-dependent lookup in address. --> Migrations.sol:112:16: |

how can i solve that error?

if i fixed that error, my code is looking good to mint?

function isAvailable(
    bytes memory signature, address _firmante
) internal view returns (bool whiteListed) {
    bytes32 result = keccak256(
        abi.encodePacked(msg.sender)
    );
    //doing hash by result
    hash= ... // dont care yet
    return isValidSignatureNow(_firmante, hash, signature);
}

i want to use this function 'isValidSignatureNow' from : https://docs.openzeppelin.com/contracts/4.x/api/utils



Solution 1:[1]

SignatureChecker is a library and for call a method inside it, you must use this statement:

[libraryName].[methodName]([parameters]);

In your case, you must to change this line of code:

return isValidSignatureNow(_firmante, hash, signature);

in this way:

return SignatureChecker.isValidSignatureNow(_firmante, hash, signature);

NOTE: Remember to import the SignatureChecker library in your smart contract.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Kerry99