StandardToken.sol deleted? How to move to OpenZeppelin 2.0 for your ERC-20 token

Today I was playing around with some ERC-20 stuff and, because things are moving really fast in the blockchain, smart contract, and Ethereum space, I hit some serious speed bumps.

Ether as a cryptocurrency and digital asset is one key aspect of the Ethereum world computer, but a lot of the most interesting things are happening through tokens, whether it’s ICOs, STOs, utility tokens, or some of the fascinating economic engineering going on behind them.

Tokens follow the ERC-20 standard, which is pretty simple (if you keep it that way).  And, for the most part, new developers are likely to lean on the OpenZepplin library.  There are many blogs, Medium posts, StackOveflow questions, and more giving you code snippets to use based on early versions of OpenZepplin.

It’s so easy.  You’re probably going to do something like:

npm i openzeppelin-solidity

The problem is you’re going to download the new OpenZepplin library (version 2.0) and basically nothing you read will help you anymore.  Let me try.

Forget about StandardToken.sol or manipulating the tokenSupply or any of that.  Just create a new token with the following:

carbon-3.png

That’s going to start a new token contract with a supply of 100000000000 and transfer all of them, initially, to whoever created the contract.

That should get you going.  Good luck out there legal engineers!

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.