Skip to main content

Posts

Showing posts with the label smart contract

Smart contract with remix IDE and Ganache

  Previous Topic:  Simple transaction with ganache using Golang In the Previous topic, we learned how to do transaction with ganache using Golang. Now, we will learn what is smart contract and how to write smart contract and how to deploy it and how to call the contract using remix. To learn what is smart contract, we already write a blog about that. Please feel free to take a look.  Ethereum Smart contract . For beginners, use the Remix IDE for learning smart contract and understand how it works. Then we will use Truffle framework. REMIX:  Remix IDE Link Remix will provide a default workspace for developing smart contract. Now you can able to create a new file and start writing contracts, compile it with solidity compiler and deploy that contract and test the contracts. Simple Smart Contract: First create new file called store.sol  and start writing a simple contract. Contract Functionality: Store a record using SetRecord method. View the latest record . [reco...

Ethereum Smart contract

Smart contract is a self executing program based on agreement or logic we provided in the program. There are three types of contract: Smart Legal Contracts           - Digital Will, A legal agreement between two parties  Decentralized Autonomous Organizations (DAO)         - No One is boss. Decisions are made based on voting (smart contract)  Application Logic Contracts         - Communication with smart devices through contracts (IOT) Each Contract lives on the Ethereum network and has an unique address with ether balance. If we want execute something on the contract we need to use the contract address to do actions. It has data and code associated with it Similar to OOPS concept. Ethereum nodes don't run the solidity code. First, Transforms the code to bytecode and deploy it in the network. Each nodes has EVM which will executes the bytecode. Languages to write contracts:   Solidity  - Javascript like...