What is Chi Gastoken (CHI) | What is CHI token

What is Chi Gastoken (CHI) | What is CHI token

Chi Gastoken facilitates transactions on Ethereum blockchain with the same amount of work but less gas by taking advantage of the Ethereum storage refund. What is Chi Gastoken (CHI) | What is CHI token

To execute a 1inch punch, you need power, in Asian Martial Arts it is called as  Chi / Qi, whose equivalent in the crypto space is our new Chi Gastoken. Now, any user can burn their Chi tokens and thereby save on gas.

What is a Gastoken?

Every transaction on the Ethereum network requires some gas. A Gastoken facilitates transactions with the same amount of work but less gas. A Gastoken takes advantage of the Ethereum storage refund, see  Ethereum Yellow Paper. To encourage smart contracts to erase unnecessary storage, Ethereum provides a refund for each zeroed element. So, in the process of burning, a Gastoken’s smart contract erases storage that were filled during minting. The most efficient storage gas refunds are achieved by creating and destroying sub smart contract, not by direct writes and erases of the storage.

The idea for the Chi token is based on the original Gastoken GST2 implementation. We saw that there were ways to improve the efficiency with:

  • Reducing the smart contract address size by mining a private key with  Profanity address generator, which allowed us to decrease size of the sub smart contracts by 1 byte.
  • Using CREATE2 instruction to deploy sub smart contracts for their efficient address discovery during burning process.
  • Fixing ERC20 incompatibilities of GST2

How much is Chi better than GST2?

The Chi token is 1% more optimized for minting, and 10% more efficient for burning.

Image for post

Gastokens efficiency comparison. See  https://www.desmos.com/calculator/9z3hnwzbbl

y = 15000 * x / (20065 + 5065 * x) // GST1
y = 24000 * x / (35974 + 6689 * x) // GST2
y = 24000 * x / (35678 + 6053 * x) // CHI

How Chi can be used?

The deployment of a Ethereum smart contract requires substantial gas, and it could cost you for example between $5 and $10 per million of gas, while regular smart contract could have size of several millions of gas. But burning Chi tokens in the same transaction would reduce these costs by almost the half.

We have built on  ETHGlobal HackMoney Online Hackathon such a tool called  Deployer.eth.

The support of Chi token can be integrated in any smart contract with just a few lines of code by using following modifier:

modifier discountCHI {
    uint256 gasStart = gasleft();
    _;
    uint256 gasSpent = 21000 + gasStart — gasleft() + 16 *
                       msg.data.length;
    chi.freeFromUpTo(msg.sender, (gasSpent + 14154) / 41947);
}

In this case, Chi tokens will be burned from the caller’s wallet (Chi tokens should be approved to the contract by the user).

In case of burning Chi tokens from the contract itself (rather than from a user’s wallet), you need to change msg.sender in the chi.freeFromUpTo function to address(this). And don’t forget to top up your contract with Chi tokens.

How can you mint Chi tokens?

You can mint Chi tokens directly on Etherscan. Another option is  the Chi Minter on 1inch. To use it, you need to deactivate all exchanges, except for the Chi minter.

Image for post

Chi Minter on 1inch

The maximum minting limit is 140 Chi tokens, which, in turn, is explained by the block limit. We deliberately use about one half of the block, so that miners won’t reject this type of transaction, which is less profitable for them.

If, for instance, you swap 1 ETH using Chi Minter, you get 140 Chi tokens and pay 20 GWEI for gas. But we won’t spend the entire 1 ETH as the minting of 140 Chi tokens doesn’t cost that much. Only what is actually spent will be spent:

5,125,271 gas x 20 GWEI = 5125271*20*1e9/1e18 = 0.10250542 ETH 

So, only about 0.1 ETH will be spent, rather than 1 ETH.

One other thing. When you mint Chi tokens and indicate a low gas price, your wallet will be blocked. Therefore, we advise that you use a separate wallet specifically for minting Chi tokens.

How can you trade Chi Gastoken

It is also possible to trade Chi token on 1inch. For that you need to select Chi in the from token drop down and a token you wish to get in the to token dropdown. 1inch find the best place where to sell your Chi token.

Very important to understand for everyone:

Imagine Chi token as tokenized version of actual gas price on Ethereum. Means if the gas price grow. Chi token price also grow. If gas price in Ethereum drops, the same would also happen with Chi.

Image for post

Selling Chi token on 1inch for the best market price

Of course you can set a limit order on 1inch with the rate you wish.

Image for post

Limit order on 1inch

How to deploy a smart contract with less gas costs?

You need to approve the  Chi token to deployer.eth. To do that, go to the Write Contract _section on Chi. Find the _approve function and trigger it with the deployer.eth address and approval amount.

Image for post

Click on the Deploy _button on  remix.ide and copy data to deploy (0x6080604…). Don’t click on _confirm.

Image for post

Image for post

Go to the Write Contract _section on the  deployer.eth contract and paste the deploy data to _chiDeploy for Chi burning. Click Write and confirm the transaction in the popup MetaMask window.

Image for post

Here we are! Only 51.18% of gas was used and 6 Chi tokens were burned.

Image for post

Finally, go to the _Internal Transactions _section. There, you can find the deployed contract address. Just find _create_0 _below the Type Trace Address. In this line, below the _To _column you can see the deployed contract address.

Image for post

Now go ahead and check out Chi for yourself!

Read more ☞ What is 1inch (1INCH) | What is 1inch Exchange | What is 1INCH token

Would you like to earn CHI token right now! ☞ CLICK HERE

Looking for more information... 

☞ Website ☞ Explorer ☞ Source Code ☞ Coinmarketcap

Thank for visiting and reading this article! I'm highly appreciate your actions! Please share if you liked it!

blockchain bitcoin crypto chi gastoken chi

What is Geek Coin

What is GeekCash, Geek Token

Best Visual Studio Code Themes of 2021

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Adding Messages On The Bitcoin Blockchain - A How-To Guide

Can I write on a Bitcoin Blockchain? Can I drop down a message? Yes, Luca of course you can! You can leave a message on a Bitcoin blockchain using a particular op code, called OP_RETURN.

The Blockchain and US | Documentary | Bitcoin | Crypto News | Cryptocurrency | Blockchain Explained

Award-winning documentary about blockchain technology. Bitcoin, Crypto, Satoshi Nakamoto, etc. What is the Blockchain?

Bitcoin: Beyond The Bubble | Bitcoin Documentary | Cryptocurrencies | Crypto News | Blockchain

Documentary about the cryptocurrency Bitcoin: Bitcoin: Beyond The Bubble - What is Bitcoin? With the advent of Bitcoin, the world's premier digital currency, for the first time in history money is no longer controlled by banks or governments, but by the people who use it.

Banking on Bitcoin | BITCOIN DOCUMENTARY | Crypto News | Blockchain | Digital Money | Capitalism

Crypto Documentary: Banking on Bitcoin - Bitcoin is the most disruptive invention since the Internet, and now an ideological battle is underway between fringe utopists and mainstream capitalism. The film shows the players who are defining how this technology will shape our lives.

Blockchain Certification | Blockchain Training Course | Blockchain Council

In all the market sectors, Blockchain technology has contributed to the redesign. The improvements that were once impossible have been pushed forward. Blockchain is one of the leading innovations with the ability to influence the various sectors...