About | Features | Technologies | Requirements | Starting | Usage | License | Author
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.
✔️ 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% |
Before starting 🏁, you need do some preparations.
# 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
cd react-vite
npm install
npm run dev
At first, you need to connect to your NEAR wallet just by click the Connect Wallets button.
You need to login with administrator account id
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.
You need to login with regular user account id
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.
You can transfer your NFT to anyone else, but the owner must be yourself.
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.
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.
Account details contain below:
- total
- available
- stateStaked
- staked
- total NFTs (owned by your account)
This project is under license from MIT. For more details, see the LICENSE file.
Made with ❤️ by Crazy Coder LJ
You can deploy the contract in your account, and play with it!