Cryptocurrency

Data Types 📊💻 – How To Create Your Own ERC20 Cryptocurrency Token in 2020

*** FULL COURSE PLAYLIST ***

*Contact Us*
🚀🚀🚀 To get in touch with us about collaborating with us, please fill out the following contact form 🚀🚀🚀

[Free ERC20 Token Example]
Free examples of:
– ERC20 token contract
– Crowd sale contract
– Token burn event contract (inspired by Binanace.com)
Can be found at

[Creators]
This is free educational content brought to you by – Planet’s fastest and easiest cryptocurrency conversion platform, for individuals as well as for companies.

How to create your own cryptocurrency token? -Smart contract development with Ethereum & Solidity

This crash course will teach you how to create and deploy your own smart contract in only 13 short lessons.

We will cover:
1. Intro
2. Required packages
3. Setup
4. Data types
5. Operators
6. Functions
7. Visibility
8. ERC20 Token Standard Interface (Yay!)
9.1. Implementing Your Own ERC20 Token (Hurray!)
9.2. Compiling & Deploying Your Own ERC20 Token (testnet) 🚀
10. ERC20 Token – Logging and Events
11. Inheritance and Polymorphism
12. Exceptions
13. Security Concerns
14.Deploying Your Own Token on The Ethereum Mainnet Network

[Lesson 1 – Intro]

[Solidity]
Solidity is a programming language for writing smart contracts that run on Ethereum Virtual Machine on Blockchain. It is a contract-oriented, high-level language.

[Before learning Solidity]
Prerequisites:
– JavaScript (variable assignments, loops, arrays, functions)
– Object-oriented programming concepts (classes, methods, static and instance variables)
– Command-line usage

[In this lesson]
Lesson 4 – Data Types

In this lesson, we will discuss the various data types available in Solidity.
There are 2 main distinctions between types, the ones passed by ‘value’ or the ones passed by ‘reference’.

[Value types]
The following types are also called value types because variables of these types will always be passed by value, i.e. they are always copied when they are used as function arguments or in assignments.

Booleans
The possible values are constants true and false.

Integers
int – signed integer – 255 bits are used to represent the value and 1 bit to denote the sign;

uint – unsigned integers – all 256 bits are used to represent the value.

Keywords uint and int go up in increments of 8 from the lowest value of 8 to the maximum value of 256 e.g. int8, int16, uint16, etc. uint and int by default are aliases for uint256 and int256, respectively.

Fixed Point Numbers
fixed – signed fixed-point number;

ufixed – unsigned fixed point number.

However, fixed point numbers are not fully supported by Solidity yet. They can be declared, but cannot be assigned to or from.

So if you want to use float type division in Solidity, different size units have to be used.

Bytes
Another familiar data type which can be used to store raw byte data. Bytes is essentially a dynamic array of bytes. byte is an alias for bytes1 which is an array of 1 byte. The maximum bytes array is bytes32.

Strings
String literals are written with either double or single-quotes (“foo” or ‘bar’). As with integer literals, their type can vary, but they are implicitly convertible to bytes type. Under the hood, strings are basically an arbitrary-length byte array.

Address
Special data type that holds a 20-byte value (size of an Ethereum address). Address types also have members and serve as a base for all contracts.

Address also comes with data types members which are balance and transfer. It is possible to query the balance of an address using the property balance and to send Ether (in units of wei) to an address using the transfer function.

Enums
Enums are one way to create a user-defined type in Solidity where a keyword can be mapped to an integer value.

[Reference types]
Complex types, i.e. types which do not always fit into 256 bits have to be handled more carefully than the value-types we have already seen. Since copying them can be quite expensive, we have to think about whether we want them to be stored in memory (which is not persisting) or storage (where the state variables are held).
For the full lesson text-book

Data locations
There are fixed and dynamically sized arrays in Solidity but before we have a look at them, we need to have at data locations, what they are and how they affect our code.

Arrays
Creating arrays with variable length in memory can be done using the new keyword.

Structs
Structs is a way to define new data types.

Mappings
Mappings can be seen as hashtables which are virtually initialized such that every possible key exists and is mapped to a value whose byte-representation is all zeros by default.

Full course textbook and code examples:

Share via