

The ERC20 standard is an interface contract that contains a grand total of six executable functions & two logging events. This means that any token contract that’s an ERC20 instance does not compile without the following in contrast, this means Ethereum developers now know what functions & behaviors they can expect when interacting with any ERC20 token.

These abstract contracts, are also known as interface contracts.
#Erc20 token code
Solidity documentation defines contracts as “a collection of code (its functions ) & data (its state ) that reside at a specific address on the Ethereum blockchain.” Ethereum contracts support inheritance - so a contract can be an instance of another contract.įollowing this logic, an abstract contract, one that’s used strictly for inheritance, can also be used as failsafe by defining what a new contract must contain in order to compile. In Ethereum-land, it all starts & ends with contracts. We’re going to start digging a little deeper into exactly what & how this standard is implemented across the Ethereum network - as previously mentioned, we’ll cover this specifically in Solidity syntax. For further information on Solidity you should head over to the documentation found here: ERC20 Interface Walkthrough

The Solidity syntax, to those familiar with programming, is a mishmash of Javascript, Python, & C concepts it’s statically-typed, supports inheritance & has a host of libraries right from the get-go. Solidity is a high-level contract-oriented programming language used for implementing smart contracts. įor the remainder of this article we’ll highlight & walkthrough Solidity syntax. Developers can choose from languages such as Vyper, Bamboo, Serpent & Solidity.

While the most popular Ethereum client is currently written in Google’s GO, the choices for a developer-friendly smart contract language are plentiful. Developers agreed on these six functions & two events as the minimal viable token in order to normalize expected behaviors while communicating across the Ethereum network - by establishing this protocol, Ethereum developers are able to work with external smart contracts easily. The ERC20 token standard, which stands for Ethereum Requests for Comment, is a standard set of programming “rules” that all Ethereum-based token are expected to follow. These dapp-specific Ethereum tokens can be are implemented in order to create a network of dapps with meaningful use cases such as invoice factoring, browser-wide payments, & a cryptocurrency debit card.Īll previously mentioned ideas are currently-live Ethereum based dapp-tokens that follow a very common token programming standard in fact, 99% of all deployed Ethereum tokens follow this standard, the ERC20 standard. The Ethereum blockchain platform is built in such a way that it encourages dapps of all kind - including those that require the creation, maintenance & transferring of digital assets. Some, but not all, of these dapps (decentralized apps) require an additional in-dapp currency - these dapps introduce their new currency, named token, and raise funds through an initial coin offering (ICO). This computing platform, the Ethereum network, hosts decentralized applications (dapps) that are executed with chunks of codes named smart contracts all transactions on the Ethereum network, as well as the computing costs of executing smart contracts, are paid for in the Ethereum cryptocurrency ether. To quickly re-cap, the Ethereum blockchain is a distributed, open-source blockchain-based computing platform. This article assumes the reader is already familiar with at the very least, the following concepts: the Ethereum blockchain, dapps, ether, smart contracts & ICOs.
