rareporn-application

所属分类:IPFS
开发工具:JavaScript
文件大小:0KB
下载次数:0
上传日期:2022-01-13 01:13:54
上 传 者sh-1993
说明:  稀有平台代币和NFT Marketplace是一种去中心化应用程序,允许人们参与ERC20代币ICO和mi...,
(Rare Platform Token and NFT Marketplace is a Decentralized Application that allows people to participate to an ERC20 token ICO and and mint or buy ERC721 tokens (NFTs - images))

文件列表:
.DS_Store (8196, 2022-01-12)
.slugignore (10, 2022-01-12)
LICENSE (1075, 2022-01-12)
client/ (0, 2022-01-12)
client/.slugignore (10, 2022-01-12)
client/package-lock.json (1404517, 2022-01-12)
client/package.json (968, 2022-01-12)
client/public/ (0, 2022-01-12)
client/public/favicon.ico (22382, 2022-01-12)
client/public/index.html (741, 2022-01-12)
client/public/logo192.png (8581, 2022-01-12)
client/public/logo512.png (22920, 2022-01-12)
client/public/manifest.json (492, 2022-01-12)
client/public/robots.txt (57, 2022-01-12)
client/src/ (0, 2022-01-12)
client/src/App.css (1153, 2022-01-12)
client/src/App.js (5596, 2022-01-12)
client/src/App.test.js (248, 2022-01-12)
client/src/components/ (0, 2022-01-12)
client/src/components/ERC20/ (0, 2022-01-12)
client/src/components/ERC20/Ico.js (7361, 2022-01-12)
client/src/components/Header.js (4857, 2022-01-12)
client/src/components/Home.js (1119, 2022-01-12)
client/src/components/NFT/ (0, 2022-01-12)
client/src/components/NFT/BuyNFT.js (8430, 2022-01-12)
client/src/components/NFT/NftAuction.js (10588, 2022-01-12)
client/src/contracts/ (0, 2022-01-12)
client/src/contracts/ERC20.json (724051, 2022-01-12)
client/src/contracts/ICO.json (692042, 2022-01-12)
client/src/contracts/IERC20.json (75781, 2022-01-12)
client/src/contracts/ImageNFT.json (1229044, 2022-01-12)
client/src/contracts/Migrations.json (66134, 2022-01-12)
client/src/contracts/Owned.json (74892, 2022-01-12)
client/src/contracts/SafeMath.json (115606, 2022-01-12)
client/src/contracts/SimpleStorage.json (42783, 2022-01-12)
client/src/getICOContract.js (356, 2022-01-12)
... ...

# Rare Plateform Token and NFT Marketplace The goal of this project is to create a complete ERC20 cryptocurrency from scratch and a simple NFT (ERC721 token) and a marketplace where one can buy tokens and images. Solidity, Javascript and NodeJS are used for the Back-End and the truffle react box and semantic-ui react for the Front-End, and the two contracts have been deployed to Rinkeby network (network_id: 4) through infura. The Deceltralized application (Dapp) will be deployed on Heroku and the source code published on Github. ## ERC20 Token - RPT The RPT token is used for an ICO, i.e. one can invest in the project by buying the token with ETH, if the transaction is successful, the amount of tokens corresponding to the amout of ethers spent buy the buyer is sent to his wallet. The eth received is not stored in the contract, an account has been provided by the contract's owner where ETH are transfered. This account address must be specified as the unique constructor parameter in the migration file (2_deploy_contract) in **migration** directory. ```javascript // ICO is the name of the ERC20 token contract var ICO = artifacts.require("./ICO.sol"); module.exports = function (deployer) { deployer.deploy(ICO, "address to transfer ETH from ICO to"); }; ``` ## ERC721 Token (NFT) - RPNFT The ERC721 token is used to mint images that are sold on the Dapp either at a fixed price or in auction. In order to be sure not to mint the same image several times, they are store on IPFS [[1]](https://ipfs.io/) that provides in return a unique identifier called CID (content identifier). CIDs describe data not by its location but by its content, this means the same content always results to the same CID, therefore if images are stored on the Ethereum Blockchain through the CIDs, they cannot be duplicated, i.e. the same image cannot be minted twice. Notice that this ipfs proprety is also povided by the ERC721, therefore, even if the image is not stored on IPFS, it would be unique in case it has been created following this standard. ## Configuration file The truffle react box is used to generate the Dapp structure, this is achieved buy running the command [[2]](https://www.trufflesuite.com/boxes/react) (the name of the project is set to the name of the working directory) ```javascript npx truffle unbox react ``` Since infura is used to access the Blockchain, one needs to provide the infura API key and the account mnemonic in the configuration file. An _.env_ file is used to store both the key and the mnemonic, this file must be saved in **client/src/** directory, for the mnemonic, Ganache [[3]](https://www.trufflesuite.com/ganache) is used through Metamask [[4]](https://metamask.io/). ```javascript // .env REACT_APP_RINKEBY_KEY = "INFURA KEY"; REACT_APP_MNEMONIC = "MNEMONIC"; ``` Here is the simple configuration of the _truflle-config.js_ file ```javascript // truffle-config.js const path = require("path"); const HDWalletProvider = require("./client/node_modules/@truffle/hdwallet-provider"); require("./client/node_modules/dotenv").config(); const MNEMONIC = process.env.REACT_APP_MNEMONIC; const RINKEBY_KEY = process.env.REACT_APP_RINKEBY_KEY; module.exports = { contracts_build_directory: path.join(__dirname, "client/src/contracts"), networks: { ganache: { host: "127.0.0.1", port: 7545, network_id: 5777, }, rinkeby: { provider: () => new HDWalletProvider( MNEMONIC, `https://rinkeby.infura.io/v3/${RINKEBY_KEY}` ), network_id: 4, gas: 4500000, }, }, compilers: { solc: { version: "0.8.4", }, }, }; ``` ## Results I this section are displayed screenshots of the Daap that show how it works. ### displaying the minted image ready for sell ![alt text](https://github.com/Edoumou/rareporn-application/blob/main/client/src/img/scr1.png "screeshot")

近期下载者

相关文件


收藏者