Skip to content

Checks whether the player owns a token from a particular smart contract before granting them permission to enter the club.

Notifications You must be signed in to change notification settings

decentraland-scenes/nft-scanner

Repository files navigation

NFT Scanner

demo of nft-scanner scene running in preview.

demo

Description

Checks whether the player owns a token from a particular smart contract before granting them permission to enter the club. In this example, we're checking whether the player owns a key from The Meta Key project.

Note: There's a basic version of this scene here that performs simpler token checks.

Instructions

Walk up to the door and press the E key to see if you can access the club. The door will open and the audio quality increases if you own the Genesis Key, which is the first key minted from this contract contract. Please feel free to modify the contractAddress along with the tokenID within the game.ts file to test other scenarios - you'll also need to update the abi.ts file to with the corresponding Contract ABI, which can be found using at https://etherscan.io/address/ with the contract address appended at the end of the URL.

Use your mouse to look around and W A S DSpace keys on your keyboard to move forward, left, backward, right and jump respectively. You can also press the P key to adjust the graphics settings.

Try it out

Install the CLI Download and install the Decentraland CLI by running the following command:

$ npm i -g decentraland

Previewing the scene Download this example and navigate to its directory, then run:

$  dcl start

Any dependencies are installed and then the CLI opens the scene in a new browser tab.

Add the following to the end of the URL in the browser window:

&ENABLE_WEB3

For example, if the URL is http://192.168.1.132:8000?position=0%2C0&SCENE_DEBUG_PANEL then change it to http://192.168.1.132:8000?position=0%2C0&SCENE_DEBUG_PANEL&ENABLE_WEB3

Note: Make sure you have a browser wallet installed like Metamask or Fortmatic as you'll need to be logged onto those with the network set to the Ethereum Mainnet in order for the scene to perform checks on your wallet address.

Acknowledgements

About

Checks whether the player owns a token from a particular smart contract before granting them permission to enter the club.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published