A look into the $WXM smart contract (2024)

While the code of the $WXM token smart contract is not publicly available yet, it’s very close to being finalized. Here are some insights on its design and the decisions we’ve made.

A look into the $WXM smart contract (1)

Published in

WeatherXM

·

5 min read

·

Feb 28, 2023

--

WeatherXM stands at the intersection of Meteorology, Internet of Things (IoT) and Web3. This is the first article in a series that will present various Web3 aspects of the project, while explaining the fundamentals of Web3 to members of our community that don’t have a Web3 background.

For the purposes of this article, you can think of an ERC20 token as a two-column table together with some code that lives on the Ethereum blockchain: one column holds wallet addresses and the other one their token balances.

A look into the $WXM smart contract (3)

Each token implements its own table and functions, so there’s one for $UNI, one for $DAI, one for $AAVE and so on.

The contents of this table can usually be changed using the transferFrom function which is implemented by the code of the token smart contract:

transferFrom(from, to, amount) deducts an amount from one wallet and adds the amount to an other. It can only be called by the wallet that holds the amount (the “from” address).

According to the standard, an ERC20 smart contract has to implement some more functions such as balanceOf(), approve() and allowance() that are not important for the scope of this article.

Also, a token contract may have more functions to support functionality like minting new tokens, burning tokens, pausing/unpausing the contract, staking or do other exotic stuff. For example, some ERC20 tokens have an blacklist that blocks transfers to or from blacklisted addresses.

Most users do not check the source code of a token’s smart contract. They trust that auditors, the developer community and that other users with higher stakes than them have done a good job checking it. This is why most smart contracts make their source code available to the public.

However, it’s good to have in mind that:

  1. ERC20 tokens are not “in your wallet”. Your balance is kept in a smart contract that the creator of the token wrote and it’s governed by the rules implemented by the smart contract code. (This is why we call it a “contract”.)
  2. When you transfer ERC20 tokens, you (usually your wallet) just tell the token’s smart contract to reduce your balance and increase someone else’s balance.
  3. The reason why such a system can be trusted is that the smart contract “lives” on the blockchain which means that its rules will be followed to the letter and that they can not change (unless the smart contract has said so in advance, something known as upgradable contracts).

Now that we have an understanding of how ERC20 tokens work, let’s see how $WXM, the token of the WeatherXM Network was designed.

$WXM is programmed to have a maximum supply of 100,000,000 tokens. But it does not have a fixed supply: After reaching the 100,000,000 limit, if tokens are burned and the total supply drops, then new tokens can be minted again as long as the total supply does not exceed 100,000,000.

In addition to the standard ERC20 functions, like transferFrom() described above, there is a mint() function that creates new tokens, and a burn() function that burns tokens.

The mint() function was implemented with the following in mind:

  • Anyone can call the mint() function at any time, but if it’s called more than once in a day, it will revert with an error. This means that while the WeatherXM company will make sure it’s called once daily, according to the schedule laid out in the Whitepaper, minting does not depend on the company.
  • If mint() is not called for more than a day, then it can be called consecutive times. For example, if mint() has not been called for two days, mint() can be called three times and it will generate the tokens that corresponded to the “missed” days.
  • As expected, mint() can not generate new tokens if the total supply of $WXM exceeds 100,000,000, in which case it will revert with an error.
  • The $WXM contract is Ownable. There is an “owner” address that can pause/unpause the contract and also update the destination address where newly minted tokens are sent.

The destination of newly minted tokens will be an other smart contract that distributes them to station owners (rewards), the company, its investors, and the pools described in the Whitepaper.

No other special permissions are granted to the owner of the contract. Once the infrastructure has been tested and the WeatherXM ecosystem has matured, ownership of the contract can be transferred to the DAO or it can be renounced (after which point no one can use the “admin” functions).

The burn(amount) function can also be called by anyone. It will destroy the amount of tokens, provided that the caller has enough balance to do so. This is a very simple and “dumb” function and it will rarely be used on its own. It is intended to be used by the BurnPool contract that implements the burn mechanism as described in the Whitepaper (expect a separate article on this).

