1

Let's say we have a smart contract for a game, the players of which can stake some amount of money and subsequently win or lose some amount of money in proportion to the amount staked. A gambling game.

Now let's say that the contract contains these two lines

uint fee = msg.value * percentage / 100;
(bool success, ) = _owner.call{value: fee}("")

Is this a rake?

What if the staking solely takes the form of the price to mint (for example) an ERC721 token, and the the owner is just the minter, and the fee is just a royalty from a transaction of the minted thing?

1 Answer 1

0

First, if you are creating a gambling contract, be sure your company is registered for gaming in your jurisdiction and that you limit your customers as required by your gaming license. This is not legal advise.

This is a rake and a fee, there is no distinction between those words. But if you have not registered your company for gaming then carefully read your local laws (and anywhere you could be extradited to) if those laws do distinguish between rakes and fees then it might make a difference between whether you might, for example, do 3 years in jail or 10.

As to the implementation, performing a call at the time of fee collection is not recommended. Best practice here is to use the "withdraw pattern". Please see this at https://docs.soliditylang.org/en/latest/security-considerations.html. In addition to being the best practice for security reasons, it is also beneficial because it will reduce overall gas fees for your system.

2
  • 1. Was using call as recommended here, viz., balanceOf[msg.sender] = 0;/(bool success, ) = msg.sender.call.value(amount)("");/require(success, "Transfer failed.");. 2. Is, say, OpenSea registered for gaming? 3. If I remove the owner's fee altogether (maybe renounce ownership of the contract altogether) and am only involved in the capacity of offering a UI for the contract, would I still have to register The Company for gaming? "The company" is a few lines of code, atm. Undeployed contract + react app.
    – user90019
    Jan 31, 2022 at 17:18
  • I can say for sure what the rules are (and they different based on where each of your customers are). But do remember that how you market your product is an important part of these rules. Jul 30, 2022 at 14:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.