Skip to content

lijing-2008/raffle-gifts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Raffle Gifts

Rust Version Rust Version Rust Version Github stars Github forks

🚧 🚀 Under construction... 🚀 🚧


About   |   Features   |   Technologies   |   Requirements   |   Starting   |   Usage   |   License   |   Author

🎯 About

Welcome to Raffle Gifts, it is a NFT game inspired by Asphalt 8, and developed on NEAR Blockchain. The game offers two user roles. As an Administrator, you can mint NFTs into the prize pool. As a normal user, you can draw NFTs with spending some NEARs.

✨ Features

✔️ Role: Admin & normal user

✔️ Smart Contract built with NEAR + RUST

✔️ Frontend built with React + Vite + unocss + Antd

✔️ NFTs provide 4 levels: N & R & SR & SSR

✔️ Raffle spending provide 3 levels: 0.1 Ⓝ / 0.2 Ⓝ / 0.5 Ⓝ

✔️ Odds of winning

NEAR Cost N R SR SSR
0.1 Ⓝ 40% 30% 25% 5%
0.2 Ⓝ 25% 35% 30% 10%
0.5 Ⓝ 10% 40% 35% 15%

🚀 Technologies

✅ Requirements

Before starting 🏁, you need do some preparations.

🏁 Starting

Deploy Smart Contract

# Compile WASM file
cd nft-contract
./build.sh

# Deploy
export NFT_CONTRACT_ID=Your_Account_id
near deploy --wasmFile res/main.wasm --accountId $NFT_CONTRACT_ID --nodeUrl https://public-rpc.blockpi.io/http/near-testnet

Start Frontend UI

cd react-vite
npm install
npm run dev

🎉 Usage

At first, you need to connect to your NEAR wallet just by click the Connect Wallets button.

login.png

🌴 Mint NFTs

You need to login with administrator account id

mintNFT.png

Select your NFT image from local directory, its media url will input automatically. Then input other necessary info. At last, click the Mint button to redirect to connect your wallet and confirm your transaction. if you haven't set your web3.storage token, you need to set it at first, when you select a pic there is a modal offer you for setting.

setWebToken.png

☘️ Raffle NFTs

You need to login with regular user account id

raffleNFT.png

Make your choise how much would you spend to raffle NFTs, the most recently raffle NFT will show on your right side, and all your NTFs will show.

✌️ Transfer NFTs

You can transfer your NFT to anyone else, but the owner must be yourself.

transferNFT.png

when your cursor hover the NFT you will get a tooltip, which show you some details, and offer the ability to transfer your NFT, you just need to input the account name who you want to transfer to.

🌈 Account Management

You can view your Account Balance Details when hover the avatar, and you can logout by click the logout button. If you are the contract owner, you will see a button named "Manage admins", click it to manage Administrators, you can add and delete administrator for now.

userManage.png

Account details contain below:

  • total
  • available
  • stateStaked
  • staked
  • total NFTs (owned by your account)

📝 License

This project is under license from MIT. For more details, see the LICENSE file.

Made with ❤️ by Crazy Coder LJ

🥷🏻 Just enjoy yourself

You can deploy the contract in your account, and play with it!

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages