Inspiration

This team has always loved games and technology. With Web3, we see a new world of possibilities opening right before our eyes. We truly believe in decentralization and the ownership of assets, and NFTs represent that very well for us.

The ability to have NFTs while enjoying a game, and then use them in another game that has made them compatible, is completely new. Or, if you decide to shift focus and sell your NFTs, that is also worth noting.

With the experience we all have in building applications, we decided this was the perfect entry point for us into the Web3 world. Given our common interests, we have built a unique NFT generator and a game that uses those NFTs, merging reality with virtuality.

What it does

Frankie is our product that comprises two main functionalities:

1. Dynamic NFT Collection Management Tool

This tool aims to store as much information as possible on-chain and uses a verifiable random algorithm to generate each NFT as a combination of various traits. It also incorporates another NFT to determine the ownership of a collection. Although a collection is not editable after publishing, it still generates royalties and future commissions on every trait.

2. Surf Game

We created a game called Surf Game that utilizes our NFTs. This game interacts with the real world by using a marine forecast API to determine game conditions. It also employs the VRF (Verifiable Random Function) to ensure that even under similar conditions, each NFT will surf uniquely. After completing a surf session, the NFT's traits, such as Surf Level and Surf Experience, will increase.

Admin Functionalities

We have also included some basic admin functionalities that, while raw in terms of UI/UX, were essential during development:

  • Pass and Royalties: This section allows us to set the pass price and withdraw any amount resulting from users minting passes when deploying their collections. We can also withdraw our commission for every NFT minted.
  • Surf Game Admin: This functionality enables us to set permissions and define which collections the game can interact with, as well as simulate automation requests.

How we built it

Collection Management

The first thing we defined and built is the product infrastructure, which consists of the following components:

  • RandomManager: This smart contract manages requests from our contracts to the Chainlink VRF.
  • PassConfig and Pass NFT: This NFT is essential for managing each collection. The manager includes functions to assist in this management.
  • Shop Manager: This smart contract handles the minting and pricing for the created collections. It uses the Chainlink price feed aggregator to convert the price from USD to AVAX in real time.

Once the infrastructure is ready, the CollectionConfig and CollectionNFT contracts can be deployed:

  • CollectionConfig: Represents the configuration of the collection, including all traits and definitions.
  • CollectionNFT: Represents instances of the collection.

Our frontend simplifies the deployment process, abstracting technical details. Users can define traits, set their appearance chances, and distributions, which are used with the VRF seed number to generate each NFT.

After deployment, the collection is marked as complete and cannot be changed. Permissions are granted to the new contract, and the collection becomes available for minting through the shop manager. During deployment, a pass is generated to act as the ownership token for the collection. The collection name and address are written to the pass instance, facilitating trading. The pass owner receives revenue from each mint, while our product takes a 1% commission.

For this, we used the following Chainlink products:

  • Chainlink VRF: For the fair generation of each NFT. Chainlink VRF
  • AVAX-USD: For converting AVAX to USD for collection pricing.

Surf Game

The Surf Game uses real marine forecast data to determine wave conditions. Data is fetched every 6 hours from Open-Meteo. Our frontend also provides a 7-day forecast to simulate real scenarios where users can choose the best day for their NFTs to surf.

For this, we used the following Chainlink products:

  • Chainlink VRF: For the fair generation of each wave surfed. Chainlink VRF
  • Chainlink Functions: To fetch current wave conditions and set them in the game. Chainlink Functions
  • Time-Based Upkeep: To fetch current wave conditions at 12-hour intervals. Time-Based Upkeep
  • Custom Logic Upkeep: To run the main game loop. It runs when 60 seconds have passed since the last run, there are surfers waiting, wave seeds ready, and current wave conditions are set. Custom Logic Upkeep

Challenges we ran into

Technical Challenges

  • Limits on Contract Data: We faced constraints on the amount of data that could be stored within our smart contracts. This required us to optimize and rethink our data storage strategies.
  • Message Signing and Verification: Ensuring that messages came from the correct wallet, even when the transaction was submitted by another wallet, posed a significant challenge. We had to implement robust mechanisms for signing and verifying messages.
  • Solidity Limitations: We encountered several limitations within Solidity that we were previously unaware of, necessitating changes to our original design and implementation plans.
  • Tracking Solidity Errors: Unexpected errors in Solidity, particularly those that caused transactions to revert without clear reasons, were difficult to track and debug. This required extensive troubleshooting and testing.

