# Contract design

By [ChanceDAO](https://paragraph.com/@chancedao) · 2022-03-25

---

_Chance DAO's gameplay has already been introduced, and this article will briefly describe the gameplay from a contractual perspective._

Chance contract covered all rules of play.

Draft Diagram of Chance DAO contract
------------------------------------

![Draft Diagram of Chance DAO contract](https://storage.googleapis.com/papyrus_images/9d15bf067588bd989b27d6a2c9741dca7100c8f3cb77d39fa0979fa470fcd89a.png)

Draft Diagram of Chance DAO contract

Chance DAO contract
-------------------

📝The chance contract contains four core contracts:

**1️⃣Chance**

**2️⃣ChanceDrop**

**3️⃣Chance Invite**

**4️⃣VRFv2Consumer**

🧐Details of the rules can be found with [**How to Play**](https://mirror.xyz/0x766318f5c6728bb9e83618b23C87E21091a16E7D/IpGaMcM3wREHY8fiKELcUaTJtg_5Kze3WJRUYQGN9q4)

### 🔴Chance contract

Based on ERC721 Chance contract be in charge of Minting and withdrawing the winning amount or rebate amount through this contract

### 🟡ChanceDrop contract

Responsible for picking a winner at random, the random numbers are generated by oracles.The winning rule is a 90% probability of being elected in the current round of minted NFTs, 10% probability of being elected in the history round of minted NFTs.

### 🔵ChanceInvite contract

This is an invitation promotion contract.You can set your own unique invitation code, When the invitee mints NFT within 30 days, there will be a 10% minting price awards to you.When you successfully invite 10 people, you can withdraw all your rebate rewards from Chance contract.

### 🟢VRFv2Consumer contract

A contract that request true random numbers, you can check the details to see how it works: [**VRFv2Consumer contract.**](https://docs.chain.link/docs/chainlink-vrf/)

**👇Smart contract code has been uploaded to Github, please check it out!**

[https://github.com/ChanceDAO](https://github.com/ChanceDAO)

---

*Originally published on [ChanceDAO](https://paragraph.com/@chancedao/contract-design)*
