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

Not getting response after a transaction #1092

Closed
Tracked by #1009
DDFabwelt opened this issue Aug 8, 2024 · 1 comment · Fixed by #1123
Closed
Tracked by #1009

Not getting response after a transaction #1092

DDFabwelt opened this issue Aug 8, 2024 · 1 comment · Fixed by #1123
Assignees
Labels
fixed-in-3.0 Type: Bug Added to issues and PRs if they are addressing a bug

Comments

@DDFabwelt
Copy link

Describe the bug
I am using the following code to transfer custom ERC20 token
var transferResponse = await Web3Accessor.Web3.Erc20.Transfer(contractAddress, toAccount, amountTransfer); Debug.Log("Transfer Response : "+transferResponse");

The transfer is being successful, but not getting the response.
When the transaction is completed getting the following Logs :

  1. [Web3] [WalletConnect SDK] Got generic response for type System.String
  2. [Web3] [WalletConnect SDK] Transaction executed successfully. Hash: 0x06f0a9d2058d043dbcf35aea7c7d680b846db777c1cf38c8aa8279a042544f33.
  3. (The error) WalletConnectException: RPC method eth_blockNumber is not supported. If you add a new method you have to update WalletConnectProvider code to reflect those changes. Contact ChainSafe if you think a specific method should be included in the SDK.

So in the above code the following line is not being invoked
Debug.Log("Transfer Response : "+transferResponse");

And as the Transaction Hash number in another Scripts (In locked/Compiled script of chainsafe), we can't directly use this hash now as not getting the response.

I have used many Testnet to check this, like

  1. Sepolia
  2. Polygon Amoy
  3. Aurora Testnet

Steps
Steps to reproduce the behavior:

  1. Use any testnet from Sepolia, Polygon Amoy, Aurora Testnet or anyother.
  2. Transfer custom ERC20 to another wallet address.
  3. Now we'll get the error WalletConnectException: RPC method eth_blockNumber is not supported. If you add a new method you have to update WalletConnectProvider code to reflect those changes. Contact ChainSafe if you think a specific method should be included in the SDK.
    and we can't Log the transferResponse as next line is not being executed.

Expected behavior

  1. After the transaction we should able to see the response by Debug.Log and transaction status. Or we should be able to access the Transaction Hash

Console errors
After transaction successful we get the following logs with the error which prevent to get the response.

Previous few Logs :

  1. [Web3] [WalletConnect SDK] [JsonRpcProvider] Got payload {"id":441111095383043,"jsonrpc":"2.0","method":"irn_subscription","params":{"id":"6e046ae0b80835064c92da26ce0a2b51b4614f111f07a918ff307786ce8aa253","data":{"topic":"d9a8c66ba16a80adcee2c1a5c44a796ebf8d732794bf6df94c04f61fa52bca7d","message":"AAUtqbCimsGtE1M2KmHIvPNk6WkVT/CSFC5eg7oK/U7eAukMwb0LfgfyKKXIqGYVj1hSd9uqPIoPgWfghfIuvKzRO+QcDdLf64X1AF6Hn3GDQnIZreEBTb6/fIMLnDbl6cTugDl+h50JhXEtfhz/pudzR8Ee8+GwYTzh7v4XYWcZgN6VMBHuB9+26sO8IRHrepI=","publishedAt":1723090216180,"tag":1109}}}
  2. UnityEngine.Debug:Log (object)
  3. [Web3] [WalletConnect SDK] [JsonRpcProvider] Payload has ID 441111095383043
  4. [Web3] [WalletConnect SDK] Got generic response for type System.String
  5. [Web3] [WalletConnect SDK] Got response for type System.String
    1. [Web3] [WalletConnect SDK] Got generic response for type System.String
    1. [Web3] [WalletConnect SDK] Transaction executed successfully. Hash: 0x06f0a9d2058d043dbcf35aea7c7d680b846db777c1cf38c8aa8279a042544f33.

The Actual error :
WalletConnectException: RPC method eth_blockNumber is not supported. If you add a new method you have to update WalletConnectProvider code to reflect those changes. Contact ChainSafe if you think a specific method should be included in the SDK.
ChainSafe.Gaming.WalletConnect.WalletConnectProvider.Perform[T] (System.String method, System.Object[] parameters) (at <933ddf5316cf4e488cadc5f0b4c08b42>:0)
ChainSafe.Gaming.Evm.Providers.RpcProviderExtensions.GetBlockNumber (ChainSafe.Gaming.Evm.Providers.IRpcProvider provider) (at <6c43ab0ac0c54046b61790aa61a978c0>:0)
ChainSafe.Gaming.Evm.Providers.RpcProviderExtensions.GetTransaction (ChainSafe.Gaming.Evm.Providers.IRpcProvider provider, System.String transactionHash, System.Nullable1[T] timeOut) (at <6c43ab0ac0c54046b61790aa61a978c0>:0) ChainSafe.Gaming.WalletConnect.WalletConnectTransactionExecutor.SendTransaction (ChainSafe.Gaming.Evm.Transactions.TransactionRequest transaction) (at <933ddf5316cf4e488cadc5f0b4c08b42>:0) ChainSafe.Gaming.Evm.Contracts.Contract.SendWithReceipt (System.String method, System.Object[] parameters, ChainSafe.Gaming.Evm.Transactions.TransactionRequest overwrite) (at <6c43ab0ac0c54046b61790aa61a978c0>:0) ChainSafe.Gaming.Evm.Contracts.Contract.Send (System.String method, System.Object[] parameters, ChainSafe.Gaming.Evm.Transactions.TransactionRequest overwrite) (at <6c43ab0ac0c54046b61790aa61a978c0>:0) ChainSafe.Gaming.Evm.Contracts.BuiltIn.Erc20Contract.Transfer (System.String destinationAddress, System.Numerics.BigInteger amount) (at <6c43ab0ac0c54046b61790aa61a978c0>:0) TransferToken.TransferErc20 (System.String contractAddress, System.String toAccount, System.Numerics.BigInteger amountTransfer, System.Action2[T1,T2] _onTransferSucceed) (at Assets/Blockchain/Scripts/TransferToken.cs:15)
System.Runtime.CompilerServices.AsyncMethodBuilderCore+<>c.b__7_0 (System.Object state) (at <51fded79cd284d4d911c5949aff4cb21>:0)
UnityEngine.UnitySynchronizationContext+WorkRequest.Invoke () (at :0)
UnityEngine.UnitySynchronizationContext.Exec () (at :0)
UnityEngine.UnitySynchronizationContext.ExecuteTasks () (at :0)

Reproducible Code Snippet (if applicable):
If the issue is related to a specific piece of code, provide the relevant code snippet here.

public static async void TransferErc20(string contractAddress, string toAccount, BigInteger amountTransfer, Action<BigInteger, bool> _onTransferSucceed)
{
    var transferResponse = await Web3Accessor.Web3.Erc20.Transfer(contractAddress, toAccount, amountTransfer);
    // The following lines are not being invoked even the transfer is successful, we get the error mentioned above
    Debug.Log("Transfer Response : "+transferResponse);
    var output = SampleOutputUtil.BuildOutputValue(transferResponse);
    Debug.Log("<Color=green> Log: " + output+ "  ERC-20  "+ nameof(Erc20Service.Transfer));
}

Desktop (please complete the following information):

  • Chainsafe SDK version: 2.6
  • Unity Version: 2022.3.35f1
  • Operating System: Windows 10

Additional context
The last time I have tested on Sepolia network
The network config :
Chain Id : 11155111
Chain : Sepolia
Network : ETH
Symbol : ETH
RPC : https://rpc.sepolia.org

My project Id : cd4c1f93-3cab-4d36-ade1-3ec3fa410a8f

The contract address 0x24383f6AC03b6B43ae95CFb83C88762Af1e142E8 is deployed on Sepolia through Remix Ide.

I am transferring using Metamask using this address 0xB65f5Ac5eAD9598f7Ec61c8C89033B970dA7B77D

The same error we'll get when we will call EVM.GetTransactionStatus.

@DDFabwelt DDFabwelt added the Type: Bug Added to issues and PRs if they are addressing a bug label Aug 8, 2024
@rob1997 rob1997 self-assigned this Aug 23, 2024
@rob1997 rob1997 mentioned this issue Aug 26, 2024
59 tasks
@kantagara
Copy link
Contributor

Hey thanks for your report. We'll fix this in the upcoming release of the SDK that's planned to be released in 2-3 weeks.

@rob1997 rob1997 linked a pull request Sep 5, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fixed-in-3.0 Type: Bug Added to issues and PRs if they are addressing a bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants