How do I correctly call my contract?

ZaneBitmanZaneBitman Member Posts: 3
Hi, I have a question about the plugin that I hope someone can help me with.
I am trying to make a very simple game that calls data from a smart contract.

On contruct 2, I have installed both the 'ethereum' and 'ethereum contract' plugins. When I have a collision take place between two sprites, I want it to call the contract to get a stored data. Very basic stuff I think really - for example.. here is my starter contract code..


pragma solidity ^0.4.20;

contract SimpleStorage {
uint storedData;

function set(uint x) public {
storedData = x;
}

function get() public constant returns (uint) {
return storedData;

}
}


-Now, for what I will be doing I won't need to set the storedData to change it because I want it to remain the same, and, frankly I'm still learning how to make a database contract that is unchangeable but one that I can still call and get the response with the data.

When I have sprite | on collision with sprite2 |.....

[url=https://imgbb.com/][img]https://image.ibb.co/jAbPQx/js_error.png[/img][/url]

If anyone can please, please help! I have had so much trouble trying all types of configurations. My only thought is that the call function is broken in the plugin's code, but I'm not sure.

Here is a screenshot of my C2 events for reference. Thank you in advance!

[url=https://ibb.co/m3p0yH][img]https://preview.ibb.co/cJ7W5x/C2_error.png[/img][/url]

Answers

Sign In or Register to comment.