Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/epintos/nft-game-smart-contract
Solidity smart contract to play a simple NFT Game with Players and a Boss
https://github.com/epintos/nft-game-smart-contract
ethereum smart-contract solidity
Last synced: 22 days ago
JSON representation
Solidity smart contract to play a simple NFT Game with Players and a Boss
- Host: GitHub
- URL: https://github.com/epintos/nft-game-smart-contract
- Owner: epintos
- Created: 2025-01-12T18:42:11.000Z (about 1 month ago)
- Default Branch: main
- Last Pushed: 2025-01-19T19:14:48.000Z (23 days ago)
- Last Synced: 2025-01-19T20:23:26.799Z (23 days ago)
- Topics: ethereum, smart-contract, solidity
- Language: Solidity
- Homepage:
- Size: 18.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## NFT Game Solidity Smart Contract
This is a practice project where I explore and experiment with various Solidity concepts.
Developed a smart contract to simulate a basic game using NFTs.
- User can mint certain characters with abilities.
- User can attack a boss. The boss is unique and doesn't revive (for now).
- The attack damage is calculated randomly using Chainlink VRF.Known issues:
- Chainlink subscription creation in Anvil fails unless `blockhash(block.number + 1)` is updated in the `createSubscription` function in `SubscriptionAPI` mock contract.## Usage
### Install
```shell
$ make install
```### Test
```shell
$ make test
```### Deploy
```shell
$ make deploy-anvil
``````shell
$ make deploy-sepolia
```### Fund metamask or others
```shell
$ make fund-account
```### Interactions
Mint:
```shell
$ make mint-nft CHARACTER_INDEX=0
```Attack:
```shell
$ make attack TOKEN_ID=0
```