setRekayHub reverts

I just deployed my Paymaster to Polygon Mainnet and i wanted to set the RelayHub so as to be able to use it, but trying to do that lead to a revert, i was passing this as arg this contract as arg Contract Address 0x6C28AfC105e65782D9Ea6F2cA68df84C9e7d750d | PolygonScan

As you can see if I simulate the Tx it fails, and i didn’t want to spend too much gas trying in for real as it was making me pay like 1 MATIC just for setting the RelayHub

This is the address of the paymaster Contract Address 0x1687b1ee417b6c08ea984ca3eb1c7a3a777e8d7c | PolygonScan

Hey, which version of OpenGSN does your project use?

The version which i am using is 2.2.6

Thanks! From your screenshot it seems that your paymaster is calling _supportsERC165Interface, which is checking the RelayHub contract for ERC165 conformance. We can also see that the RelayHub contract doesn’t conform to ERC165. I think this is what’s causing the revert. I’m not sure why this would be the case though. ERC165 conformance isn’t included in v2.2.6 of the contracts package.

I checked the GitHub and ERC165 conformance was introduced around January 30th of this year: OG-411: Add ERC-165: Standard Interface Detection (#755) · opengsn/gsn@04a93a9 · GitHub. This would have been after that Polygon mainnet RelayHub contract was deployed (May 2021). Judging from the import statement in your paymaster, are you using the repo locally?

Hey! Thanks for que quick response! That image was using a simulator of Tenderly once the paymaster was deployed on the Polygon Mainnet.

No problem! Can you check if the BasePaymaster in your project includes these changes: OG-411: Add ERC-165: Standard Interface Detection (#755) · opengsn/gsn@04a93a9 · GitHub? It looks like your paymaster is requiring that the RelayHub contract conform to ERC165. Which it doesn’t, so this operation can never succeed.

You are right it’s requiring it to conform with ERC165, and yeah my bad apparently i’m indeed using the beta version 3.0.0

To solve this then, i should downgrade the version back to 2.2.6 where it does not check for ERC165 no?

Yep! That should solve the issue. Unfortunately, I think you’ll have to deploy a new paymaster.

Thanks! I’ll see if it works