web3.unity icon indicating copy to clipboard operation
web3.unity copied to clipboard

Contract.SendWithReceipt never completes

Open frostmyr opened this issue 2 years ago • 3 comments

Describe the bug We just migrated to version 2.5.5 and we are adjusting our minting feature code. We have an issue where executing a method from our SC with SendWithReceipt doesn't work. There is no error shown in the console, it just stops at message "[Web3] Transaction executed with hash xxx" (attached below).

This is how we created the contract instance:

var web3Builder = new Web3Builder(blockchainConfig, blockchainConfig); // blockchainConfig has the contract address & ABI
web3Builder.Configure((service) =>
{
	service
	.UseUnityEnvironment()
	.UseMultiCall()
	.UseRpcProvider();
	additionalConfigurations(service);
});
web3 = await web3Builder.LaunchAsync();

// Create contract
contract = web3.ContractBuilder.Build(blockchainConfig.contractABI, blockchainConfig.contractAddress);

The additionalConfiguration being:

service
.UseMetaMask()
.UseMetaMaskSigner()
.UseMetaMaskTransactionExecutor();

And finally this is how the SC is accessed:

var method = "approve";
var parameter = new object[]{
    "someAddress",
    "100000000000000000000000000000000000000000",
};

(var res, var receipt) = await contract.SendWithReceipt(method, parameter);
var transactionHash = receipt.TransactionHash;
Debug.Log("Approval granted. Saving result to server now. Hash: " + transactionHash);

However the message "Approval granted" never gets printed, meaning it stopped in the SendWithReceipt method. The transaction does go through obviously, given it prints the hash. If I have to guess the issue is in either of these methods, most probably the later (Contract.cs):

image

Expected behavior The execution should complete and return the receipt instance.

Console errors [Web3] Transaction executed with hash 0xbffd20411f37ece8bec59287c8acaae92dc30612afdcd85e19b470c7205160cc

Screenshots/Video image

Desktop (please complete the following information):

  • Chainsafe SDK version: 2.5.5
  • Unity Version: 2022.3.10f1 WebGL
  • Operating System: Windows 10

frostmyr avatar Apr 15 '24 07:04 frostmyr

@juans-chainsafe , would you mind taking a look 🙏🏼 ...

boorich avatar Apr 15 '24 08:04 boorich

Apologies... After further inspection it's actually our fault, we input the wrong RPC.

frostmyr avatar Apr 15 '24 09:04 frostmyr

No worries .. 🙏🏼

boorich avatar Apr 15 '24 09:04 boorich