hi @ProgPredator
I look at your contract and your code today, i really like your flashy colors
.
Regarding your contract issue with the oracle your problem didn’t come from the callback, the first call is free but then every call cost you gas and your contract was out ether so out of gas.
When your user is locked it’s impossible to unlock it because you check if his address is false (which is the correct way to do it) but if your contract failed to pay the provable api the user is locked out.
In you smart contract you should use the require before the call to provable_randomDS_proofVerify__returnCode () otherwise you will never check if the call is true of false.
require (msg.sender == provable_cbAddress());
if (provable_randomDS_proofVerify__returnCode(...)
Regarding the ui when i first logged the address was 0x000 , the same thing happen if i switch for an other user.
Why are you not only working with eth in the front and convert them to wei with web3js.utils.
It’s confusing to deposit 1 which is 0.01 Eth and bet 1 which is 0.000000000000000001 Eth
const weiValue = Web3.utils.toWei('1', 'ether');
console.log(weiValue);
// => 1000000000000000000
const etherValue = Web3.utils.fromWei('1000000000000000000', 'ether');
console.log(etherValue);
// => 1
Their is a security issue in your contract you can’t check the amount bet checking the parameter value :
function flip (uint size, uint side) payable public {
....
betting[msg.sender].size = size;
You need to check the msg.value, because someone can use a proxy or directly call your contract without using your web interface and send 0.000001 Eth (as msg.value) and write 10 Eth in your function parameter. He will be able to withdraw all the fund in your contract easily.
Edit: There is a small type in you confirmation function, it should be “confirmation” otherwise your console log will never be display
function inputBet()
...
.on("confirmation", function(conformationNr)
...
Ps: Try to install your package locally with npm, like that when someone clone your project he will just have to do an npm install, some dependencies were missing in your package.json file