Skip to content

nmoreau/ethereumsamples

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ethereumsamples

Dev Environements

  • IDE Web : https://remix.ethereum.org/
    • Create the Contract in Sol
    • Compile and Publish
  • Alchemy : with the online Composer to interact with the BlockChain. Alchemy is an API front end exposing Eth Nodes functionalities.
  • Hardhat to run Solidity locally - https://hardhat.org/
  • IDE Vscode
    • Dev Kit addon for VSCode
  • Local Eth Emulator - Ganache

Sample - Faucet

First sample from Matering Ethereum Book

  • Create the File
  • Compile
  • Publish via MetaMask from my EOA Adress
    • This Creates a new Adress for the contract
  • Send funds to the contract - See here
  • Interact with the contract :
    • Call the contract passing parameters
    • The contract executes and sends the funds back to the caller in an internal transaction (example transaction)
  • See source file here : Faucel.sol

Sample - SimpleStorage

Lesson 1 from Patrick Alpha Youtube Video

  • In Remix with JavaScript emulator
  • Create a contract with a struct
  • Contact == Class
  • Array of People
  • Mapping
  • Set state => tx on Blockchain - See here
  • Get state - No tx
  • See source file here : SimpleStorage.sol

Sample - Factory

Lesson 2 from Patrick Alpha YouTube Video Lesson 2

  • Import to make contracts visible
  • From the Factory instantiate a Contract and Publish it. We can create contract from a function.
  • Factory holds an array of instances from the contract
  • Inheritance - Factory inherits from the contact

Sample - ERC20 and Web3

Lesson 9 from Patrick Alpha YouTube Video Lesson 9

  • Using Open Zepplin and requires use of Brownie. Too tedious and switching to using Remix with github imports
  • Moved back to a simple way to create a Token in Remix using this tutorial from DappHero
  • Still using Open Zepplin smart contract library to boostrap ERC20, ERC721 (NFT), ERC777 (newest flavor of ERC20), and ERC1155 (a new multi token standard)
  • See my projects files here : ERC20
    • Create a contract and deploy
    • NMoreauToken contract deployed Here on Rinkeby
    • Contact needs to be verified for the syntax to be exposed publicly. See example with Tether contract
  • Playing with Web3.js to interact with the contact - See Web3.js and my samples
    • Running Js required to have the wallet connected to execute queries (readonly)
    • Syntax from remix : remix.execute()

NFT Miniting - ERC-721 Token

This sample is using the NFT tutorial from the Ethereum foundation.

Part 1 - Write and Deploy an NFT - Part 1 Tutorial Link

  • Create an Alchemy account and create an App on Ropsten
  • Alchemy Composer enables to interact with Web3Api. Alchemy prevent devs from setting up nodes.
  • Steps involve, creating the contract, config with Pk to sign, deploy script
  • The NmoreauNFT Smart Contract was deployed here on Ropsten created from my Test Wallet address

Part 2 - Interact with the contact to mint an NFT - Part 2 Tutorial Link

  • The NFT minted looks like this in the nft-metadata.json file is published in IPFS here
  "attributes": [
    {
      "trait_type": "Breed",
      "value": "Human"
    },
    {
      "trait_type": "Type",
      "value": "Geek"
    }
  ],
  "description": "My pixelized face",
  "image": "https://gateway.pinata.cloud/ipfs/QmPjUwrEnk7KnP78LGgu6LLszQy5xbBi1uaAsVY5Scvmev",
  "name": "Nicolas"
}

The metadata file is pointing to my Pixelized face on IPFS.

  • The NFT was minted by this transaction with Nounce 3
  • On MetaMask (Mobile) you are able to import the NFT on the test accounts based on the Contract Address and the Nounce.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published