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

Can't use custom function in the Smart Contract #1196

Closed
OmeGaCinoS opened this issue Oct 16, 2024 · 2 comments
Closed

Can't use custom function in the Smart Contract #1196

OmeGaCinoS opened this issue Oct 16, 2024 · 2 comments
Labels
Type: Bug Added to issues and PRs if they are addressing a bug

Comments

@OmeGaCinoS
Copy link

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 OmeGaCinoS added the Type: Bug Added to issues and PRs if they are addressing a bug label Oct 16, 2024
@kantagara
Copy link
Contributor

Hey can you maybe try and change the RPC? Sometimes that can also do the trick

@kantagara
Copy link
Contributor

@OmeGaCinoS did you manage to make it work or you still have the issue? I'll close it if you don't reply soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Added to issues and PRs if they are addressing a bug
Projects
None yet
Development

No branches or pull requests

2 participants