Photo by Mathieu Stern on Unsplash

Unlock the Potential of Virtual Mining with PolygonMiner: A Revolutionary Decentralized Egg Trading Platform

SC Hughes
2 min readJan 12, 2023

--

The contract "PolygonMiner" appears to be a decentralized application (dApp) built on the polygon blockchain that allows users to "mine" and trade virtual eggs. The contract includes several variables and mappings to track the total number of eggs mined by each user, as well as their last hatch date and any eggs that have been claimed but not yet hatched. The contract also includes a "marketEggs" variable to track the total number of eggs available for purchase on the market.

Users can hatch their eggs by calling the "hatchEggs" function, which converts the user's claimed eggs into virtual miners. The number of miners hatched is based on the "EGGS_TO_HATCH_1MINERS" variable, which is currently set to 2592000, or the number of seconds in a day. The function also sends a portion of the eggs used to the user's referral, if they have one.

Users can also sell their eggs on the market by calling the "sellEggs" function, which calculates the value of the eggs being sold and subtracts a developer fee. The eggs are then added to the "marketEggs" variable and the user is paid for their eggs in matic .

Users can also purchase eggs on the market by calling the "buyEggs" function and sending matic to the contract. The function calculates the number of eggs that can be purchased with the Ether sent and subtracts a developer fee. The eggs are then added to the user’s "claimedEggs" mapping.

The contract also includes a "calculateTrade" function, which appears to be a balancing algorithm for determining the value of eggs being bought or sold. This function takes in three variables, "rt" "rs" and "bs", and uses them along with the "PSN" and "PSNH" variables to calculate the value of the trade.

It’s important to note that this is not financial advice .

Sc Hughes

--

--

SC Hughes
SC Hughes

Written by SC Hughes

After 35+ years as a hairdresser I had an unexpected fall. After several spinal surgeries finding something to do that doesn't hurt is my goal . Wish me luck!

No responses yet