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

Can't use custom function in the Smart Contract

Open OmeGaCinoS opened this issue 1 year ago • 0 comments

Hello there!

Last time I got a bug with my custom function but, I was not up to date, and I'm still can call custom function like that :

public async void CreateAndJoinBidRoom(int bidAmount) //need to be done by the master { var contract = Web3Accessor.Web3.ContractBuilder.Build(CONTRACT_ABI, ContractAddress); var res = await contract.Call("createBidRoom", new object[] { bidAmount }); Debug.Log(res[0]); }

My Smart Contract is working outside in Remix - Ethereum

Here is the error I got when I call this function : 

image

Here the text : Web3Exception: RPC returned error for "eth_call": -32000 err: insufficient funds for gas * price + value: address 0x914bB2708176F8C53AC6F2472E5383CD6165C0F1 have 280919403061739604 want 350488576650000000 (supplied gas 50000000) at ChainSafe.Gaming.Evm.Providers.RpcClientProvider.Perform[T] (System.String method, System.Object[] parameters) [0x00000] in <00000000000000000000000000000000>:0 Rethrow as Web3Exception: eth_call: bad result from RPC endpoint at ChainSafe.Gaming.Evm.Providers.RpcClientProvider.Perform[T] (System.String method, System.Object[] parameters) [0x00000] in <00000000000000000000000000000000>:0

When I'm creating on Remix everything is working fine, I got enough Token

Here is my Smart Contract PvPPepe.txt

OmeGaCinoS avatar Oct 16 '24 21:10 OmeGaCinoS