BlockChain Blog Notes

Gary Gensler from MIT open course too generic

Alipay Apple Cash currency conversion? a short one to learn the intricacies of cross-board issue, regulation

Decentralizing everything with ethereal Vitalik Buterin, a genius  

2013 blockchain smart contracts core idea is; Shared memory

On Remix Ethereum IDE

Factory pattern

Contract to deploy another contract

pragma solidity ^0.6.0

Import “./SimpleStorage.sol”;

Contract StorageFactory { 

  Function createSimpleStorageContract() public {

  simpleStorage[] public simpleStorageArray;

    simpleStorage simpleStorage = new SimpleStorage();

#create another function sfstore(uint256 public variable to interact with, store the number and a length

ABI application binary interface 

Address 

Deploy the factory

sfGet(uint256 public view returns (uint256) 

Refactor this code to be simple by cal retrieve 

Simplestorage.sol, StorageFactory.sol

Web3.py package to do smart contract

Brownie. 

Control back tick to switch between terminal

Pip install black, then python formatter to find black as save on format

With open(“./SimpleStorage.sol”, “r”) as file:

  simple_storage_file = file.read()

  print(simple_storage_file)

Py-solc-x to do compiler function

From solace import compile_standard

compiled_sol = compile_standard(

  “Language”: “solidity”,

  “Sources”:{SimpleStorage.sol”:{“content”: simple_storage_file}),

Get byte code

Get Abu

Deploy javascript VM ganache one-click blockchain pip install web3

from web3 import web3

#for connecting to ganache

W3 = WEb3(web.HTTProvider(“http://0.0)

chain_id = 1337

my_address = “0xdsfs…”

private_key = “0x08d..”

#create the contract in python

deploy.py

#get the latest transaction 

Nonce = w3.eth.getTranscationCount(my_address)

print(nonce)

Transaction =SimpleStorage.constructor().buildTransaction

Create .env file

Export PRIVATE_KEY =…

.Gitignore

Loading .env in python

Is simpleStorage make it inherited

FundMe.sol

Contract FundMe {

//to accept payment

  Function fund() public payable {

  //wei, Gwen ether is unit difference

  mapping(address => uint256) public 

msg.sender msg.value 

//can set up minimum value to be funded

//currency rate ETH -> USD conversion rate

Oracle Deterministic 

Blockchain non-deterministic

Point of failure oracle could be

ChainLInk shines

 DeFi Ecosystem is supported by Chainlink AAVE lending and borrowing, set protocol on commodity money, SushiSwap on DEX, and Synthetic on synthetic assets secured 2Billion use

ABI tell what function can be called

Already deployed smart contract need an ABI

Testnet located at the address pasted 

getVersion() public

Using Interface minimalistic view

latesRoundData make function to cal this to get price

}

}

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.