• bitcoinBitcoin(BTC)$21,421.000.260%
    BITCOIN
    24H : 0.260%
    Volume : $15,701,705,568.00
    Marketcap : $408,224,231,818.00
  • ethereumEthereum(ETH)$1,235.751.04%
    ETHEREUM
    24H : 1.04%
    Volume : $11,223,817,447.00
    Marketcap : $149,870,635,462.00
  • tetherTether(USDT)$1.00-0.03%
    TETHER
    24H : -0.03%
    Volume : $30,554,294,769.00
    Marketcap : $66,909,330,445.00
  • usd-coinUSD Coin(USDC)$1.000.060%
    USD COIN
    24H : 0.060%
    Volume : $3,244,556,249.00
    Marketcap : $55,950,119,479.00
  • binancecoinBNB(BNB)$238.09-0.56%
    BNB
    24H : -0.56%
    Volume : $812,292,520.00
    Marketcap : $38,768,538,274.00
  • rippleXRP(XRP)$0.366-1.10%
    XRP
    24H : -1.10%
    Volume : $779,574,584.00
    Marketcap : $17,658,693,891.00
  • binance-usdBinance USD(BUSD)$1.00-0.01%
    BINANCE USD
    24H : -0.01%
    Volume : $2,963,140,182.00
    Marketcap : $17,376,856,804.00
  • cardanoCardano(ADA)$0.502-0.31%
    CARDANO
    24H : -0.31%
    Volume : $639,576,256.00
    Marketcap : $16,949,303,493.00
  • solanaSolana(SOL)$41.19-2.33%
    SOLANA
    24H : -2.33%
    Volume : $1,230,165,473.00
    Marketcap : $14,085,382,763.00
  • polkadotPolkadot(DOT)$8.05-2.38%
    POLKADOT
    24H : -2.38%
    Volume : $302,218,066.00
    Marketcap : $9,051,374,141.00
