As the early Amberians surely noticed, after the first couple of weeks of very active gameplay (with people reaping rewards from both long-term dividends and quick flips) and frequent transactions that took Amber to the top of some DApp listing sites, the Amber Game volume dropped.
Cause – High gas fees
How gas fees are calculated in general
Each calculation within an Ethereum smart contract costs a specific amount of gas as an incentive for miners to validate transactions. Depending on the type, the gas limit can be up to 20000 gas for updating a storage variable. In MetaMask, the user is able to set the price for gas used for each transaction, shown in GWEI (0.000000001 ETH == 1 GWEI == 1000000000 WEI).
Example: Sending ETH to another account has a gas limit of 21000. At a chosen price of 5 GWEI, the total gas fees would be: 21000 * 5 * 0.000000001 ETH = 0.000105 ETH.
Gas fees in Amber Game Legacy contract
The way the legacy smart contract was developed, each gem buy resulted in dividends for any gem owner below it. Therefore, the dividend storage variable had to be updated frequently.
Example: Someone buying gem number 300 would have resulted in dividends being split between 300 other players. This would have meant an approximate gas limit of about 6000000 since 300 * 20000. At a chosen price of 5 GWEI, the total gas fees would have been: 6000000 * 5 * 0.000000001 ETH = 0.03 ETH. This would mean that more ETH would be spent on gas fees than the cheapest gem itself cost.
Implications of the high gas fees
Naturally players were not willing to spend a higher amount of Ethereum on gas fees than the value of the actual asset (gem). Therefore, high gas fees prevented new players from entering the game since they usually prefer to buy the cheapest gem as a trial in the beginning.
Fixing the high gas fee issue
- An alternative to implement a new algorithm which keeps changes of storage variables to a minimum, therefore saving gas and lowering the fees was tested but also ran into a maximum block gas limit problem.
- Consequently, Amber algorithm 2.0 includes novel game mechanics where the dividends are not split between all gem owners but instead awarded to 5 randomly chosen players with gems lower in the chain (lower gem number). This means that players with some luck on their side may gain very high dividends despite originally making a minimal investment.
- All gem buys in the new contract result in a constant amount of gas limit (read: cost the same), regardless of the position of the gem in the chain.
- Since an Ethereum smart contract is immutable by design, all data needed to be migrated into a new smart contract. For this purpose, the Amber Game 2.0 contract was created.
- The initial state of the new contract (including cost and ownership of all gems) was taken from a snapshot of the original Amber Game Legacy contract at Oct 22nd 5PM UTC.
Improve spreading the word
In addition to the team, the community itself is making greater efforts to spread the word and advertise the game. A beneficial way to do this is to use the waypoint system – read more about it in How does the Waypoint System work?. To make the referral-bonuses clearer, the new UI now supports checking how much of a player’s profits actually came from the waypoint system - just hover over your profits in the top game bar.
- The new contract is, once-again, thoroughly tested.
- All players retain their assets – gems, prices, total dividends and the waypoint information are exactly as they were recorded from the legacy contract at the time the snapshot was taken.
- Check the source code of the new Amber Game 2.0 smart contract here.
As a smart contract, the original contract in its unchangeable form is and will ever be accessible.
To withdraw dividends from the old contract without using the UI:
Send a 0 ETH transaction with MetaMask (MM) to the contract Address 0xB66041c5AcCC99fCcCe8e4f06074ac52C9C556DD and type in 0x0ed86f04 as the Hex Data. The amount is 0 ETH because you don’t need to spend your ETH to get your ETH ;). This will withdraw all the Ethereum profits you had gained from gem flips, dividends and the waypoint system while Amber 1.0 was online.