[AF1] - Degen Reborn 🏅

DegenReborn, a web3 social meme game with text-based avg style powered by chatgpt. Experience a hilarious, unique life trajectory tailored just for the crypto space, only in DegenReborn! Please watch the demo for a complete illustration.

Challenges

Connect the world with Chainlink

Pool 10,000 ETH

This project utilizes Chainlink Automation and Chainlink Vrf to implement an hourly airdrop mechanism. The hourly airdrop works as follows: first, we have a staking mechanism where users can stake into the corresponding pools. We rank all pools on-chain based on TVL (total value locked). Every few hours, we will airdrop to the top 100 pools by TVL, distributing rewards to users who have staked in the corresponding pool. The top 10 pools will receive a certain amount of airdrop, while 10 out of the remaining 90 pools ranked between 10-100 will be randomly selected for airdrops. We use Vrf for fair random selection and Automation to implement the timing of the airdrop.

Deploy your smart contract on Scroll

Pool 10,000 USDC

The entire deployment process is very smooth and efficient. We used the hardhat-deploy plugin, and with just a few configuration changes, we were able to deploy multiple contracts on scroll seamlessly with just one command. And the contract address on scroll: https://github.com/NirvanaLabHQ/contracts/tree/main/deployments/scrollAlpha Challenge We run into: - Verifying contracts on https://blockscout.scroll.io/ was not very convenient and took a lot of time. Finally, we were able to successfully verify the first ERC1967Proxy contract on Scroll Blockscout (https://blockscout.scroll.io/address/0x3F3d978126426317Ab0C3744443bB68d8753fEB4/contracts#address-tabs), which will benefit other contracts using ERC1967Proxy and future upgrades to the contract. Suggestion: - The testnet lacks some infrastructure, such as Chainlink, so we temporarily run some services in a centralized manner. We also look forward to a more complete ecosystem.

#BUIDLathon 2023 NFTs + Metaverse + Gaming Track

Pool 15,000 USDC

- Hourly airdrops: First, we have a staking mechanism where users can stake into the corresponding pool, and we rank all the pools on-chain based on their TVL. Every few hours, we will airdrop to the top 100 pools ranked by TVL, distributing the airdrop to users who staked in the respective pool. The top 10 ranked pools will receive a certain amount of airdrop, while the remaining 90 pools (ranked 10-100) will randomly select 10 pools for airdrops. The entire airdrop process is fully on-chain and automatically executed without any human intervention. See: https://github.com/NirvanaLabHQ/contracts/blob/feat/airdrop_vrf/src/RebornPortal.sol#L209-L225 - On-chain ranking: Since the airdrop rewards are related to rankings, we decided to do the ranking on-chain to adhere to decentralization and automation principles. The biggest challenge of on-chain ranking is the gas issue. We eventually used a red-black tree to dynamically maintain the on-chain ranking and control gas usage within an acceptable range. See: ETH Denver application - Improvement of referral rewards: We have added a second level to the referral reward structure on-chain and calculated the rewards separately for both Native Token and $REBORN token. See: https://github.com/NirvanaLabHQ/contracts/blob/feat/airdrop_vrf/src/RebornPortal.sol#L693-L722 - Improvement of stake logic: Users can now transfer their staked $REBORN directly to another pool. See: https://github.com/NirvanaLabHQ/contracts/blob/feat/airdrop_vrf/src/RebornPortal.sol#L153-L165 - Contract size optimization: Due to adding some functionalities, a single contract size of 24kb is no longer sufficient. Our main solution is to move some functions into a library and link them dynamically. See: https://github.com/NirvanaLabHQ/contracts/blob/feat/airdrop_vrf/src/PortalLib.sol

Game7 - Verifiable on-chain randomness

Ranked 1,000 USDC

There are two places in Degen Reborn that involve on-chain random numbers, both related to reward distribution. One is the hourly airdrop, which occurs every few hours and involves a random selection process. We use Chainlink's VRF to generate a fair random number for this selection. The other is the final jackpot prize, which involves a large sum of money and is initially done manually. However, the data is transparent and verifiable, and the specific steps are as follows: - Determine the block height for a snapshot in advance. - Obtain the corresponding stake data for the snapshot block and calculate the tokenId to be drawn. - Using block hash as a random seed, a specific script is used to perform the random number selection.

Project details

DegenReborn is a web3 social game with text-based, avg style life simulation experience powered by chatgpt. DegenReborn was designed to incorporate Defi & Social mechanisms into the game-play along with NFT elements. The game was first idealized in late January 2023, and brought to life just before EthDenver. From the period of Feb 24 to March 5, we have developed multiple outstanding game elements and contents using cutting edge technical approaches including Staking, Burning, chainlink automation, chainlink vrf, onchain Red-black tree and more. Since this was an existing project and we are only showcasing our bonus, standalone features built during EthDenver, please reach out if you have any questions or concerns regarding eligibility.