• Hi,

    Great plugin idea and something that would be extremely useful, I like the simplistic approach.

    Unfortunately though the current version seems broken, just can’t get it to verify despite the contract address being correct and the NFT present.

    Seeing some stuff in console –

    inpage.js:1 MetaMask - RPC Error: execution reverted 
    Object
    (anonymous)	@	inpage.js:1
    wp-login.php:1 Uncaught (in promise) 
    Object
    code: -32000
    message: "execution reverted"
    Prototype: Object
    constructor: ? Object()
    hasOwnProperty: ? hasOwnProperty()
    isPrototypeOf: ? isPrototypeOf()
    propertyIsEnumerable: ? propertyIsEnumerable()
    toLocaleString: ? toLocaleString()
    toString: ? toString()
    valueOf: ? valueOf()
    __defineGetter__: ? __defineGetter__()
    __defineSetter__: ? __defineSetter__()
    __lookupGetter__: ? __lookupGetter__()
    __lookupSetter__: ? __lookupSetter__()
    __proto__: (...)
    get __proto__: ? __proto__()
    set __proto__: ? __proto__()

    Not sure if any of it is meaningful though, msg me if any more detail might be useful.

    Thanks,
    Stu

Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Author dave123

    (@dave123)

    On which chain is the contract and is it ERC721? There is a known issue with ERC1155. Can you share the contract address?

    Thread Starter stumaxuk

    (@stumaxuk)

    Hey @dave123 , no problem.

    Here’s the one I’m testing with and it’s 721 I believe – 0x244FC4178fa685Af909c88b4D4CD7eB9127eDb0B

    Thanks for the speedy response.

    Thread Starter stumaxuk

    (@stumaxuk)

    Sorry, forgot to add, it’s on eth .

    Plugin Author dave123

    (@dave123)

    I didn’t get any error using that contract. Of course, I don’t have that NFT so the verification didn’t pass, but no console errors.

    The error stack looks like it’s coming from Metamask extension (inpage.js:1) and not the NFT Login plugin’s javascript. Is there anything in the stack from nft-login-module.js?

    At what point does the error occur? After you click the verify button or when the page loads? Maybe try disconnecting and reconnecting your account in Metamask

    Thread Starter stumaxuk

    (@stumaxuk)

    Hi,

    Just checked this again, my bad there’s a detail I forgot to mention.

    For an existing wp user the verification is working, but for a new user registering it isn’t.

    Site is set to allow anybody to register and it will assign them as a contributor.

    Registering is via https://wordpress.site/wp-login.php?action=register

    there’s nothing from inpage:js in console, only thing that isn’t from mm is this from wp-login.php

    Uncaught (in promise) {code: -32000, message: 'execution reverted'}
    Promise.then (async)
    (anonymous) @ nft-login-module.js?ver=1.2.3:147
    Promise.then (async)
    (anonymous) @ nft-login-module.js?ver=1.2.3:143
    Promise.then (async)
    nftlogin_connect_and_verify @ nft-login-module.js?ver=1.2.3:141
    await in nftlogin_connect_and_verify (async)
    onclick @ wp-login.php?action=register:73

    any ideas?

    Many thanks for the support.

    Plugin Author dave123

    (@dave123)

    Yes, this info helps. The plugin uses a contract method called tokenOfOwnerByIndex to determine which token in the collection the account owns. The problem is that I see now that this is an optional part of the spec and not all contracts implement it.

    Your token contract does not implement it and therefore gets error
    https://etherscan.io/address/0x244FC4178fa685Af909c88b4D4CD7eB9127eDb0B#readContract

    For comparison, look at the methods of another token contract which does include the method https://etherscan.io/address/0xa3AEe8BcE55BEeA1951EF834b99f3Ac60d1ABeeB#readContract

    I’ll need to think about how the plugin can still work without this method. Specifically, the content locking feature uses the token id that is found with that method

    Thread Starter stumaxuk

    (@stumaxuk)

    Thanks @dave123 very helpful!

    OK so this contract isn’t the actual one I need to use, just one I have available to test with right now, so this shouldn’t be a problem for my project as I can ensure tokenOfOwnerByIndex is included.

    Unfortunately all other available ones I have for testing are ERC1155 right now, the eventual plan will be to use ERC1155 on Polygon, is this option not possible at the mo?

    Thanks!

    Thread Starter stumaxuk

    (@stumaxuk)

    OK so looks like using 721 will be fine for my use case, but it will need to be on polygon.

    Created this one – 0xd2246De330fD7D65706411Dd35D234FCCA13C6d8

    It works fine for logging in with an exsiting user but not for registering still.

    Also it seems that tokenOfOwnerByIndex isn’t available on poly? Any thoughts on how to have this work for both login and registration?

    Thanks

    Plugin Author dave123

    (@dave123)

    I released a new version 1.2.4 that removed the call to get the token id, or at least not fail when that happens. The token id isn’t really necessary to verifying the user but I was capturing it as part of the registered user’s profile, to maybe add the nft image as their profile image and other things. It’s hard for me to fully test your scenario without buying some new nft’s so let me know if you run into any errors. I appreciate your help

    Thread Starter stumaxuk

    (@stumaxuk)

    Cool, thanks so much!

    I re-tested and registration now works where it didn’t before .

    I still see a similar error in console but it seems of no consequence –

    inpage.js:1 MetaMask - RPC Error: Internal JSON-RPC error. {code: -32603, message: 'Internal JSON-RPC error.', data: {…}}
    (anonymous) @ inpage.js:1
    (anonymous) @ inpage.js:17
    _runReturnHandlers @ inpage.js:17
    _processRequest @ inpage.js:17
    await in _processRequest (async)
    _handle @ inpage.js:17
    handle @ inpage.js:17
    _rpcRequest @ inpage.js:1
    (anonymous) @ inpage.js:1
    request @ inpage.js:1
    bound bound request @ web3-1.6.1.min.js?ver=1.6.1:22
    u.send @ web3-1.6.1.min.js?ver=1.6.1:22
    s @ web3-1.6.1.min.js?ver=1.6.1:10
    n @ web3-1.6.1.min.js?ver=1.6.1:10
    y._executeMethod @ web3-1.6.1.min.js?ver=1.6.1:22
    (anonymous) @ nft-login-module.js?ver=1.2.4:146
    Promise.then (async)
    (anonymous) @ nft-login-module.js?ver=1.2.4:143
    Promise.then (async)
    nftlogin_connect_and_verify @ nft-login-module.js?ver=1.2.4:141
    await in nftlogin_connect_and_verify (async)
    onclick @ wp-login.php?action=register:71
    nft-login-module.js?ver=1.2.4:151 Error in tokenOfOwnerByIndex Error: Internal JSON-RPC error.
    {
      "code": -32000,
      "message": "execution reverted"
    }

    I’m actually wondering at this point, is the NFT check really useful at the registration point if it is always checked at login ? It’s at login where it really matters I guess ? Perhaps it should be optional, anyway just a thought!

    Thanks for the help!

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Broken’ is closed to new replies.