WalletConnect / WalletConnectModalFlutter

The WalletConnectModal for WalletConnect built using Flutter.
https://pub.dev/packages/walletconnect_modal_flutter
Apache License 2.0
20 stars 18 forks source link

Ethereum contract example #13

Closed Hardu2203 closed 12 months ago

Hardu2203 commented 1 year ago

Firstly thanks for this awesome repo, its better than sliced bread

Were you able to get the store contract to work?

I connected to a local ganache-cli chain and deployed the store contract to it.

I cannot see something clearly wrong?

I call the store function like this

image

And then I get back

image

The call works fine through remix

image

Any advice would be appreciated.

Luzzotica commented 1 year ago

My first thought is that perhaps the wallet is unpacking the transaction incorrectly and causing you the issue.

Are you using MetaMask? It looks like you are. I have had issues with them not including required fields in the JsonRpcError object. I'll make the code nullable to resolve this issue, but technically that shouldn't be possible according to the JSON RPC spec.

Hardu2203 commented 1 year ago

Hi Sterling,

Thanks for the quick responses! 😁

Yes I am using metamask, I will keep on investigating to see if I can get it working somehow.

I wish I could see the index.android.bundle to see what is going on in line 3652.

But it just errors on metamask's side and then the message gets sent back saying it failed, so this is a hard one to solve.

Luzzotica commented 1 year ago

The newest version of the library should let you see the error being returned from metamask (Even with a null message).

Luzzotica commented 12 months ago

I have created a custom contract call here: https://github.com/WalletConnect/Web3ModalFlutter/blob/2981053456ecd3511ca2e3a7f0def7c75e22af62/example/sign/lib/utils/crypto/eip155.dart#L197

Please mimic it for other SC calls.

Hardu2203 commented 11 months ago

Hi Luzzotica,

Thank you for all the effort, I appreciate it.

I tried with the latest metamask version. And it seems like it cannot find the return value balance?

image

Everything in the code looks fine to me, what wallet did you use while testing?

Also the transaction gets automatically rejected which is strange as well...

image