Inspiration
There are currently four major roles in the blockchain gaming industry: players, guilds, developers, and investors. The players are at the forefront, steering the direction of the industry, with their attention predominantly towards income potential. Guilds are growing in popularity as a method to attract players and reduce financial barriers to entry. Guild members pool funds together, buy assets and then loan those assets to incoming players in exchange for a percentage of the new players' "earnings"'.
The guilds are the enablers of GameFi. They remove barriers, build communities, and connect players with the materials needed to be successful in their chosen games. Guilds give members access to NFTs needed for the "play-to-earn" games as well as knowledge from experts in these games.
What it does
Stacks Guild gives additional functionality to a traditional NFT(SIP-009) to track who is the user, set the user, and validate if the loan already expired. With a marketplace-like, We list, unlist, and loan an NFT for a fixed price per duration.
How we built it
Stacks Guild implements is based on two smart contracts.
An NFT smart contract based on SIP009 to add additional functionalities like a dual profile: owner and user; and three functions: getUser, setUser, getExpires; to set a principal as a user, get the current user and the expiration of the loan.
And a second smart to manage the NFTs loans, it lists NFTs to be available for lending, cancel listings, and fulfill listing. It’s important to note that this is a non-custodial approach. For the lending process there is no NFT transfer, only a setup of the user principal and the loan duration based on the block height. It is the responsibility of the final NFTs utilities implementation to consider the roles and the corresponding rewards.
Challenges we ran into
We create a more complex rule set of validation, so we head with some problems with the return types. In the beginning was hard to understand how to access a tuple element inside a map, mainly when the data can be none. How to call functions from another smart contract. The main challenge was to choose a design for the system, one option was the use of the NFT stacking, and generating a “mirror” NFT to transfer to the lender. But we select a simpler way, to be less invasive, the NFT has a dual role and tracks itself if it is lent. In this way, the owner can trade the NFT without a problem.
Accomplishments that we're proud of
Implement the idea in a simple way. There is a lot of work and improvements, but We accomplish the simple design that we have in mind for this hackathon.
What we learned
A better understanding about three main things: The smart contract flow using asserts!, try!, How we can deal with the conditions validations and respect the response types. Manipulation of complex tuples and maps. Mainly with optional types. The external contract calls inside a function.
What's next for Stacks Guild
Iterate with this design, and use it in some real use cases, to validate its functionality. We want to create a production-ready service. Create an open payment flow, for a continuous income to the owner, when the user triggers some rewards, for example, game tokens, tournaments prize, etc. Propose a SIP to bring an NFT loan standard to de Stacks ecosystem.
Log in or sign up for Devpost to join the conversation.