Finally, the $WXM smart contract is not upgradable, which means that the way it works cannot be changed by anyone.

The $WXM ERC20 contract is an ERC20 contract that has been kept simple on purpose because it is the foundation of the WeatherXM ecosystem and it will not be upgradable.

It ensures that new tokens are minted according to the schedule described in the Whitepaper and that the total supply does not exceed 100,000,000. It also allows minting of new tokens when the supply drops bellow 100,000,000 due to token burns.

The only special permissions granted to the contract owner are the ability to pause/unpause the contract and to change the destination address of the newly minted tokens. Ownership will eventually be renounced or transferred to a DAO.

WeatherXM is building the fastest growing global weather network in the world. You can learn more about the project at weatherxm.com.

A look into the $WXM smart contract (2024)
Top Articles
Pay Plan Descriptions | TTU Pay Plan | Human Resources Home
OP 70.14: Compensation Policy | Operating Policies & Procedures
Ups Customer Center Locations
Dunhams Treestands
Global Foods Trading GmbH, Biebesheim a. Rhein
Missed Connections Inland Empire
La connexion à Mon Compte
Bucks County Job Requisitions
Poe Pohx Profile
Arrests reported by Yuba County Sheriff
Naturalization Ceremonies Can I Pick Up Citizenship Certificate Before Ceremony
Apnetv.con
Doby's Funeral Home Obituaries
Fallout 4 Pipboy Upgrades
Maxpreps Field Hockey
Palace Pizza Joplin
4156303136
Dallas Cowboys On Sirius Xm Radio
Puretalkusa.com/Amac
Find Such That The Following Matrix Is Singular.
Itziar Atienza Bikini
Where to Find Scavs in Customs in Escape from Tarkov
12 Top-Rated Things to Do in Muskegon, MI
Rs3 Eldritch Crossbow
At&T Outage Today 2022 Map
Bennington County Criminal Court Calendar
Toothio Login
How to Watch Every NFL Football Game on a Streaming Service
Utexas Iot Wifi
Foodsmart Jonesboro Ar Weekly Ad
January 8 Jesus Calling
Table To Formula Calculator
Stubhub Elton John Dodger Stadium
Fairwinds Shred Fest 2023
Ripsi Terzian Instagram
Makemkv Key April 2023
Bimar Produkte Test & Vergleich 09/2024 » GUT bis SEHR GUT
The Bold And The Beautiful Recaps Soap Central
Pokemon Reborn Locations
FREE - Divitarot.com - Tarot Denis Lapierre - Free divinatory tarot - Your divinatory tarot - Your future according to the cards! - Official website of Denis Lapierre - LIVE TAROT - Online Free Tarot cards reading - TAROT - Your free online latin tarot re
Differential Diagnosis
Walmart 24 Hrs Pharmacy
22 Golden Rules for Fitness Beginners – Barnes Corner Fitness
Wpne Tv Schedule
Wisconsin Volleyball titt*es
Minecraft: Piglin Trade List (What Can You Get & How)
The 13 best home gym equipment and machines of 2023
Steam Input Per Game Setting
303-615-0055
Coldestuknow
Ff14 Palebloom Kudzu Cloth
Intuitive Astrology with Molly McCord
Latest Posts
Article information

Author: Rubie Ullrich

Last Updated:

Views: 6366

Rating: 4.1 / 5 (72 voted)

Reviews: 95% of readers found this page helpful

Author information

Name: Rubie Ullrich

Birthday: 1998-02-02

Address: 743 Stoltenberg Center, Genovevaville, NJ 59925-3119

Phone: +2202978377583

Job: Administration Engineer

Hobby: Surfing, Sailing, Listening to music, Web surfing, Kitesurfing, Geocaching, Backpacking

Introduction: My name is Rubie Ullrich, I am a enthusiastic, perfect, tender, vivacious, talented, famous, delightful person who loves writing and wants to share my knowledge and understanding with you.