Microsoft Azure cloud and Ethereum Tools Automating the Blockcities Scavenger Hunt


#1

Amazing work to community members @codyborn and @prestonattebery

This process is automated through two bots built using the Azure visual workflow and the Ethereum Blockchain connector. The Ethereum Blockchain Connector enables actions such as submitting transactions, reading contract state, and trigger flows on contract updates within Azure visual workflow. Using this, the two bots automatically check the map for accurate answers until someone guesses correctly, proceed to mint the digital collectible and then announce a winner on Twitter.

Clue Announcement Bot :robot:

The clue announcement bot is an Azure Function (serverless compute) that wakes up every minute and decides whether or not it needs to announce a clue on Twitter. It does this by accessing the hunt database to get the latest state and checking the current time. It then uses a simple formula to accelerate the rate of clue release until it runs out of clues for a given hunt or someone successfully identifies the Point of Interest corresponding to the correct clue answer.

Solution Checker Bot :robot:

This bot is triggered every 10 minutes during the duration of the scavenger hunt. To build this bot we’ve used Azure Logic Apps which handles the communication to the Ethereum smart contract, the FOAM API, and the database. The Ethereum Blockchain connector makes it easy to read and write state to a smart contract

(FindMatchingPOIs) Calls an Azure Function which looks through the hunt database and calls FOAM API to find a matching Point of Interest (POI) via fuzzy matching.

(if found matching)
Body of the Azure Function will contain information about the matching POI listingHash

(Parse matching response)
Deserializes the hunt information from the Azure Function response to collect the FOAM listingHash and the token information

(Get FOAM Listing)
Call FOAM API to get the Ethereum Address of the owner of the correctly added Point of Interest

(Create Token)
This step uses the Ethereum Logic App Connector to mint the NFT. It calls the mint function, providing the owner, tokenId, and metadataUrl for the unique building collectible.

(Tweet Victory)
Post a tweet as Blockcities account, announcing the winner with an image of the newly minted digital collectible.

We just announced the FOAM Grants Program, intended to support similar initiatives built using the FOAM API. You can read more about the program here:


Potential Applications for FOAM
NY Blockchain Week Scavenger Hunt - New Point System, Leaderboard & Prizes!