# Smart Contract and flowing of funds

In this page we describe how the Smart Contract controls and regulates the folowing funds between you and the player.
It is crucial that you read and understand the content of this page.

In DeBets there are two types of transaction:

  • transactions that take place on the blockchain: these transactions happen anytime funds flow in and out of the Smart Contract during the life cycle of a player deposit. For instance, when a deposit is created the Smart Contract is invoked by the player wallet to inject funds into it. The injected funds represent the player balance for the newly created deposit. After the player has played some games, when the deposit is closed the Smart Contract is invoked again and, depending on the change in balance with respect to the amount initially deposited, the Smart Contract either sends the amount won to the player taking it from the balance of the corresponding gaming account or it adds the amount lost by the player to the corresponding gaming account.

  • offchain transactions that takes place within DeBets Offchain Transaction Protocol: these transactions take place while games are being played each time the player balance changes as a result of betting or winning. In order not to impact the player experience it is crucial that such transactions introduce no delay and require no fee. This is made possible by DeBets Offchain Transaction Protocol. In this protocol a transaction is basically an agreement between the player and you on the balance change that occurs in a deposit after the player bets or wins. Such agreement consists in both parties (you and the player) to mutually sign a message that represents the balance change with their respective private keys. To know more about this mechanism and to understand the complete working of DeBets Offchain transaction protocol consult the user documentation.

This pages focuses on the transactions of the first type.

All the information that will be provided can be better understood and verified by looking at the source code of DeBets Smart Contract. The Smart Contract is deployed on the blockchains that are currently supported by DeBets and its source code is verified in the corresponding block explorer. This guarantees that the source code shown in the block explorer corresponds exactly to the bytecode of the deployed contract.

The following table lists the contract address on each supported blockchain:

Blockchain Contract Address
Binance Smart Chain 0xB4696f825e57AD1DbB996B4e61488Df2247E92b7
Binance Smart Chain (testnet) 0xcDA81681CAC43958ab3d1C485FE6B7908ebb163F
Ethereum %CONTRACT_ADDR_1%
Ethereum (testnet) 0xDC219271d5090b1cD591C1B89B0bf995D78f6113

Clicking on the address will show the verified source code of the contract in the block explorer.