Cointelegraph.com.au
  • bitcoin
    BTC$21,421.000.260%
  • ethereum
    ETH$1,235.751.04%
  • tether
    USDT$1.00-0.03%
  • usd-coin
    USDC$1.000.060%
  • binancecoin
    BNB$238.09-0.56%
    • News
      • Bitcoin News
      • Ethereum News
      • Altcoin News
      • Press Releases
      • Analysis
      • ICO News
      • Technology
    • Videos
      • Altcoin Videos
      • Bitcoin Videos
      • Blockchain Videos
      • Ethereum Videos
      • ICO Videos
    • Crypto Exchanges
    • Market Cap
    • ICOs
    • Submit Press Release
    • Contact Us
    No Result
    View All Result
    • News
      • Bitcoin News
      • Ethereum News
      • Altcoin News
      • Press Releases
      • Analysis
      • ICO News
      • Technology
    • Videos
      • Altcoin Videos
      • Bitcoin Videos
      • Blockchain Videos
      • Ethereum Videos
      • ICO Videos
    • Crypto Exchanges
    • Market Cap
    • ICOs
    • Submit Press Release
    • Contact Us
    No Result
    View All Result
    Cointelegraph.com.au
    No Result
    View All Result
    Home Videos Ethereum Videos

    Intro To Smart Contracts in Ethereum, Learn About Solidity and the EVM in 6 mins

    RocketPrep by RocketPrep
    January 18, 2017
    in Ethereum Videos
    Reading Time: 3 mins read
    4k 256
    0
    Intro To Smart Contracts in Ethereum, Learn About Solidity and the EVM in 6 mins
    5k
    SHARES
    38.8k
    VIEWS
    Share on FacebookShare on Twitter



    Welcome to this introduction to smart contracts! In this series, we will learn the fundamentals of smart contracts in Ethereum. We will also build a smart contract from scratch using the Solidity language.

    Here’s a quick recap of what we have learned so far.
    We learned about geth, the command line interface into Ethereum.

    Related articles

    Polkadot vs Ethereum Price Prediction: How High Can DOT and ETH Go? | Token Metrics Live Stream

    Polkadot vs Ethereum Price Prediction: How High Can DOT and ETH Go? | Token Metrics Live Stream

    August 24, 2020
    Elon Musk –  SpaceX & NASA Live Event | ETH, Ethereum 2.0, ETH Halving 2020

    ⚫Elon Musk – SpaceX & NASA Live Event | ETH, Ethereum 2.0, ETH Halving 2020⚫

    August 24, 2020

    We learned how to create a private blockchain on our computer.

    We also learned how to mine ether on our private blockchain.
    If you need to refresh these topics, watch our videos in this series, in the Youtube channel called “Turbo Prep”.

    So, here are the goals for today’s video.
    We will learn about the basics of smart contracts in Ethereum.

    We will learn about EVM, or the Ethereum Virtual Machine, and why it’s important for understanding smart contracts.

    We will also learn about the Solidity language, for creating smart contracts.

    Lets get started!

    To begin with, we will look at the basics of smart contracts in Ethereum.

    What is a smart contract?

    It is a “Mechanism To Distribute Assets Among A Fixed Number Of Parties”.

    Let’s go through each aspect of this definition.

    Parties refers to accounts on the Ethereum blockchain. As we have seen in prior videos, accounts can send ether to each other using transactions.
    Smart contracts treat each of these accounts, as parties to a smart contract.

    Smart contracts are nothing but software programs, that reside on the Ethereum blockchain.
    This is what makes Ethereum’s blockchain different than some other blockchains, in that, it not only allows currency to reside on it, but software code as well.

    A smart contract needs a way to distribute assets, usually ether, amongst its accounts. It does so using Ethereum transactions.
    In other words, just like a human operating an account can send ether to another human operating an account, a smart contract can send ether to another account, multiple accounts, or even other smart contracts.

    Here are some examples of smart contracts.
    An escrow agreement can be modelled as a smart contract, where it will store ether on behalf of one or more parties, and release it upon completion of certain conditions.

    On the same lines, an employment agreement can be modelled as a smart contract, where it will release a fixed amount of ether to the employee, upon completion of a finite amount of work.

    An auction is a smart contract between bidders, who get ownership of a digital asset based on two conditions: one, the submission of the highest bid, and two, the payment of the final bid.

    Lastly, voting can be modelled as a smart contract. We will learn to build a voting system in the next video.

    Now, let’s get into more details around smart contracts, by learning about the EVM and Solidity.

    What is the EVM?

    It is the “Part of the Ethereum blockchain that handles state and logic”.

    A key point to remember is this:
    In Ethereum, a smart contract is similar to an object in an object oriented language such as C++ or Java.
    Objects in Ethereum are nothing but accounts.

    This means, each account can have its own state and logic. Again, this is no different than objects in object oriented languages having variables and methods.

    Since accounts can communicate using transactions, so too can smart contracts send transactions to each other.
    So – just like a tank is a truck with a gun and ammunition, Ethereum accounts are objects that have transactions and ethers.

    Now, the EVM executes bytecode. Smart contracts exist as bytecode, which is executed by the Ethereum Virtual Machine.
    It is similar to bytecode used in the Java JVM or C# CLR.

    Finally, every transaction and execution of bytecode costs ether.
    This mechanism ensures that any code running on the EVM does not waste resources, by going into an infinite loop, for instance.

    Now we come to Solidity. Why do we need it?

    Solidity is the “Language for writing smart contracts targeting Ethereum”.

    Instead of directly writing bytecode, programmers can use Solidity to write smart contracts in a Javascript-like language.
    It is the most popular way of writing Ethereum contracts as of now.
    Other languages are also being created, such as Serpent, for Python programmers.

    Several compilers are available for compiling smart contracts written in Solidity.
    SolC and the browser-based compiler are the two most common compilers for Solidity.

    These compilers compile Solidity into EVM bytecodes, which can then be deployed into the Ethereum blockchain.

    This completes the entire lifecycle of a smart contract in Ethereum.
    It starts as a Solidity file, which is compiled into EVM bytecodes, which are deployed into the Ethereum blockchain, ready to receive transactions.

    This ends our introduction to smart contracts.

    In the next video, we will learn to build and deploy a voting smart contract using Solidity in our lab.

    Thanks for watching!

    source

    Tags: ethereum
    Share2018Tweet1261
    RocketPrep

    RocketPrep

    Related Posts

    Polkadot vs Ethereum Price Prediction: How High Can DOT and ETH Go? | Token Metrics Live Stream

    Polkadot vs Ethereum Price Prediction: How High Can DOT and ETH Go? | Token Metrics Live Stream

    by Token Metrics
    August 24, 2020
    0

    Polkadot vs Ethereum Price Prediction: How High Can DOT and ETH Go? | Token Metrics Live Stream #Polkadot #Ethereum #PricePrediction...

    Elon Musk –  SpaceX & NASA Live Event | ETH, Ethereum 2.0, ETH Halving 2020

    ⚫Elon Musk – SpaceX & NASA Live Event | ETH, Ethereum 2.0, ETH Halving 2020⚫

    by sᴘᴀᴄᴇx Official
    August 24, 2020
    0

    ⚫ More ➱ source

    Bitcoin y Ethereum: final de sobreventa, se inicia el rebote. ETHBTC clara estrategia de trading.

    Bitcoin y Ethereum: final de sobreventa, se inicia el rebote. ETHBTC clara estrategia de trading.

    by Educación Financiera y Criptomonedas
    August 24, 2020
    0

    Usando la aplicación changeinvest puedes comprar Bitcoin al mejor precio y sin comisiones. Tanto para Apple como para Android ¿Quieres...

    ⚫Elon Musk – SpaceX & NASA Live Event | ETH, Ethereum 2.0, ETH Halving 2020⚫

    ⚫Elon Musk – SpaceX & NASA Live Event | ETH, Ethereum 2.0, ETH Halving 2020⚫

    by sᴘᴀᴄᴇx Official
    August 24, 2020
    0

    ⚫ More ➱ source

    ⚫Elon Musk – SpaceX & NASA Live Event | ETH, Ethereum 2.0, ETH Halving 2020⚫

    ⚫Elon Musk – SpaceX & NASA Live Event | ETH, Ethereum 2.0, ETH Halving 2020⚫

    by sᴘᴀᴄᴇx Official
    August 24, 2020
    0

    ⚫ More ➱ source

    Load More
    Please login to join discussion
    • Trending
    • Comments
    • Latest
    Binary Bot 95%| Free Download

    Binary Bot 95%| Free Download

    March 12, 2020
    FREE BITCOIN CRYPTOTAB HACK SCRIPT 2020 , 14 BTC WORKING

    FREE BITCOIN CRYPTOTAB HACK SCRIPT 2020 , 14 BTC WORKING

    March 31, 2020
    𝗙𝗿𝗲𝗲 Blockchain fake bitcoin transaction software (R.B.F full option)

    𝗙𝗿𝗲𝗲 Blockchain fake bitcoin transaction software (R.B.F full option)

    February 16, 2020
    Blockchain   Bitcoin Miner V3 2  Best Blockchain Mining Tool    2020

    Blockchain Bitcoin Miner V3 2 Best Blockchain Mining Tool 2020

    June 27, 2020
    Analyst Who Predicted Bitcoin’s $3,000 2018 Bottom Says This is Next

    Analyst Who Predicted Bitcoin’s $3,000 2018 Bottom Says This is Next

    0
    Bitcoin to Be One of the 2020s’ Top Investments: Ex-Goldman Sachs Exec Says Why

    Bitcoin to Be One of the 2020s’ Top Investments: Ex-Goldman Sachs Exec Says Why

    0
    This Eerily Accurate Fractal Suggests Bitcoin Will Soon Explode to $12,000

    This Eerily Accurate Fractal Suggests Bitcoin Will Soon Explode to $12,000

    0
    Last Year’s Top Crypto Market Performers Are Lagging Behind Altcoins in 2020

    Last Year’s Top Crypto Market Performers Are Lagging Behind Altcoins in 2020

    0
    Bitcoin

    TA: Bitcoin Price Eyes Upside Break, Why BTC Could Surge to $23K

    June 26, 2022
    bitcoin google

    Is Bitcoin Like Buying Google Early? Check Out The Shocking Comparison

    June 26, 2022
    Bitcoin

    Bitcoin Coinbase Premium Gap Approaches Zero, Selloff Ending?

    June 26, 2022
    Bitcoin Whale

    Bitcoin Whale Presence On Derivatives Still High, More Volatility Ahead?

    June 26, 2022
    bitcoin Bitcoin
    $21,421.00
    $21,421.00
    EUR: €20,292.73
    GBP: £17,465.85
    7D Chart0.260%
    ethereum Ethereum
    $1,235.75
    $1,235.75
    EUR: €1,170.66
    GBP: £1,007.58
    7D Chart1.04%
    tether Tether
    $1.00
    $1.00
    EUR: €0.948
    GBP: £0.816
    7D Chart-0.03%
    ripple XRP
    $0.366
    $0.366
    EUR: €0.347
    GBP: £0.299
    7D Chart-1.10%
    cardano Cardano
    $0.502
    $0.502
    EUR: €0.476
    GBP: £0.409
    7D Chart-0.31%
    litecoin Litecoin
    $59.25
    $59.25
    EUR: €56.13
    GBP: £48.31
    7D Chart4.10%
    bitcoin-cash Bitcoin Cash
    $116.28
    $116.28
    EUR: €110.16
    GBP: £94.81
    7D Chart1.91%
    eos EOS
    $1.01
    $1.01
    EUR: €0.952
    GBP: £0.819
    7D Chart-1.07%

    Recent News

    Bitcoin

    TA: Bitcoin Price Eyes Upside Break, Why BTC Could Surge to $23K

    June 26, 2022
    bitcoin google

    Is Bitcoin Like Buying Google Early? Check Out The Shocking Comparison

    June 26, 2022
    Bitcoin

    Bitcoin Coinbase Premium Gap Approaches Zero, Selloff Ending?

    June 26, 2022

    Categories

    • Altcoin News
    • Altcoin Videos
    • Analysis
    • Bitcoin News
    • Bitcoin Videos
    • Blockchain Videos
    • Ethereum News
    • Ethereum Videos
    • ICO News
    • ICO Videos
    • News
    • Press Releases
    • Technology
    • Uncategorized
    Cointelegraph.com.au

    Bringing you the very latest crypto news and reviews from around the world.

    • About
    • Contact Us
    • Submit Press Release
    • Privacy Policy

    © 2019 Cointelegraph.com.au

    No Result
    View All Result
    • News
      • Bitcoin News
      • Ethereum News
      • Altcoin News
      • Press Releases
      • Analysis
      • ICO News
      • Technology
    • Videos
      • Altcoin Videos
      • Bitcoin Videos
      • Blockchain Videos
      • Ethereum Videos
      • ICO Videos
    • Crypto Exchanges
    • Market Cap
    • ICOs
    • Submit Press Release
    • Contact Us

    © 2019 Cointelegraph.com.au

    Welcome Back!

    Login to your account below

    Forgotten Password?

    Retrieve your password

    Please enter your username or email address to reset your password.

    Log In

    Add New Playlist

    This website uses cookies. By continuing to use this website you are giving consent to cookies being used. Visit our Privacy and Cookie Policy.