Code Monkey home page Code Monkey logo

soliditystudy's Introduction

Solidity only

solidity-study > PURE_SOLIDITY_ONLY

Flash Course

  1. Each net has an Id, the mainnet is the ID 1 and so on...
  2. Built-in data: solidity-study > PURE_SOLIDITY_ONLY > built-in.sol

Add to MetaMask

  1. Click on plug icon
    1. Active lib: FLATTENER
    2. Select FLATTENER tab
    3. Click on "Flatten crypto currency name.sol"
    4. Cli on "Save crypto.._flat.sol"
    5. Fix the warning (just add a comment with SPDX license on top)
    6. Compile it selecting it flat file version
    7. On deploy tab:
      1. On deploy tab on remix choose: Injected Web3
      2. Add the necessary params (name, symbol & initialSupply)
      3. Click on deploy --> it will open meta mask & take sometime
  2. Copy the generated address on the token output after deploy
  3. Go to etherscan (under the testnet like: https://kovan.etherscan.io or https://rinkeby.etherscan.io)
  4. On search: paste the smart contract address
    1. --> It might take some time to the smart contract be available
    2. Click on "Contract" tab
    3. Click on "Verify and Publish"
      1. Compile type (in our case (OpenZepelin) is a "SingleFile" with optmization)
      2. Select compiler version
      3. No license or MIT as addded on SPDX comment
        1. On "Verify & Publish" upload the Coin.json, in this case is MintDollar.json
        2. Click on "verify" button on the bottom
  5. Copy the Contract address to add to MetaMask (click on Assets > Add Token > Paste address code)

Upgrading an existing smart contract archtecture: https://www.youtube.com/watch?v=RoXgaAvoIjg

Sample created Contract on real testnet Rinkeby: 0xcadfd54DC0F21571dB335044c7b14Eb1c8d38a71

Contract verified on EtherScan: https://rinkeby.etherscan.io/verifyContract-solc?a=0xcadfd54DC0F21571dB335044c7b14Eb1c8d38a71&c=v0.8.11%2bcommit.d7f03943&lictype=3 Contract itself: https://rinkeby.etherscan.io/address/0xcadfd54DC0F21571dB335044c7b14Eb1c8d38a71

Depositing Ether

  1. Create a function with "payable" identifier
  2. It allows us to get msg.sender & msg.value
  3. On the deploy JS EVM we need to add the amount to be sent on the input at the top (there is no input in the function place) and then click on the function
    1. --> remember to check the unit to be sent
    2. the balance retrieves it in wei unit
    3. if a key is not present in the dictionary (mapping) it is gonna to retrieve 0

DeFi

Build Status

This repository contains the core smart contract code for Multi Collateral Stable Coin (based on Dai). This is a high level description of the system, assuming familiarity with the basic economic mechanics as described in the whitepaper.

Additional Documentation (StableCoin)

dss is also documented in the wiki and in DEVELOPING.md

Solidity overview

https://github.com/TonGarcia/DeFi/blob/master/README.sol.md

Dai Framework

Dai (MakerDAO overall) uses DappTools as framework: https://github.com/dapphub/dapptools

soliditystudy's People

Contributors

tongarcia avatar

Watchers

James Cloos avatar  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.