0

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

1 Answer 1

1

Extend your contract with SignatureChecker.sol from openzeppelin like this:

// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "@openzeppelin/contracts/utils/cryptography/SignatureChecker.sol";

contract SignatureCheckerMock {
    using SignatureChecker for address;

    function isValidSignatureNow(address signer, bytes32 hash, bytes memory signature) public view returns (bool) {
        return signer.isValidSignatureNow(hash, signature);
    }
}
4
  • please with erc1155 not erc720
    – signup
    May 6 at 22:53
  • 1
    @signup this has nothing to do with erc721 or erc1155. This is a library that can be used in any contract and your job is to use it at the correct place in your logic :)
    – Majd TL
    May 7 at 12:08
  • @MajdTL but i am getting this error Member "isValidSignatureNow" not found or not visible after argument-dependent lookup in address.
    – signup
    May 9 at 20:27
  • TypeError: Member "isValidSignatureNow" not found or not visible after argument-dependent lookup in address. --> Migrations1.sol:134:16: | 134 | return _signer.isValidSignatureNow(hash, signature); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
    – signup
    May 9 at 20:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.