본문 바로가기
  • 개발 / 공부 / 일상

Blockchain32

(BlockChain) NFT-Market (2) https://developerjjh.tistory.com/179 (BlockChain) NFT-Market (1) NFT를 거래할 수 있는 조그마한 Market을 만들어 보려고 한다 일단, 시작에 앞서 파일 및 폴더 환경설정부터 하면서 천천히 진행하려 한다 0. TS 설치 npm list -g npm i -g typescript ts-node 이전에 TS를 사용 developerjjh.tistory.com 이전 게시물에 앞서 코드를 이어가 보려고 한다 nft-market/back 추가 라이브러리 설치 npm i axios web3 web3-utils mkdir contracts back/contracts // SPDX-License-Identifier: MIT pragma solidity ^0.8.19.. 2023. 3. 17.
(BlockChain) NFT-Market (1) NFT를 거래할 수 있는 조그마한 Market을 만들어 보려고 한다 일단, 시작에 앞서 파일 및 폴더 환경설정부터 하면서 천천히 진행하려 한다 0. TS 설치 npm list -g npm i -g typescript ts-node 이전에 TS를 사용한 적이 없거나 컴퓨터를 교체하여서 window를 재설치 혹은 새로 깔았다면 전역에 ts를 설치해 주자 1. React (with.TS) yarn create react-app front --template typescript cd front yarn add web3 axios @metamask/providers @metamask/providers : TS환경에서 React내 window.ethereum의 자료형을 TS Compiler가 인지하지 못하기에 위와.. 2023. 3. 16.
(BlockChain) NFT 토큰 컨트랙트 OpenSea 등 NFT 마켓에서 사용하는 컨트랙트 NFT 토큰 컨트랙트 구현 import "../node_modules/@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "../node_modules/@openzeppelin/contracts/access/Ownable.sol"; import "../node_modules/@openzeppelin/contracts/utils/Strings.sol"; ERC721 기본 컨트랙트 owner 관련 컨트랙트, _owner 등을 추가 기존에 int, uint 등을 string화 하려면 byte로 바꿨다가 변경해야 하는데 String 라이브러리에서 제공하는 기능을 사용 uin.. 2023. 3. 14.
(BlockChain) Remix 활용 Remix를 사용하기 전에 폴더 및 라이브러리 설정 mkdir remix cd remix npm init -y npm i truffle @openzeppelin/contracts @remix-project/remixd npm i -D prettier-plugin-solidity npx truffle init Remix http://remix.ethereum.org에서 사용 스마트 컨트랙트의 작성 및 배포를 쉽게 할 수 있도록 하는 Ethereum IDE이라고 쉽게 이야기가 가 VScode에서 작성한 로컬 파일을 Remix에서 연동 -s : 로컬 폴더 위치 옵션 -u : 연결할 주소 npx remixd -s . --remix-ide https://remix.ethereum.org # npx remixd -.. 2023. 3. 13.