NFT raffle contract Product Description & Technical requirements

NFT raffle contract Product Description & Technical requirements


Product Description & Technical requirements

We want to add some game mechanics to NFT's on Getgems.

One of the things that come up to mind is NFT ruffle mechanics.

Basic mechanics are pretty simple:

  • Bob chooses NFT(s) he would play with
  • Alice finds Bob's game on marketplace
  • Alice offers her NFT(s) to Bob
  • One Bob & Alice agree on NFT's game starts
  • Smart contract shuffle's NFT's between Alice & Bob

We think that all stages but the last one should be off-chain and handled by the marketplace itself.

The contract is only responsible for the random shuffle of NFT's and safe transfer of them.

Let's list the possible outcomes for a simple game where Bob plays with one NFT and Alice plays with one NFT too:

  • Both NFT's goes to Bob
  • Both NFT's goes to Alice
  • Bob's NFT goes to Alice and Alice's NFT goes to Bob
  • Nothing happens


Technical description

Smart-contract should:

  • accept transfers of NFT's from both sides
  • shuffle NFT's between owners
  • send them to the new owners
  • support various number of NFT's from one or both sides (e.g. Bob plays with 1 NFT & Alice plays with 2, or they both play with 10 NFT's)
  • support optional fix-size fees for marketplace
  • swap message should be somehow idempotent so that one can retry if some of the NFT’s require a non-standard amount of TON’s for transfer
  • have the ability to return your NFT(s) if the second side has not transferred their NFT

Marketplace fees

Since we want to support marketplace fees for swapping NFT’s contract developer should come up with some solution of who is paying those fees.

One of the solutions is to split fees between two sides (share percentage should be configurable at deployment).

Development requirements

  • The contract should be covered with tests
  • The solution should follow the style of Getgems contracts (http://github.com/getgems-io/nft-contracts). Including tests, code for interacting with the contract, and code for setting it up.



Report Page