Smart Contracts, ERC-20 and Oracles

Last Updated on January 27, 2022

  • A smart contract is software that automatically executes instructions when transferring tokens.
  • Technical Notes: ERC is a category of Ethereum Improvement Proposals to (as the name suggests) request input comments about a given proposal.
  • These are standard application-level conventions, including contract standards such as:
    1. Token standards (ERC-20)
    2. Name registries (ERC-137)
    3. URI schemes, library/package formats
    4. And wallet formats
  • Above deciphered: ERC-20 is an official request for a technical standard to be implemented in smart contracts on the Ethereum blockchain for token transactions.
  • ERC stands for Ethereum Request for Comment, and 20 is the number assigned to the official technical Improvement Proposal written by Ethereum founders Fabian Vogelsteller, and Vitalik Buterin.
  • Since its inception, ERC-20 has emerged as the technical standard used for all smart contracts on the Ethereum blockchain which are increasing in popularity.

Coding ERC-20 tokens, the six basic coding functions are:

  • totalSupply()
  • balanceOf()
  • transfer()
  • transferFrom()
  • approve()
  • allowance()
  • event Transfer()
  • event Approval()

Event Behavior

Transfer() event produces the details of the transaction which resulted in the movement of tokens from one address to the other.
Approval() event gives the details of the approval of tokens.

These events are triggered when a relevant action, pertaining to the 6 functions above, takes place on the blockchain.

  • Some of the digital currencies using the ERC-20 standard:
    1. Maker (MKR)
    2. Basic Attention Token (BAT)
    3. Augur (REP)
    4. OmiseGO (OMG)
    5. Bancor Network
    6. Civic
    7. Gnosis
    8. Golem

These code functions are integral for user/token implementation, specifically in determining the amount of tokens in circulation, storing and returning balances, making transfer and withdrawal requests and granting approval, and agreeing to automated transfers.

This set of functions and signals ensures that Ethereum tokens of different types will all uniformly perform in any place within the Ethereum system.

Oracles

Smart contracts generally cannot access information in the real world. Oracles provide a middle layer conduit to real-world data the blockchain needs to perform functions. This data could be anything from price feed to weather report.

There is a risk of consuming inaccurate or centralized data when accessing real-world apis. Decentralized oracles lower this risk by querying multiple oracles to determine the validity and accuracy of the data, with each oracle acting autonomously in a decentralized network to validate the data – and bring off-chain data into the blockchain.

Oracle Companies By Market Cap:

  • Chainlink (LINK)
  • Universal Market Access (UMA)
  • WINklink (WIN)
  • Band Protocol (Band)
  • iExec Cloud Platform (RLC)