

Gold Fever: innovative
contract mapping on
Ethereum & Polygon

Gold Fever: innovative contract mapping on Ethereum & Polygon
PROJECT OVERVIEW
PROJECT OVERVIEW
Streamlined smart contract mapping is the most important part of an NFT bridging operation. While preparing to bridge thousands of NFTs for the mining/survival MMO Gold Fever, XP.NETWORK came up with an innovative mapping architecture that allowed us to accommodate complex NFT structures and ranges while saving gas.
goldfever.io

What is Gold Fever?
Gold Fever is a thrilling survival multiplayer, with a sophisticated economy and extremely realistic graphics, fully owned by players, where they can mine and fight for $NGL in a blockchain economy driven by #CommercialNFTs owners.
Set almost one hundred years ago, between the Two Great World Wars, the action takes place far across the oceans, on an island that hides a dangerous secret. It is a rich and diverse world, featuring densely populated forests of relative safety, inhabited by Tribals. Gold Fever is, however, a hostile PVP metaverse where only skill, social abilities can help you survive.
Rumors speak of an untapped source of gold and precious minerals. This has lured various brave Adventurers to the Island to try their luck at seizing fame and fortune. As if watching your back against your own faction and battling hunger, fatigue, the elements wasn't enough, the Tribal natives viciously hunt you in their mission to protect their homes and their gold.


The primary source of revenue is in-game gold - you can mine using special equipment, but you can also take it away from other players with force using weapons. Players can form factions to face each other in the Arena. Battles in Gold Fever require a good strategy, as every character has their own strengths and weaknesses.
However, a unique in-game market and economy, with a higher degree of player control is the beating heart of Gold Fever. This was possible thanks to a new use case for the NFT technology Gold Fever team was able to pin down into the commercial NFT concept: in-game businesses. They generate default items and services vital for players. The revenue from these transactions belong to the revenue owner. So trading in game items is a revenue option in Gold Fever, as it enables players to set up shop within the game and become a core part of the blockchain economy.
Gold (the NGL token) is the key resource in the game, and users can either sell it or exchange it for other types of resources (NFTs). These include the commercial NFTs such as mining claims, butcher shops, airfield, guns and even companions that will improve your chances in battle. All these NFTs can be traded – or even rented and borrowed – on the in-game marketplace.
Users can buy high-utility items like boats and planes (needed to shuttle players quickly from one part of the jungle to another) and mining tools and rent them to others. Users will also be able to buy NFT Lands and construct buildings on them. This way, you can earn a passive income even if you don’t play the game. Playing Gold Fever will be more than worth it, however. The project is highly utility and very commercially driven, with the NFTs and the tokens embedded in the game world.
The team of Gold Fever consciously moved away from pixelated design that is so common in P2E – in the belief that blockchain games have to look and feel like mainstream games to appeal to Web2 gamers. As CEO Emilian Ciocanea said in a recent AMA with XP.NETWORK, user experience has to come before crypto rewards – even though Gold Fever gives users plenty of ways to earn tokens.
Mapping complex NFT contracts for Gold Fever
Gold Fever runs on Polygon for reasons of cost-efficiency. The project will actually subsidize the in-game transaction fees to make the product more attractive to mainstream gamers. However, while Polygon is perfect for large games, there’s a huge gap in OpenSea trading volume numbers between Polygon and Ethereum.
Therefore in order to build up an audience faster, the team decided that the Genesis NFT collections should be minted on Ethereum, with the buyers being able to bridge those NFTs to Polygon once the game launches. And for that, they needed a secure and powerful multichain NFT bridge.
In fact, it was Polygon Studios that recommended XP.NETWORK as a trusted partner for the task. Thanks to bridging, Gold Fever will be able to increase and distribute the utility and liquidity without having to spend money on development on alternative chains.
The whole Gold Fever economy is underpinned by commercial NFTs – all those buildings, boats, planes, and tools that help users earn an income in the game. They are different from artwork NFTs and collectible NFTs in that they are strictly practical. You also need a lot of them – enough to accommodate the needs of thousands of players.
Apart from their huge numbers, Gold Fever’s commercial NFTs are also very complex. The first collection will consist of Mystery Boxes that can contain up to six other NFTs within them, which, when combined, produce a mask.
Mystery Boxes will be sold on Ethereum. Buyers will then need to bridge them to Polygon and break them open to reveal the parts and forge a mask out of them. The alternative is to bridge the parts back to Ethereum and sell them separately on OpenSea.
On top of all this, other types of NFTs in Gold Fever will be very different from Masks. For example, a mining claim NFT can contain a certain amount of NGL gold and can be attached to a land parcel. Such commercial NFTs will be minted on Polygon and then bridged to Ethereum by users if they want to re-sell them. You can learn more from our recent AMA with Gold Fever on YouTube.


All this made our task rather challenging. It’s all well and good that Ethereum and Polygon are both EVM chains, but mapping the smart contracts for bridging something like parts of a Mask in a Mystery Box is still very complicated, especially in terms of minimizing gas costs.
Initially we had 4MB files of tokenIDs for mapping, which was way too heavy. One of the key principles of blockchain is that storage costs more than computation. You want to avoid excessive storage of megabytes of useless data if there’s a way to calculate it on the fly instead.
Another problem is human error. When you map contracts using thousands of hard-coded token IDs, there’s a risk that some of them will be lost, forgotten, misprinted etc. An NFT can then get stuck while bridging.
Luckily, when it comes to NFT contract mapping, XP.NETWORK has the most experienced team around, led by our tireless CTO Dima Brook.
After a lot of experimenting, we re-engineered the whole mapping architecture to allow it to support ranges. We don’t need to hard-code any NFT token IDs, and there is no risk of NFTs getting stuck, either.
We are currently working on mapping two smart contracts: one Ethereum and one on Polygon. The NFTs from 0 to (2^128-1) – which is a very, very large number – will be minted on Ethereum, and those with the order numbers from 2^128 to 2^256 (also a huge number) will be minted on Polygon.
The same two contracts will hold any wrapped NFTs from other chains together with their token IDs. This is the first time we’re using such a mapping structure, but we can already see that it is much better adapted to the needs of a large and scalable game with many thousands of commercial NFTs than the regular mapping structure that we’d normally use for a simple collection.
For now, we’ve tried the new mapping solution on testnet, and it worked very well. The next step would be bridging on mainnet – but for that, we will need to wait for the Genesis Mask drop and the Game of Diggers 2.0 – the next large event on the Gold Fever roadmap.
We are excited about the collaboration with Gold Fever, as it will allow the XP.NETWORK team to flex its muscle and explore ever more complex NFT bridging patterns. We’ll add more details to this case study as new features of the game are released. Follow us on Twitter and in Telegram and don’t miss the next update!