This project create a DApp by adding functionality to smart contract and deploy it on the public testnet.
Install Zeppelin as below:
npm install --save-exact openzeppelin-solidity@2.0.0-rc.1
- Star coordinators
- Dec
- Mag
- Cent
- Star story
Smart contract prevents stars with the same coordinates from being added.
Configure uniqueness with the stars, where uniqueness is based on coordinates. In other words, stars with the same coordinates are not permitted.
Smart contract implements all these functions - createStar(), putStarUpForSale(), buyStar(), checkIfStarExist(), mint(), approve(), safeTransferFrom(), SetApprovalForAll(), getApproved(), isApprovedForAll(), ownerOf(), starsForSale(), tokenIdToStarInfo()
Could lookup all these functions in StorNotary.sol file.
Project contains tests in "test" derectory.
And go through commands below to test contract smart.
npm install -g ganache-cli truffle
ganache-cli
truffle compile
truffle compile
truffle test
-
Creat project on infura and get the url.
-
Configure rinkeby test network in truffle-config.js.
-
Install truffle provider and deploy.
npm i -g windows-build-tools npm install truffle-hdwallet-provider truffle deploy --network rinkeby truffle deploy --network rinkeby --reset
Send a transaction to execute createStar() and putStarUpForSale() functions.
Utilize tools to complete function execution.
-
Metamask
Front-end is implemented on index.html.
Starting up http-server and to access front-end on http://127.0.0.1:8080/.
Functions for claiming a new star and looking up a star by ID are configured.