Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Not a paymaster contract: unknown account #0 #988

Open
mattpeskett opened this issue Aug 11, 2023 · 6 comments
Open

Error: Not a paymaster contract: unknown account #0 #988

mattpeskett opened this issue Aug 11, 2023 · 6 comments

Comments

@mattpeskett
Copy link

Trying to run a NodeJS script to send a meta transaction for a simple example contract. I've followed the OpenGSN instructions here.

I'm getting the error when trying to initialize a RelayProvider. I'm using the TestPaymasterEverythingAccepted deployed to the Arbitrum Goerli network and I'm using the latest ^3.0.0-beta.9 versions of the @opengsn/contracts and @opengsn/provider packages. I'm passing the web3 provider into the newWeb3Provider function but it fails because there's no account. I'm not familiar with the web3 package and I can't seem to find how to configure it with accounts. I've tried web3.eth.accounts.wallet.add(process.env.PRIVATE_KEY) but that doesn't seem to affect the web3 provider. Any help would be appreciated!

Error

Error: Not a paymaster contract: unknown account #0 (operation="getAddress", code=UNSUPPORTED_OPERATION, version=providers/5.7.2)
    at /Users/1/code/solidity/GSN-with-HardHat-main/node_modules/@opengsn/common/src/ContractInteractor.ts:260:72

My code

Gsn = require('@opengsn/provider');
const Web3 = require('web3');
const Counter = require('../artifacts/contracts/Counter.sol/Counter.json');
async function main() {
    web3 = new Web3(process.env.INFURA_URL);
    chainId = await [web3.eth.net](http://web3.eth.net/).getId()
    const config = {
      paymasterAddress: '0x9dC769B8cBD07131227b0815BEd3526b1f8ACD52',
      loggerConfiguration: {
        logLevel: 'info'
      }
    }
    const provider = await Gsn.RelayProvider.newWeb3Provider({
      provider: web3.currentProvider,
      config
    });
    web3.setProvider(provider);
    //Create a new gasless account:
    user = provider.newAccount();
    counter = new web3.eth.Contract(Counter.abi, '...', {
      from: user.address,
      gasPrice: 0
    });
    //Check current counter value
    const oldCount = await counter.methods.counter().call();
    //Increment count using gasless user
    await counter.methods.increment().send({ gas: 210000 });
}
main()
  .then(() => process.exit(0))
  .catch((error) => {
    console.error(error);
    process.exit(1);
  });
@zhuang-chen0
Copy link

I found that after the release of the beta9 version, the beta9 version configuration cannot be loaded through the network, and the beta8 version was loaded before
image
config url:https://client-config.opengsn.org/3.0.0-beta.9/client-config.json

@mattpeskett
Copy link
Author

I see this message in the logs but I get it for any of the opengsn versions I've tried, including beta 8.

Could not fetch default configuration: Request failed with status code 404

@zhuang-chen0
Copy link

zhuang-chen0 commented Aug 15, 2023

In the latest beta9 version, listAccount is called here, and the obtained address is used to build the paymaster contract object, which causes the contract construction to fail. I have been searching for a long time and do not know where to add this account.
image

@ymyroniuk
Copy link

I have the same an error.
How can I resolve this?

@louis-md
Copy link

louis-md commented Oct 17, 2023

Same issue in v3.0.0-beta.10 with ethers v5 provider

@DenkevichOleg
Copy link

DenkevichOleg commented Dec 25, 2023

Any updates for v3.0.0-beta.10 web3?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants