Lorem ipsum dolor sit amet, consectetur adipiscing elit lobortis arcu enim urna adipiscing praesent velit viverra sit semper lorem eu cursus vel hendrerit elementum morbi curabitur etiam nibh justo, lorem aliquet donec sed sit mi dignissim at ante massa mattis.
Vitae congue eu consequat ac felis placerat vestibulum lectus mauris ultrices cursus sit amet dictum sit amet justo donec enim diam porttitor lacus luctus accumsan tortor posuere praesent tristique magna sit amet purus gravida quis blandit turpis.
At risus viverra adipiscing at in tellus integer feugiat nisl pretium fusce id velit ut tortor sagittis orci a scelerisque purus semper eget at lectus urna duis convallis. porta nibh venenatis cras sed felis eget neque laoreet suspendisse interdum consectetur libero id faucibus nisl donec pretium vulputate sapien nec sagittis aliquam nunc lobortis mattis aliquam faucibus purus in.
Nisi quis eleifend quam adipiscing vitae aliquet bibendum enim facilisis gravida neque. Velit euismod in pellentesque massa placerat volutpat lacus laoreet non curabitur gravida odio aenean sed adipiscing diam donec adipiscing tristique risus. amet est placerat in egestas erat imperdiet sed euismod nisi.
“Nisi quis eleifend quam adipiscing vitae aliquet bibendum enim facilisis gravida neque velit euismod in pellentesque massa placerat”
Eget lorem dolor sed viverra ipsum nunc aliquet bibendum felis donec et odio pellentesque diam volutpat commodo sed egestas aliquam sem fringilla ut morbi tincidunt augue interdum velit euismod eu tincidunt tortor aliquam nulla facilisi aenean sed adipiscing diam donec adipiscing ut lectus arcu bibendum at varius vel pharetra nibh venenatis cras sed felis eget dolor cosnectur drolo.
In the second part of How to make a Scavenger Hunt, we are going to focus on the tech stack needed and how Mentaport takes care of all the hard parts for you.
Deploying a scavenger hunt with Mentaport takes four steps:
We will be using both the Core and the Supplement Mentaport SDKs in this tutorial. We are finishing our admin web portal, which will help make the contract creation and adding rules much easier in the near future, but for now, we are going to jump into code.
Grab the spreadsheet you made in Part 1, and let's get started!
We will create our contract using Mentaport’s Supplement SDK. This function takes three parameters: ContractName, ContractType, and BlockchainTypes.
For this Scavenger Hunt, we are going to be minting NFTs live, so for ContractType, we pick Blockchain. The other type that can be used is Mintlist, which is used if you want to create a mintlist before the release of your collection.
Mentaport is currently live in three chains: Ethereum, Polygon, and Sui. For this tutorial, we are going to use Ethereum for BlockchainTypes.
Once the contract is created, we are going to add the rules from your spreadsheet from Part 1. We will need the name, description, starting time and duration of the hunt, and the count of NFTs we want to drop. In this tutorial, we are going to only allow 100 NFTs to be found, and you will also set a time window for the hunt of one day.
We will use two important functions:
Mentaport supports different types of contract rules. You can decide between minting a new NFT in each clue or dynamically updating the original NFT to show the progress. Both are very easy to implement with our infrastructure. In the code snippet below, we are adding the first three clues of the spreadsheet. As you can see, the first one is a mint event and the other two are dynamic updates.
If you make all the functions createMintRules, in each step, you will mint an NFT. If you make functions createDynamicRules you will update an NFT. If you look closer at the code, the main difference in the createMintRules and createDynamicRules functions is the type of rule being generated.
Take a look at both functions so you can see how the rules are being made. And this is all that is needed for you to add as many rules as you want to your Scavenger Hunt!
In this part, we are going to add Mentaport SDK to your application. This way, you will be able to securely verify the location of each mint event and execute the rules you just created (mints and dynamic updates).
We will go over three important functions:
The main function that starts location verification is called StartGeoLocation It takes two main parameters: isMobile and walkTime. isMobile should be true if users are only allowed to mint or update on mobile. walkTime is how long the user has to be at the precise location before allowing them to mint or update.
Once location verification starts, you can initiate the event triggers. These allow you to dynamically update individual NFTs according to the context of each player (like the location and time they are at). One of the many helper functions is `getClosestTrigger`. This function will return the closest event triggers to a player. This way, you can inform the players how far and in what direction they should go to find the closest NFT.
The third function you will need is the minting function. You can always call ‘checkMintStatus’ to verify the players are in the correct location and also to check that the rules are still active. Once you call ‘triggerMint’, if the rules pass successfully, the user will be able to mint the NFT on their mobile!
We have both React and Next.js providers to integrate Mentaport’s SDK and make it easier for you.[link]
The last step is to activate and deploy your blockchain contract. During Mentaport’s Private Beta SDK we have the functionality to deploy one of our contracts for you and then transfer the ownership of the contract to your wallet.
If you want to deploy your own contract, let us know! We can walk you through the integration.
For more information, check our documentation. Looking forward to seeing your Scavenger Hunts!