Developers Forum for XinFin XDC Network

Discussion on: Bugs / Errors / Wrong Info

Collapse
xcantera profile image
Arturo Cantera Carrasco Author

Another example for the "require()" error.

I was developing/testing something:

Im creating a jackpot game smartcontract on the XDC network.

xdc.blocksscan.io/address/xdc4de3f... - > Smartcontract on XDC

polygonscan.com/address/0x22568f35... - > Smartcontract on Polygon

As you can see, you cant write the smartcontract with Blockscan(You cant write also with remix). Im doing the play buttons(functions) with requires.

function buttonClick() public payable {
require(msg.value == 1 ether, "1 XDC required to bet!");
if (activeGame)
require(msg.sender != getLast(), "You are already winning!");
currentTimeWin = now + 5 minutes;
addressArr.push(msg.sender);
activeGame = true;
}

We know XDC network have a problem and require().... is not working in the network.

On polygon works perfect, on xdc network is not working.

You can get the smartcontract code from the explorers, its verified!