-
High - 100xp
-
Medium - 20xp
-
Low - 2xp
-
Starts: June 06, 2024 Noon UTC
-
Ends: June 13, 2024 Noon UTC
- nSLOC: 218
- Complexity Score: 145
This code was created for Codehawks as the first flight. It is made with bugs and flaws on purpose. Don't use any part of this code without reviewing it and auditing it.
Created by Naman Gautam
-
Dussehra, a major Hindu festival, commemorates the victory of Lord Rama, the seventh avatar of Vishnu, over the demon king Ravana. The festival symbolizes the victory of good over evil, righteousness over wickedness. According to the epic Ramayana, Ravana kidnaps Rama's wife, Sita, leading to a brutal battle between Rama and his allies against Ravana and his forces. After a ten-day battle, Rama emerged victorious by slaying Ravana, marking the victory of virtue and the restoration of dharma. Dussehra is celebrated with grand processions, reenactments of Rama's victory, and the burning of effigies of Ravana, symbolizing the destruction of evil forces. It signifies the enduring significance of courage, righteousness, and the eventual victory of light over darkness.
-
The
Dussehra
protocol allows users to participate in the event of Dussehra. The protocol is divided into three contracts:ChoosingRam
,Dussehra
, andRamNFT
. TheChoosingRam
contract allows users to increase their values and select Ram, but only if they have not selected Ram before. TheDussehra
contract allows users to enter the people who like Ram, kill Ravana, and withdraw their rewards. TheRamNFT
contract allows theDussehra contract
to mint Ram NFTs, update the characteristics of the NFTs, and get the characteristics of the NFTs.
This contract allows users to increase their values and select Ram if all characteristics are true. If the user has not selected Ram before 12 October 2024, then the Organizer can select Ram if not selected.
increaseValuesOfParticipants
allows users to increase their values(or characteristics) and become Ram for the event. The values will never be updated again after 12 October 2024.selectRamIfNotSelected
- Allows the organizer to select Ram if not selected by the user.
This contract allows users to enter the people who like Ram, kill Ravana, and withdraw their rewards.
enterPeopleWhoLikeRam
allows users to enter the event like Ram by paying an entry fee and receiving the ramNFT.
killRavana
—Allows users to kill Ravana, and the Organizer will receive half of the total amount collected in the event. This function will only work after 12 October 2024 and before 13 October 2024.withdraw
- Allows ram to withdraw their rewards.
This contract allows the Dussehra contract to mint Ram NFTs, update the characteristics of the NFTs, and get the characteristics of the NFTs.
setChoosingRamContract
- Allows the organizer to set the choosingRam contract.mintRamNFT
- Allows the Dussehra contract to mint Ram NFTs.updateCharacteristics
- Allows the ChoosingRam contract to update the characteristics of the NFTs.getCharacteristics
- Allows the user to get the characteristics of the NFTs.getNextTokenId
- Allows the users to get the next token id.
NFTs are minted with the following characteristics:
ram
: address of userisJitaKrodhah
: false // JitaKrodhah means one who has conquered angerisDhyutimaan
: false // Dhyutimaan means one who is intelligentisVidvaan
: false // Vidvaan means one who is knowledgeableisAatmavan
: false // Aatmavan means one who is self-controlledisSatyavaakyah
: false // Satyavaakyah means one who speaks the truth
- git
- You'll know you did it right if you can run
git --version
and you see a response likegit version x.x.x
- You'll know you did it right if you can run
- foundry
- You'll know you did it right if you can run
forge --version
and you see a response likeforge 0.2.0 (816e00b 2023-03-16T00:05:26.396218Z)
- You'll know you did it right if you can run
git clone https://github.com/Cyfrin/2024-06-Dussehra
cd 2024-06-Dussehra
forge test
forge coverage
and for coverage based testing:
forge coverage --report debug
- In Scope:
├── src
│ ├── ChoosingRam.sol
│ ├── Dussehra.sol
│ ├── RamNFT.sol
- Solc Version:
0.8.20
- Chain(s) to deploy contract to:
- Ethereum
- zksync
- Arbitrum
- BNB
Organizer - Organiser of the event and Owner of RamNFT contract
User - User who wants to participate in the event
Ram - The user who has selected Ram for the event
None