---
# System prepended metadata

title: CHILI ROASTING CONTRACT

---

# CHILI ROASTING CONTRACT 

GOAL: Give $CHILI holders a place to stake $CHILI in order to earn the secondary currency $r(oasted)CHILI based on the amount staked and length of time staked. 

## KEY REQS: 
* Ownable by DAO
* Stake CHILI 
* Earn CHILI (based on time & amt staked)
* Claim rCHILI
* DAO can update Rewards 
* Burn function for rChili by owner

## UX Flow: 

1.  Airdrop $CHILI (mainnet or Matic)
1.  User bridges to Matic (if minted on Mainnet) + stakes $CHILI in single transaction  
1.  User switches to Matic 
1.  User collects rCHILI 
1.  User burns rCHILI to buy NFT
1.  NFT can be redeemed (burned) on matic or mainnet

### UX Flow Notes:

Can set up lazy minting for both the NFT and the $CHILI token. Can only bridge to mainnet if condition X is met. Idea is that condition X is based on successful token distro. 

Might want to run our own relayer, hold a little matic, so that we don't have to pay any one else fees. 

Uses Create2, so that once we launch ERC20 on Matic it reserves the address on mainnet (same w/ NFT).

Can use CollabLand for initial community organizing tool (can be implemented early next week). 

## SPECS: 

rChili will be a non-transferable ERC20 token. 

### Data:
Data objects that we need to track: 
* Total Staked(for info)
* Member => Stake(s) 
* Member => Stake => Periods
* Member => Rewards Earned
* Member => Rewards Withdrawn
* Period => Roasting Rate
* rCHILI per CHILI
* rCHILI per period 


### Functions 

**Stake**: Function to stake CHILI. Saves member, how much they staked, and when they staked. 

**Claim Rewards**: Function to claim previously unclaimed rCHILI earned by a member to-date. 

**Get  Rewards**: Function to view the claimable rewards.

**Withdraw Stake**: Function to withdraw staked CHILI and claim previously unclaimed rCHILI earned by a member to-date.

**Update Rewards**: Function to update the rate at which a staker earns their rCHILI per CHILI.

**Burn rChili**: Function that allows the contract owner (the DAO) to burn a user's or users' rChili. 

**Migrate**: Function to migrate balances to an upgraded contract at some point in the future.

### Next Steps:

1. Launch $CHILI on Matic using the lazy minting (by Feb 7th). 
2. Launch CollabLand on Matic for private token permissioned chat (by Feb 7th).
3. Figure out community management responsibility. 
4. Figure out distribution and execute it on Feb. 14th. 
5. Work on farming contracts and NFT contracts aiming for marketing on Feb 14th. 
6. Consider use of DAOhaus for DAO that controls NFT minting.  


# CHILI Contract
  
GOAL: Create an ERC-20 token on Matic that is restricted to the Matic network until such time as a DAO with governance power over the $CHILI token permits holders to withdraw CHILI onto mainnet (or other side chains). 

## KEY REQS: 
* Uses ERC-20 standard 
* Ownable (will be owned by a DAO)
* Includes EIP-712 Permit Function 
* Special withdraw function controlled by owner that will allow or disallow moving the token off Matic

## Creation Flow: 

1.  Launch CHILI Token contract on Matic with withdraw function set to false
2.  Mint 1,000,000 CHILI Tokens 
3.  Transfer the 1,000,000 to an airdrop contract on Matic
4.  Transfer ownership role to a minion on mainnet controlled by the MetaCartel mainnet DAO 
5.  ...At some point in the future the owner (a DAO minion) will set withdraw to true, which will allow holders to transfer CHILI to mainnet. 

## SPECS

* ERC-20 
* Permit 
* Pausable (by owner) 
* Ownable 
* Special Withdraw Check 
    * Require withdrawCheck == true for holders to move CHILI off of Matic network to mainnet. When withdraw == false, holders CANNOT move CHILI from Matic to mainnet. 
    * Simple OnlyOwner function to change withdrawCheck state to true. 


