GameFi
  • General Intro
  • 📃R & D
  • 💻Workshop
    • 🏎️NFT Web App Integration
      • 📄Prerequirements
      • Decentralized Storage
      • Smart Contract NFTs
      • Creating the React Dapp
      • Updating Startup File, Wallet Connect & Main Menu
      • Fetching NFTs, Stacks and Hiro API
      • Rendering NFTs owned
      • Selecting an NFT
      • Mapping Scenes
      • Creating the playable game
  • 🪙Trustless Rewards - M1
    • General idea
    • Flow Lobbies
    • Smart Contract
  • 🎨Customizable NFTs - M2
    • General Idea
    • Flow Customizable NFTs
    • Smart Contracts
      • Component
      • Customizable Wrapper
  • 🎁Lootbox on Chain - M3
    • General Idea
    • Tech Explained
    • Smart Contracts
      • Item
      • Lootbox
      • Lootbox Manager
  • 📝Message Signing
    • General Idea
    • GameFi Use Cases
    • App Explained
  • 🪵SFTs
    • General Idea & Base SFTs Static Deployments
    • Metadata Structure
    • Static Flow and Smart Contracts
    • Advanced SFTs Dynamic Deployments
    • Dynamic Flow and Smart Contracts
    • Dapp Integrating SFTs
      • Front End
      • Back End
    • Resources
  • ⚡Subnets
    • Overall for subnets
  • Roadmap
  • 💾Decentralized Storage
    • Gaia
    • Pinata
    • Host SFTs and NFTs into Pinata
    • Gaia integration to host game resources
  • 🔗External Knowledge
    • Getting Started
    • Hiro API
    • Stacks Docs
    • Clarity Book
    • Hiro Tutorials
Powered by GitBook
On this page

Was this helpful?

  1. Lootbox on Chain - M3

Smart Contracts

PreviousTech ExplainedNextItem

Last updated 1 year ago

Was this helpful?

Composition

There are 3 Smart Contracts in the whole interaction:

Items Contract.

This are the final NFT items a user has

Deployment on testnet

Lootbox Contract.

This is a contract that creates the random unique for each NFT and gives the ability directly, with only 1 function call, to the owners to redeem the equivalent item after the block with specified block height is minted.

Deployment on testnet

Lootbox Manager

Is a contract for managing who can mint and how many lootboxes.

Users should not be able to mint freely looboxes directly because that would abuse the system and would compromise the whole point of rarities.

The admin of the lootbox-manager facilitate the minting for selected addresses based on events he consider properly ( eg. addresses that whitelisted have 2 lootbox-mints or winner of a tournament gets 3 lootbox-mints )

Deployment on testnet

🎁
https://explorer.stacks.co/txid/ST15DF8K1Z4XQ952AC2GFY106XRTNJSWE9SP6VZYA.background-item?chain=testnet
https://explorer.stacks.co/txid/ST15DF8K1Z4XQ952AC2GFY106XRTNJSWE9SP6VZYA.lootbox-background?chain=testnet
https://explorer.stacks.co/txid/ST15DF8K1Z4XQ952AC2GFY106XRTNJSWE9SP6VZYA.send-lootbox?chain=testnet