Git Product home page Git Product logo

learnsolidity's Introduction

LearnSolidity

 

LearnSolidity

Github top language Github language count Repository size License

About   |   Features   |   Technologies   |   Requirements   |   Starting   |   License   |   Author


🎯 About

This repo contains all my learnings related to SOLIDITY..

✨ Concepts

✔️ Variables and types;
✔️ Ether and Wei;
✔️ GAS;

🏁 Starting

📝 Variables and types

#####Local Declared inside a function and are not stored on blockchain #####State declared outside a function to maintain the state of the smart contract Stored on the blockchain #####Global Provide information about the blockchain. They are injected by the Ethereum Virtual Machine during runtime. Includes things like transaction sender, block timestamp, block hash, etc.

📝 Ether and Wei

Transactions are paid with ether.

Similar to how one dollar is equal to 100 cent, one ether is equal to 10^18 wei.

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.10;

contract EtherUnits {
    uint public oneWei = 1 wei;
    // 1 wei is equal to 1
    bool public isOneWei = 1 wei == 1;

    uint public oneEther = 1 ether;
    // 1 ether is equal to 10^18 wei
    bool public isOneEther = 1 ether == 1e18;
}

📝 GAS

#####How much ether do you need to pay for a transaction? You pay gas spent * gas price amount of ether, where

  • gas is a unit of computation
  • gas spent is the total amount of gas used in a transaction
  • gas price is how much ether you are willing to pay per gas

Transactions with higher gas price have higher priority to be included in a block.

Unspent gas will be refunded.

#####Gas Limit There are 2 upper bounds to the amount of gas you can spend

  • gas limit (max amount of gas you're willing to use for your transaction, set by you)
  • block gas limit (max amount of gas allowed in a block, set by the network)

📝 License

This project is under license from MIT. For more details, see the LICENSE file.

Made with ❤️ by {{YOUR_NAME}}

 

Back to top

learnsolidity's People

Contributors

yaswanthgadde007 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.