js icon indicating copy to clipboard operation
js copied to clipboard

SDK-Can not getContractList when deploy contract use GASLESS.

Open legiarung opened this issue 3 years ago • 3 comments

When i deploy contract with network GEORI and success. Then I use method const list = await sdk.getContractList(currentAddress) to get all List contract .

I get the result that no contracts can be found deployed using gasless and using a regular wallet is successful.

I tested with RINKEBY network, it was successful and no error Can you help me to test GEORI network and mainnet networks.

legiarung avatar Oct 03 '22 04:10 legiarung

Deploying gasless-ly is dangerous because the deployer can be the gasless relayer. This is probably why you're not seeing the contracts in the contract list of the original caller. The deployer address is probably your relayer

joaquim-verges avatar Oct 13 '22 22:10 joaquim-verges

@joaquim-verges

Oh i see, ie it will be deployed with the wallet registered in openzeplin. So how when a customer uses gasless to sign a contract but uses gasless, the customer is still the owner of that contract. Do you have any workarounds? Thank you

legiarung avatar Oct 14 '22 03:10 legiarung

The way it works for gasless tx is that on the relayer (like OZ defender) we use a Forwarder contract to propagate the address of the caller to the target contract. That works for regular contract calls, which can then read that original caller address, but it doesn't work for direct deploys, since those cannot extract the original caller address. It is possible to make it work using a Factory contract to deploy the contracts though

joaquim-verges avatar Oct 14 '22 03:10 joaquim-verges

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Dec 13 '22 03:12 stale[bot]