Ready to issue your own tokens? Here is how you can do it within 1 minute.

Daniel Wang
Loopring Protocol
Published in
3 min readApr 10, 2018

Rewriting code that already exists is a waste of your time. In this post, we introduce TokenFactory, a smart contract that helps you quickly create new ERC20 tokens and make them inherently tradable using Loopring Protocol.

How

To create your own ERC20 tokens using TokenFactory, follow these 4 easy steps:

  1. visit https://www.myetherwallet.com/#contracts
  2. Put 0xbF209Cd9F641363931F65C0E8EF44c79cA379301 inside the “Contract Address” input-box, copy & paste the entire content of this page into the “ABI / JSON Interface” text-box, click the “Access” button, then select the “createToken” function from the dropbox.
  3. In the “Read / Write Contract” form, provide the name, symbol, decimals, and totalSupply of your new token. In this example, I used Testing TOKEN FOO Token, L.FOO, 5, and 100000000000000000 respectively. Note that you need to come up with a unique symbol otherwise your transaction will fail (To find out whether a symbol is already in use, use the getAddressBySymbol function on this page).
Access TokenFactory’s createToken Function

4. Unlock your wallet, click on the “WRITE” button, then follow the instructions to send the transaction.

Boom! You should have your own ERC20 contract created in seconds, plus your new tokens should be tradable with Loopring Protocol by default. All the new tokens will be initially owned by the address you just unlocked.

In my case, the above txid is 0xbF209Cd9F641363931F65C0E8EF44c79cA379301. If you follow this link and click on the “Internal Transactions” tab, you will see a token creation tx.

Token Creation Tx

Clicking on the link in the 3rd (“To”) column will lead you to the token smart contract I just created — 0x74efa76922fc139f35a0f08a8d98293d0c8602d1

The Token’s Smart Contract

Contract Verification

Currently, etherscan.io doesn’t automatically verify the new ERC20 token smart contract although its parent contract has been verified. We’ve emailed etherscan.io to ask whether it is possible.

Tradable with Loopring

The new tokens created this way should have been automatically registered to Loopring Protocol’s TokenRegitry smart contract, therefore, you no longer need to contact us to register it manually. To verify this, visit this link, put L.FOO inside getAddressBySymbol’s input-box, then click on the “Query” button. You will see 0x74efa76922fc139f35a0f08a8d98293d0c8602d1 as the returned value — returning 0x0000000000000000000000000000000000000000 indicates the token with the given symbol has not been registered and is not supported by Loopring.

It is worth noticing that being tradable with Loopring Protocol doesn’t mean a token is going to be listed by our official wallets or any other wallets— the protocol will enable as many ERC20 tokens as possible but wallets decides which ones to list and relays decides what ones to ring-match.

Why It Matters?

We believe there will be even more tokens in the near future. Some of them will be utility tokens that will be honored by layer two protocols and dApps, and more of them will be tokens representing off-chain assets. In most cases, tokens are very similar in terms of codebase and deployment process, so why bother writing the same solidity code for each token and go through the same deployment process? TokenFactory is here to make your day.

Future Work

In the future, we’ll probably integrate TokenFactory into our web-based Loopr wallet to make it even easier for you to issue your own ERC20 tokens.

For more up-to-date information, join us on social media:
⭑ Twitter: twitter.com/loopringorg
⭑ Reddit: reddit.com/r/loopringorg
⭑ Telegram: t.me/loopring_en
⭑ Telegram: t.me/loopringfans (Chinese)

--

--