본문 바로가기

SSAFY 6기/📌blockchain4

인프런 nft 강좌 #3 - react 개발 📌 Main 페이지 🔖 main.tsx import React, { FC, useState } from "react"; import { Box, Text, Flex, Button } from "@chakra-ui/react"; import { mintAnimalTokenContract } from "../contracts/index"; // import AnimalCard from "../components/AnimalCard"; interface MainProps { account: string; } const Main: FC = ({ account }) => { const [newAnimalCard, setNewAnimalCard] = useState(); const onClickMint = asyn.. 2022. 3. 14.
인프런 nft 강좌 #2 - react 세팅 📌 세팅 현재 web3 관련해서 create-react-app으로 생성 시 버그가 있으므로, 아래 boiler-plate를 clone해서 사용하자. ( https://github.com/h662/web3-boilerplate ) 🔖 UI chakra ui를 사용하자. ( https://chakra-ui.com/ ) npm i @chakra-ui/react @emotion/react@^11 @emotion/styled@^11 framer-motion@^6 🔖 index.tsx import React from "react"; import ReactDOM from "react-dom"; import App from "./App"; import reportWebVitals from "./reportWebVita.. 2022. 3. 14.
인프런 nft 강좌 #1 스마트 컨트랙트 작성 📌 설치 npm i @openzeppelin/contracts npm install -g remixd deprecated 으로 설치 안된다. 아래 명령어를 이용하자 npm install -g @remix-project/remixd 📦 sample code - MintAnimalToken.sol // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; contract MintAnimalToken is ERC721Enumerable { constructor() ERC721("h662Animals","HAS"){} functio.. 2022. 3. 10.
인프런 Lottery Dapp 강좌 #1 📌 개발 환경 nodejs truffle npm -g install truffle@5.0.2 ganache-cli 블록체인을 쉽게 Mock을 해놓은 테스트해놓은 app vscode - solidity extension metamask 📌 truffle 세팅 폴더 생성한 뒤 해당 폴더에서 truffle init contracts 스마트 컨트렉트 관련 파일들을 작성 migrations 배포 관련 스크립트를 작성 test solidity, json을 이용해서 만드는 테스트가 있는데, 보통 json을 이용해서 만드는 테스트로 사용한다. 📦 Compile pragma solidity >= 0.4; contract Lottery{ } contracts 폴더 안에 Lottery.sol 파일 생성 후 위 코드 작성 t.. 2022. 3. 3.