question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Hi,

Is there a plan to have working integration with GSNProvider? I’ve made some tryouts and that didn’t work. An example:

const ethers = require('ethers');
const { GSNProvider } = require('@openzeppelin/gsn-provider');
const Web3 = require('web3');

const WEB3_PROVIDER = 'http://localhost:8545';
const web3 = new Web3(WEB3_PROVIDER);
const gsnProvider = new GSNProvider(WEB3_PROVIDER, { signKey: privateKey });
web3.setProvider(gsnProvider);

const provider = new ethers.providers.Web3Provider(web3.currentProvider);
const wallet = new ethers.Wallet(privateKey, provider);

const sampleContract = new ethers.Contract(ADDRESS, ABI, wallet);
await sampleContract.someWriteFunction();
// Error: "Error: sender doesn't have enough funds to send tx. The upfront cost is: XXXXXXX and the sender's account only has: 0"

Thanks!

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
yuetloocommented, Apr 2, 2020

Looking into this issue at the moment. One of the reasons the GSNProvider does not work with ethers web3Provider currently because GSNProvider only passes eth_sendTransaction, eth_estimateGas, eth_getTransactionReceipt, to the relayer and ethers uses eth_sendRawTransaction.

On Apr 1, 2020, at 6:53 PM, Matt notifications@github.com wrote:

Hey! Just wanted to see what the status of this was? I’d love to have support for the @openzeppelin/gsn-provider package referenced above. I pretty much exclusively use ethers, but always have to bring in web3 just for GSN support.

@ricmoo https://github.com/ricmoo I believe your example above would work if we had a private key, but if we only have the signer I don’t think that approach works?

— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub https://github.com/ethers-io/ethers.js/issues/636#issuecomment-607508677, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEMSI3FSL7VPFVDUIFM2MSDRKOZWTANCNFSM4JF5MG5Q.

0reactions
Benjythebeecommented, Mar 8, 2022

Any update on this? Saw this PR, but it looks like it’s been given up on? https://github.com/ethers-io/ethers.js/pull/836

Read more comments on GitHub >

github_iconTop Results From Across the Web

Can a GSN signer be changed after initialization? - SDK
I deployed a contract that inherits from GSNBouncerSignature using a hardware wallet and I used its address as the GSN signer.
Read more >
Signers - ethers
A Signer in ethers is an abstraction of an Ethereum Account, which can be used to sign messages and transactions and send signed...
Read more >
Issues configuring GSN to work on Binance - OpenGSN forum
const tx = await walletFactory.connect(gsnSigner) // . ... is deployed. the master branch is before adding GSN support to the project.
Read more >
Rari Capital: RYPT Fund Proxy - Etherscan
function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a ... @param newAddress The Ethereum address of the new...
Read more >
How to set private key for Ethers Signer
add some explanation as well. – Achala Dissanayake. Mar 10 at 4:47. Add a comment |. This answer is useful. 0. This answer...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found