Development Challenges

  • Dynamic Metadata with ERC Standards: Implementing ERC standards for dynamic metadata correctly was challenging. We had to ensure that our NFTs could adapt and update metadata dynamically while maintaining compliance with ERC standards.
  • Team Health: Rapha was sick for an entire week, which affected our progress. We were concerned about losing valuable time. Fortunately, Rapha recovered and returned even stronger, enabling us to deliver the MVP we had envisioned.

Despite these challenges, our team's resilience and problem-solving abilities allowed us to overcome obstacles and achieve our goals.

Accomplishments that we're proud of

  • End-to-End Functionality: We successfully implemented a process that works from start to finish. We can mint new collections and have passes representing their ownership.
  • Royalties System: Royalties are automatically paid to the pass owner, with a percentage retained by the contract as a commission for running the service and covering infrastructure costs.
  • Zero Knowledge Proof for Pass Deployment: We enabled the deployment of collections using zero-knowledge proofs, even when the contract is deployed by our server wallet. This ensures privacy and security in the deployment process.
  • Integrated Game: We created a game that integrates seamlessly with our generated collections and uses the existing infrastructure. This demonstrates that our system is generic and flexible enough to allow for future growth and expansion.

These accomplishments highlight our ability to build a robust and scalable system that meets our goals and paves the way for future development.

What we learned

Development Environment

  • Solidity Development: Our first step was to learn how to use a development environment for Solidity smart contracts. We chose Hardhat for its robust features and ease of use.

Team Growth

  • Conceptual Understanding: Our team started with a basic understanding of NFTs and blockchain technology. Some team members had never even purchased an NFT before. Through this project, they transformed from beginners to knowledgeable practitioners.

Technical Skills

  • Smart Contract Development: We learned how to create multiple contracts in Solidity, gaining hands-on experience and understanding advanced concepts as we progressed.
  • Contract Interaction: We mastered how to interact with our contracts within the product. This included making calls to the contracts from both JavaScript and C#.

Chainlink Integration

  • Utilizing Chainlink Products: We explored and effectively used four Chainlink products in our project. This integration was crucial for implementing key functionalities and achieving our project goals.

Overall, the project was a significant learning experience, enhancing our technical skills and deepening our understanding of blockchain technology and smart contracts.

What's next for Frankie

OutSystems Integration

Having used OutSystems as the bridge to communicate with the blockchain, we created basic components for the first version of the product. Our goal is to develop more generic OutSystems components to promote the use of this low-code technology with smart contracts, potentially opening the door for a new wave of adopters.

Product Improvements

To turn this into a fully-fledged product, we have several improvements in mind:

  • Wallet Management: Our current system uses a single wallet for blockchain operations. We need to enhance this feature to allow seamless and flawless execution of new collection deployments, preventing nonce conflicts when multiple requests are processed simultaneously.
  • MVP Definition for Go Live: We need to define the Minimum Viable Product (MVP) for a public launch, which includes limiting collection sizes and improving the overall product quality through increased testing and validation.
  • Self-Sustaining Application: We aim to make the app self-sufficient by automatically funding the main wallet and Chainlink products when any user deploys a new collection, or through the commissions we earn from each mint. Additionally, we need to balance the pricing structure.

Surf Game Enhancements

For the Surf Game, we have several features we want to add:

  • Multiple Locations: Introduce multiple surfing locations for more variety and strategy.
  • Enhanced Surfer Traits: Allow the surfer’s level and other traits to affect the tricks they can perform.
  • Strategic Surfing: Balance the wave count and the number of times a surfer can surf per day, making the choice of the wave based on the forecast a strategic decision.

Future Plans

This project was just the beginning for us, and Frankie has been our gateway into the world of blockchain and smart contracts. We plan to continue creating and contributing to this space, driven by our ongoing flow of ideas and enthusiasm.

Built With

Share this project:

Updates

Submission history