Dig into Ethereum (Smart contracts)… keeping it simple for people who are scared / confused of Blockchain
*******************************************************************
Blockchain and Ethereum is an complex domain for everyone.
Ethereum is a Protocol on which you can code and run Apps. Ethereum works as a Google App Store or Marketplace.
In Ethereum : You write Apps using Solidity language(built-in) and run those Apps as Contracts.
Contracts are Business Logic.
Hi All, I am trying to explain the process of Coding, Deploying and Testing Smart contracts in Ethereum platform.
Steps :
- First a Developer, will code a new Smart contract (source code)
- Contract is written in Solidity language
- Use Solidity IDE to write code
- Deploy the new Contract to Ethereum blockchain
- For Deploying new Contract, create a new Transaction (Txn) in Ethereum
- Create a new Transaction, which will create a new Smart Contract in Ethereum. You have to pay Gas cost for running your Transaction.
- Once Created, New Contract attributes: (Contract: Address, Creator: Address, Txn: Address, Block ID, Ether balance, etc)
- Once Contract is created, You can run the Contract.
- You can test Smart contract using Etherscan & Metamask browser plugin
- Contract contains all Transactions : For every creation & running Contracts
- Etherscan site: shows all Contracts and Transactions (within Contract)
- You can publish & Share Contract source code in https://etherscan.io/
Dev Tools for coding and testing Contracts: Use Metamask plugin in Chrome, Remix Solidity IDE, Etherscan site to view Contracts created and executed Contracts.
In detail:
- Contract = [Txn1, Txn2, Txn3……]
- Contract runs on Ethereum platform
- Contract SDLC : (Code -> Build -> Deploy -> Run)
- Transactions are broadcasted to all Ethereum Nodes and after verification, these Transactions will be stored on Block.
- Anyone can run Contract on Ethereum blockchain
- each Txn has an unique address
- each Contract has an unique address
Ethereum: has 2 Account types
- User accounts (private keys) {User Private Key == Ethereum address}
- Contracts (Account controlled by code).
*Digital Assets in Ethereum are under direct Control of Contracts. Contracts have some Set of Rules attached to them.
*Ethereum stores information : Current State and Historical transactions
- All Nodes in Ethereum store current State.
- Some Nodes store History.