Inspiration

As gamers, we often play MMORPGs where we upgrade our weapons. We burn semi-good items in the hope to mint a great new item. But it's always a russian roulette, by design. However, we never feel 100% certain that the game server is treating our upgrades fairly. Maybe premium members have better upgrade chances? Or developers have a backdoor to upgrade their items with 100% certainty? This limits the joy in playing such MMORPGs.

What it does

Anvil is a framework for developers that game developers can use as an accelerator for their on-chain game deployments. It allows developers to register NFTs, the upgrade cycle between NFTS (e.g. upgrade 10 UNCOMMON swords to 1 RARE sword), as well as set the upgrade succeeding percentage. For example, in 50% of cases, 10 UNCOMMONS get burnt and 1 RARE is minted, in the other 50% of the cases, the 10 UNCOMMONS are just burnt without a new RARE item being minted.

How we built it

A quickstart was made using Remix to get a basic smart contract deployed and test the basic flow of the application. Then, we industrialised it using Brownie and GitHub Actions for full automation. For the frontend, Ethers.js was used as web3 library and the interface was made in React using typescript.

Challenges we ran into

As coding Smart Contracts and using Brownie was new to the team, a lot of time went into understanding how blockchain technology works under the hood, and understand how to transact and interact with it. Furthermore, since none of us are front-end developers, it took quite some time to get a user-friendly deployment up and running, that interacts with the contract, using Metamask. We were also new to the ERC1155 standard, so this was an interesting journey to understand the inner workings.

Accomplishments that we're proud of

We successfully managed to deploy a Smart Contract on Rinkeby with a fully automated CICD pipeline using GitHub Actions. Also the Chainlink subscription funding is automated for a fully streamlined deployment process. Also the fact that the we were able to deploy the actual images of the NFTs on IPFS, rather than on an AWS bucket, like many tutotials do, combined with the JSON having ERC1155 metadata standard deployed on IPFS, makes this a fully trustless and decentralised application, which we're very proud of.

What we learned

We learned the ERC1155 standard, we learned how Chainlink VRF works using the subscriptions, we learned how to automate a Smart Contract deployment using GitHub Actions and we took our first steps into IPFS deployments for both the NFT images and the NFT metadata.

What's next for Anvil

We are enthousiastic about these newly discovered technologies and will continue on improving it with our own use case in mind, make it more flexible for all developers. Things we are thinking about is allowing game creators to add extra upgrade layers after the contract has been deployed, similar to an "extension pack" on other games, where currently the LEGENDARY item is the strongest, making the contract dynamic so the game creators can keep extending the upgrade levels, as well as dynamically ad more weapons, seems like a great next step.

Built With

Share this project:

Updates