Developers Forum for XinFin XDC Network

Discussion on: Bugs / Errors / Wrong Info

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. - > Smartcontract on XDC - > 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;
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!