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:
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!