Giter VIP home page Giter VIP logo

etherplate's Introduction

Etherplate

etherplate red block logo

PRs Welcome CC0

What is this?

This is an example project showing how you can hook up your Ethereum Non-Fungible Tokens (NFTs, ERC721, similar to CryptoKitties) contract in a DApp. It demos web3 events, and is highly opinionated in that it uses Redux, React, React Router, and Bulma. You can rip out of any these or replace them with your favourites (ie. Skeleton.css instead of Bulma, etc.).

Etherplate uses OpenZeppelin's fantastic community-audited contracts as a base to implement the ERC721 standard.

View Demo

View Demo on Netlify (Uses Ropsten testnet)

Etherplate Demo Gif

Setup

Requires NPM & Direnv

Homebrew on Mac OSX:

brew install node npm direnv

Apt on Linux:

apt-get install node npm direnv

Install truffle globally:

npm install truffle -g

Install the local NPM packages:

npm install

Environment Variables

  1. cp .envrc.example .envrc

  2. Enter your own twelve random words in the .envrc.

  3. Also, we'll leverage Infura's Ethereum Ropsten testnet node, so make sure to set up an account and paste your private key in your .envrc.

  4. Use direnv allow to export the env vars into your current terminal shell.

Run the Ganache CLI (local EVM)

Start up the local Ethereum test node with:

npm run ganache

(You may need to loosen up the permissions on the file, try chmod 755 scripts/ganache.sh)

Compile the Solidity code

Once Ganache is running, in another terminal window compile and migrate the contracts:

truffle compile

This will deploy the compiled contracts to the network (tip: use --network=ropsten to deploy to Ethereum's Ropsten Testnet, --network=rinkeby for rinkeby, etc)

truffle migrate

Run the Project

Make sure the truffle contracts are compiled and migrated, and ganache is running.

Start the Webpack dev server.

npm run dev

Your server should now be running at http://127.0.0.1:8080

truffle.js & truffle-config.js

Why is there both a truffle and truffle-config file?

  • On Windows, truffle-config.js is required. You can safely delete the one you don't need (ie on Mac/Linux you can delete truffle-config.js)

Building the Project

npm run build

Note: Currently we are manually migrating contracts against the Ropsten & Rinkeby testnets, and checking the build into the repo. This is less than ideal. It would be better to use a build script such as the netlify-build.sh file and compile contracts on the server.

Running the Tests

For the Solidity contract's truffle test suite:

truffle test

To run the DApp test suite (React components, etc):

npm test


Toast Messages

Examples of a bunch of different looking toast messages to show on an error message, success, info, etc.:

  toastr.light('test', 'message', { icon: 'info', status: 'info' })
  toastr.light('test', 'message', { icon: 'success', status: 'success' })
  toastr.light('test', 'message', { icon: 'warning', status: 'warning' })

  toastr.success('test', 'message')
  toastr.info('test', 'message')
  toastr.warning('test', 'message')
  toastr.error('test', 'message')

TODO:

  • Test w/ Web3-integrated browsers such as Trust
  • Set up a basic server to respond to tokenURI requests and store the tokenURI in the contract (buyToken() function)
  • Refactor React components to have both presentation and container components
  • Add deepFreeze() to test immutability of Redux reducers
  • Fix issues where we should be unsubscribing / canceling server requests in componentWillUnmount()
  • Rename all services to have -service in the filename
  • Rename all components to use standard React naming scheme: EtherscanButton.jsx instead of etherscan-button.jsx
  • Follow a standard ES6 export pattern (use TokenListItem component code as an example)

Nice-to-haves:

  • Offline.js or react-detect-offline to let users know when their network connection is dead
  • Find a way to prevent truffle test from recompiling the contracts each time it is run
  • Store transactionHash in localStorage and call info on it after page refreshes if it isn't in store.getState().tokens pool
  • Remove the build directory from the repo, build server-side on each deploy and possibly use truffle-migrate-off-chain (https://github.com/asselstine/truffle-migrate-off-chain)
  • Test the happy path of filling out the form and purchasing a token via (jest/enzyme)
  • Get circleci branch up and running, put a badge on the README for test runs
  • Demo how ERC721 expects you to store data (such as the JSON response when the tokenURI is requested) as per https://eips.ethereum.org/EIPS/eip-721 (For instance, OpenSea has a server which takes a contract address and tokenID, which then does a GET request to the tokenURI to pull more info (as JSON) about the token (images, name, etc), for example: https://opensea-api.herokuapp.com/events/?asset_contract_address=0x06012c8cf97bead5deae237070f9587f8e7a266d&token_id=389343)

Done:

  • Make into a truffle box and submit to trufflesuite
  • BUG: Purchase History only showing some purchases while My Tokens shows more ... ?
  • Show token ID / transaction ID on purchase history and Tokens#show page
  • Make sure 'Purchase History' page works
  • Implement Redux for web3 events
  • Make all React prop types required (isRequired) and provide defaultProps for those that are not
  • Convert all css to scss
  • Improve mobile styling / media query support
  • Deploy to Netlify & Ropsten, use Infura
  • Use a local web3 (1.0.0.beta?) instead of the current MetaMask/browser's web3 instance (which is deprecated)
  • Fix getting duplicate entries when Ropsten returns the BoughtToken event (active subscriber listening for events in browser)
  • New token updated from transaction receipt event is not being added to state properly in realtime
  • Get DApp tests working again
  • On successful purchase, show a message about the new purchase and how it needs to be confirmed by the network, and redirect to show the now confirming token on Purchase History or My Tokens page
  • Instead of 'Loading ...' should say confirming (show # of confirmations?)
  • Race condition: sometimes we do not have the list of accounts from MetaMask on time when page loads (google for onPageLoad code)
  • Mock out a web3 object in the specs
  • Clean up JS in Header.jsx for controlling Bulma link active states
  • Show account balance, network and account address / avatar
  • Finish upgrade path by removing oldNfTokenFactory and in turn get .events.BoughtToken() working again: (Error: The current provider doesn't support subscriptions: MetamaskInpageProvider)
  • Add a price for each token (say 0.03 eth)
  • Toast message to say token purchase was broadcast
  • Link to view on on etherscan
  • If the user switches their MetaMask account or logs out of MetaMask, need to refresh the page or stop/restart event listeners with new wallet address (Long Polling?)

Gratitude

Big thanks to all of the fantastic open source developers who have made this technology actual, and to Brendan Asselstine for helping kickstart my development with blockchain technologies.

Etherplate Wordmark

The Etherplate Wordmark is set in Sign Painter: https://typekit.com/fonts/signpainter

etherplate's People

Contributors

chuckbergeron avatar dfinzer avatar onlyonejmjq avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

etherplate's Issues

Compilation warnings encountered

Compilation warnings encountered:

zeppelin-solidity/contracts/token/ERC721/ERC721Token.sol:38:3: Warning: Defining constructors as functions with the same name as the contract is deprecated. Use "constructor(...) { ... }" instead.
  function ERC721Token(string _name, string _symbol) public {
  ^ (Relevant source part starts here and spans across multiple lines).

I get this error when running truffle compile

Just wanted to document this, potentially I can create a PR for it soon.

truffle compile javascript error

truffle compile

/home/sum/DEV/VehicleLog/node_modules/truffle-hdwallet-provider/node_modules/web3/lib/web3/errors.js:35
        return new Error(message);
               ^
Error: Invalid JSON RPC response: ""
    at Object.InvalidResponse (/home/sum/DEV/VehicleLog/node_modules/truffle-hdwallet-provider/node_modules/web3/lib/web3/errors.js:35:16)
    at XMLHttpRequest.request.onreadystatechange (/home/sum/DEV/VehicleLog/node_modules/truffle-hdwallet-provider/node_modules/web3/lib/web3/httpprovider.js:115:32)
    at XMLHttpRequestEventTarget.dispatchEvent (/home/sum/DEV/VehicleLog/node_modules/xhr2/lib/xhr2.js:64:18)
    at XMLHttpRequest._setReadyState (/home/sum/DEV/VehicleLog/node_modules/xhr2/lib/xhr2.js:354:12)
    at XMLHttpRequest._onHttpRequestError (/home/sum/DEV/VehicleLog/node_modules/xhr2/lib/xhr2.js:544:12)
    at ClientRequest.<anonymous> (/home/sum/DEV/VehicleLog/node_modules/xhr2/lib/xhr2.js:414:24)
    at ClientRequest.emit (events.js:182:13)
    at Socket.socketErrorListener (_http_client.js:382:9)
    at Socket.emit (events.js:182:13)
    at emitErrorNT (internal/streams/destroy.js:82:8)

`truffle unbox` throws ERR_CHILD_PROCESS_STDIO_MAXBUFFER

I've

[nft-test]$ truffle version
Truffle v4.1.13 (core: 4.1.13)
Solidity v0.4.24 (solc-js)

[nft-test]$ truffle unbox chuckbergeron/etherplate
Downloading...
Unpacking...
Setting up...
RangeError [ERR_CHILD_PROCESS_STDIO_MAXBUFFER]: stderr maxBuffer length exceeded
    at Socket.onChildStderr (child_process.js:365:14)
    at Socket.emit (events.js:189:13)
    at addChunk (_stream_readable.js:288:12)
    at readableAddChunk (_stream_readable.js:265:13)
    at Socket.Readable.push (_stream_readable.js:224:10)
    at Pipe.onStreamRead (internal/stream_base_commons.js:145:17)

ERC721

Hi,
I am new in solidity and I have checked and configure this repository in my local system but I want to know that when I create purchase or create new token, It will show token transfer from contract to my eth wallet but on
image
transaction it showing me as ERC20 NFT token so that is the confusion.
It is ERC20 NFT token or ERC721?

Thanks

MetaMask Check sometimes fails

Race condition: Sometimes we do not have the list of accounts from MetaMask on time when page loads.

Potential Fix:

Add MetaMask checks inside a window.onload function. Alternatively, try to integrate EthLawyer to see if it would be a better fit for Etherplate.

window.onload = function() { // web3 check code go here }

Module not found: Error: Can't resolve

Hi. Getting many errors with 'npm run dev' on Windows. Please help. The only thing I change for the project is modify truffle.js to use my full node on my local machine with geth, instead of infura.io, which doesn't work for me. Below is the full print out of errors

PS C:\Users\zfore\Documents\github\etherplate> npm run dev

[email protected] dev C:\Users\zfore\Documents\github\etherplate
webpack-dev-server --config webpack.dev.js --mode development

i 「wds」: Project is running at http://localhost:8080/
i 「wds」: webpack output is served from /
i 「wds」: 404s will fallback to /index.html
× 「wdm」: Hash: 7e3327a876e4e89771ee
Version: webpack 4.16.0
Time: 9911ms
Built at: 2018-07-16 00:42:06
Asset Size Chunks Chunk Names
images/button--download-metamask.png 72.7 KiB [emitted]
app.js 3.28 MiB main [emitted] main
_redirects 25 bytes [emitted]
index.html 618 bytes [emitted]
images/button--app-store.png 3.87 KiB [emitted]
images/avatar-placeholder.png 528 bytes [emitted]
images/button--play-store.png 4.2 KiB [emitted]
images/logos/etherplate-logo--red--lg.png 96.5 KiB [emitted]
app.js.map 3.48 MiB main [emitted] main
images/logos/etherplate-logo--white--lg.png 75.8 KiB [emitted]
images/placeholder.png 53.7 KiB [emitted]
images/etherplate-demo.gif 920 KiB [emitted]
images/token-images/icons-shield--1024-1024.png 95.5 KiB [emitted]
images/token-images/icons-sword--128-128.png 3.75 KiB [emitted]
images/token-images/icons-sword--1024-1024.png 53.7 KiB [emitted]
images/token-images/icons-shield--128-128.png 8.28 KiB [emitted]
Entrypoint main = app.js app.js.map
[./app/javascripts/app.js] 1.9 KiB {main} [built]
[./app/javascripts/init.jsx] 796 bytes {main} [built]
[./node_modules/@babel/polyfill/lib/index.js] 527 bytes {main} [built]
[./node_modules/@babel/polyfill/node_modules/core-js/shim.js] 7.99 KiB {main} [built]
[./node_modules/regenerator-runtime/runtime.js] 23.6 KiB {main} [built]
[./node_modules/strip-ansi/index.js] 161 bytes {main} [built]
[./node_modules/url/url.js] 22.8 KiB {main} [built]
[./node_modules/web3/index.js] 193 bytes {main} [built]
[./node_modules/webpack-dev-server/client/index.js?http://localhost:8080] (webpack)-dev-server/client?http://localhost:8080 7.75 KiB {main} [built]
[./node_modules/webpack-dev-server/client/overlay.js] (webpack)-dev-server/client/overlay.js 3.58 KiB {main} [built]
[./node_modules/webpack-dev-server/client/socket.js] (webpack)-dev-server/client/socket.js 1.05 KiB {main} [built]
[./node_modules/webpack/buildin/global.js] (webpack)/buildin/global.js 489 bytes {main} [built]
[0] multi (webpack)-dev-server/client?http://localhost:8080 @babel/polyfill ./app/javascripts/app.js 52 bytes {main} [built]
[./node_modules/webpack/hot sync ^./log$] (webpack)/hot sync nonrecursive ^./log$ 170 bytes {main} [built]
[./node_modules/webpack/hot/emitter.js] (webpack)/hot/emitter.js 77 bytes {main} [built]
+ 574 hidden modules

ERROR in ./app/javascripts/components/application/layout/header/index.jsx
Module not found: Error: Can't resolve './app/images/logos/etherplate-logo--white--lg.png' in 'C:\Users\zfore\Documents\github\etherplate\app\javascripts\components\application\layout\header'
@ ./app/javascripts/components/application/layout/header/index.jsx 16:52-112
@ ./app/javascripts/components/application/index.jsx
@ ./app/javascripts/init.jsx
@ ./app/javascripts/app.js
@ multi (webpack)-dev-server/client?http://localhost:8080 @babel/polyfill ./app/javascripts/app.js

ERROR in ./app/javascripts/components/application/token-list/token-list-item.jsx
Module not found: Error: Can't resolve './app/images/placeholder.png' in 'C:\Users\zfore\Documents\github\etherplate\app\javascripts\components\application\token-list'
@ ./app/javascripts/components/application/token-list/token-list-item.jsx 22:42-81
@ ./app/javascripts/components/application/token-list/index.jsx
@ ./app/javascripts/components/application/all-tokens.jsx
@ ./app/javascripts/components/application/index.jsx
@ ./app/javascripts/init.jsx
@ ./app/javascripts/app.js
@ multi (webpack)-dev-server/client?http://localhost:8080 @babel/polyfill ./app/javascripts/app.js

ERROR in ./app/javascripts/components/application/token/index.jsx
Module not found: Error: Can't resolve './app/javascripts/components/EtherscanButton' in 'C:\Users\zfore\Documents\github\etherplate\app\javascripts\components\application\token'
@ ./app/javascripts/components/application/token/index.jsx 22:46-101
@ ./app/javascripts/components/application/index.jsx
@ ./app/javascripts/init.jsx
@ ./app/javascripts/app.js
@ multi (webpack)-dev-server/client?http://localhost:8080 @babel/polyfill ./app/javascripts/app.js

ERROR in ./app/javascripts/components/application/token/index.jsx
Module not found: Error: Can't resolve './app/javascripts/components/address' in 'C:\Users\zfore\Documents\github\etherplate\app\javascripts\components\application\token'
@ ./app/javascripts/components/application/token/index.jsx 20:38-85
@ ./app/javascripts/components/application/index.jsx
@ ./app/javascripts/init.jsx
@ ./app/javascripts/app.js
@ multi (webpack)-dev-server/client?http://localhost:8080 @babel/polyfill ./app/javascripts/app.js

ERROR in ./app/javascripts/components/application/token-list/token-list-item.jsx
Module not found: Error: Can't resolve './app/javascripts/components/address' in 'C:\Users\zfore\Documents\github\etherplate\app\javascripts\components\application\token-list'
@ ./app/javascripts/components/application/token-list/token-list-item.jsx 16:15-62
@ ./app/javascripts/components/application/token-list/index.jsx
@ ./app/javascripts/components/application/all-tokens.jsx
@ ./app/javascripts/components/application/index.jsx
@ ./app/javascripts/init.jsx
@ ./app/javascripts/app.js
@ multi (webpack)-dev-server/client?http://localhost:8080 @babel/polyfill ./app/javascripts/app.js

ERROR in ./app/javascripts/components/application/layout/header/index.jsx
Module not found: Error: Can't resolve './app/javascripts/components/application/layout/header/NetworkInfo' in 'C:\Users\zfore\Documents\github\etherplate\app\javascripts\components\application\layout\header'
@ ./app/javascripts/components/application/layout/header/index.jsx 14:42-119
@ ./app/javascripts/components/application/index.jsx
@ ./app/javascripts/init.jsx
@ ./app/javascripts/app.js
@ multi (webpack)-dev-server/client?http://localhost:8080 @babel/polyfill ./app/javascripts/app.js

ERROR in ./app/javascripts/components/application/customize-token/index.jsx
Module not found: Error: Can't resolve './app/javascripts/components/ether' in 'C:\Users\zfore\Documents\github\etherplate\app\javascripts\components\application\customize-token'
@ ./app/javascripts/components/application/customize-token/index.jsx 26:36-81
@ ./app/javascripts/components/application/index.jsx
@ ./app/javascripts/init.jsx
@ ./app/javascripts/app.js
@ multi (webpack)-dev-server/client?http://localhost:8080 @babel/polyfill ./app/javascripts/app.js

ERROR in ./app/javascripts/components/application/landing.jsx
Module not found: Error: Can't resolve './app/javascripts/components/hero' in 'C:\Users\zfore\Documents\github\etherplate\app\javascripts\components\application'
@ ./app/javascripts/components/application/landing.jsx 12:35-79
@ ./app/javascripts/components/application/index.jsx
@ ./app/javascripts/init.jsx
@ ./app/javascripts/app.js
@ multi (webpack)-dev-server/client?http://localhost:8080 @babel/polyfill ./app/javascripts/app.js

ERROR in ./app/javascripts/components/application/not-found/index.jsx
Module not found: Error: Can't resolve './app/javascripts/components/hero' in 'C:\Users\zfore\Documents\github\etherplate\app\javascripts\components\application\not-found'
@ ./app/javascripts/components/application/not-found/index.jsx 10:35-79
@ ./app/javascripts/components/application/index.jsx
@ ./app/javascripts/init.jsx
@ ./app/javascripts/app.js
@ multi (webpack)-dev-server/client?http://localhost:8080 @babel/polyfill ./app/javascripts/app.js

ERROR in ./app/javascripts/components/application/purchase-history/index.jsx
Module not found: Error: Can't resolve './app/javascripts/components/hero' in 'C:\Users\zfore\Documents\github\etherplate\app\javascripts\components\application\purchase-history'
@ ./app/javascripts/components/application/purchase-history/index.jsx 16:35-79
@ ./app/javascripts/components/application/index.jsx
@ ./app/javascripts/init.jsx
@ ./app/javascripts/app.js
@ multi (webpack)-dev-server/client?http://localhost:8080 @babel/polyfill ./app/javascripts/app.js

ERROR in ./app/javascripts/components/application/token-list/index.jsx
Module not found: Error: Can't resolve './app/javascripts/components/hero' in 'C:\Users\zfore\Documents\github\etherplate\app\javascripts\components\application\token-list'
@ ./app/javascripts/components/application/token-list/index.jsx 14:35-79
@ ./app/javascripts/components/application/all-tokens.jsx
@ ./app/javascripts/components/application/index.jsx
@ ./app/javascripts/init.jsx
@ ./app/javascripts/app.js
@ multi (webpack)-dev-server/client?http://localhost:8080 @babel/polyfill ./app/javascripts/app.js

ERROR in ./app/javascripts/components/application/token-list/token-list-item.jsx
Module not found: Error: Can't resolve './app/javascripts/components/loading' in 'C:\Users\zfore\Documents\github\etherplate\app\javascripts\components\application\token-list'
@ ./app/javascripts/components/application/token-list/token-list-item.jsx 14:38-85
@ ./app/javascripts/components/application/token-list/index.jsx
@ ./app/javascripts/components/application/all-tokens.jsx
@ ./app/javascripts/components/application/index.jsx
@ ./app/javascripts/init.jsx
@ ./app/javascripts/app.js
@ multi (webpack)-dev-server/client?http://localhost:8080 @babel/polyfill ./app/javascripts/app.js

ERROR in ./app/javascripts/components/application/index.jsx
Module not found: Error: Can't resolve './app/javascripts/components/web3Wrap' in 'C:\Users\zfore\Documents\github\etherplate\app\javascripts\components\application'
@ ./app/javascripts/components/application/index.jsx 24:39-87
@ ./app/javascripts/init.jsx
@ ./app/javascripts/app.js
@ multi (webpack)-dev-server/client?http://localhost:8080 @babel/polyfill ./app/javascripts/app.js

ERROR in ./app/javascripts/components/application/index.jsx
Module not found: Error: Can't resolve './app/javascripts/contracts/nfTokenFactory' in 'C:\Users\zfore\Documents\github\etherplate\app\javascripts\components\application'
@ ./app/javascripts/components/application/index.jsx 22:45-98
@ ./app/javascripts/init.jsx
@ ./app/javascripts/app.js
@ multi (webpack)-dev-server/client?http://localhost:8080 @babel/polyfill ./app/javascripts/app.js

ERROR in ./app/javascripts/components/application/customize-token/index.jsx
Module not found: Error: Can't resolve './app/javascripts/contracts/nfTokenFactory' in 'C:\Users\zfore\Documents\github\etherplate\app\javascripts\components\application\customize-token'
@ ./app/javascripts/components/application/customize-token/index.jsx 20:45-98
@ ./app/javascripts/components/application/index.jsx
@ ./app/javascripts/init.jsx
@ ./app/javascripts/app.js
@ multi (webpack)-dev-server/client?http://localhost:8080 @babel/polyfill ./app/javascripts/app.js

ERROR in ./app/javascripts/components/application/purchase-history/index.jsx
Module not found: Error: Can't resolve './app/javascripts/contracts/nfTokenFactory' in 'C:\Users\zfore\Documents\github\etherplate\app\javascripts\components\application\purchase-history'
@ ./app/javascripts/components/application/purchase-history/index.jsx 12:45-98
@ ./app/javascripts/components/application/index.jsx
@ ./app/javascripts/init.jsx
@ ./app/javascripts/app.js
@ multi (webpack)-dev-server/client?http://localhost:8080 @babel/polyfill ./app/javascripts/app.js

ERROR in ./app/javascripts/components/application/index.jsx
Module not found: Error: Can't resolve './app/javascripts/redux/actions' in 'C:\Users\zfore\Documents\github\etherplate\app\javascripts\components\application'
@ ./app/javascripts/components/application/index.jsx 18:15-57
@ ./app/javascripts/init.jsx
@ ./app/javascripts/app.js
@ multi (webpack)-dev-server/client?http://localhost:8080 @babel/polyfill ./app/javascripts/app.js

ERROR in ./app/javascripts/components/application/customize-token/index.jsx
Module not found: Error: Can't resolve './app/javascripts/redux/actions' in 'C:\Users\zfore\Documents\github\etherplate\app\javascripts\components\application\customize-token'
@ ./app/javascripts/components/application/customize-token/index.jsx 22:15-57
@ ./app/javascripts/components/application/index.jsx
@ ./app/javascripts/init.jsx
@ ./app/javascripts/app.js
@ multi (webpack)-dev-server/client?http://localhost:8080 @babel/polyfill ./app/javascripts/app.js

ERROR in ./app/javascripts/components/application/index.jsx
Module not found: Error: Can't resolve './app/javascripts/redux/reducers' in 'C:\Users\zfore\Documents\github\etherplate\app\javascripts\components\application'
@ ./app/javascripts/components/application/index.jsx 20:16-59
@ ./app/javascripts/init.jsx
@ ./app/javascripts/app.js
@ multi (webpack)-dev-server/client?http://localhost:8080 @babel/polyfill ./app/javascripts/app.js

ERROR in ./app/javascripts/components/application/purchase-history/token-row.jsx
Module not found: Error: Can't resolve './app/javascripts/services/get-token' in 'C:\Users\zfore\Documents\github\etherplate\app\javascripts\components\application\purchase-history'
@ ./app/javascripts/components/application/purchase-history/token-row.jsx 14:39-86
@ ./app/javascripts/components/application/purchase-history/index.jsx
@ ./app/javascripts/components/application/index.jsx
@ ./app/javascripts/init.jsx
@ ./app/javascripts/app.js
@ multi (webpack)-dev-server/client?http://localhost:8080 @babel/polyfill ./app/javascripts/app.js

ERROR in ./app/javascripts/components/application/token/index.jsx
Module not found: Error: Can't resolve './app/javascripts/services/get-token' in 'C:\Users\zfore\Documents\github\etherplate\app\javascripts\components\application\token'
@ ./app/javascripts/components/application/token/index.jsx 26:39-86
@ ./app/javascripts/components/application/index.jsx
@ ./app/javascripts/init.jsx
@ ./app/javascripts/app.js
@ multi (webpack)-dev-server/client?http://localhost:8080 @babel/polyfill ./app/javascripts/app.js

ERROR in ./app/javascripts/components/application/token-list/token-list-item.jsx
Module not found: Error: Can't resolve './app/javascripts/services/get-token' in 'C:\Users\zfore\Documents\github\etherplate\app\javascripts\components\application\token-list'
@ ./app/javascripts/components/application/token-list/token-list-item.jsx 20:39-86
@ ./app/javascripts/components/application/token-list/index.jsx
@ ./app/javascripts/components/application/all-tokens.jsx
@ ./app/javascripts/components/application/index.jsx
@ ./app/javascripts/init.jsx
@ ./app/javascripts/app.js
@ multi (webpack)-dev-server/client?http://localhost:8080 @babel/polyfill ./app/javascripts/app.js

ERROR in ./app/javascripts/components/application/customize-token/index.jsx
Module not found: Error: Can't resolve './app/javascripts/services/nfToken-type-image-url' in 'C:\Users\zfore\Documents\github\etherplate\app\javascripts\components\application\customize-token'
@ ./app/javascripts/components/application/customize-token/index.jsx 28:50-110
@ ./app/javascripts/components/application/index.jsx
@ ./app/javascripts/init.jsx
@ ./app/javascripts/app.js
@ multi (webpack)-dev-server/client?http://localhost:8080 @babel/polyfill ./app/javascripts/app.js

ERROR in ./app/javascripts/components/application/purchase-history/token-row.jsx
Module not found: Error: Can't resolve './app/javascripts/services/nfToken-type-image-url' in 'C:\Users\zfore\Documents\github\etherplate\app\javascripts\components\application\purchase-history'
@ ./app/javascripts/components/application/purchase-history/token-row.jsx 16:50-110
@ ./app/javascripts/components/application/purchase-history/index.jsx
@ ./app/javascripts/components/application/index.jsx
@ ./app/javascripts/init.jsx
@ ./app/javascripts/app.js
@ multi (webpack)-dev-server/client?http://localhost:8080 @babel/polyfill ./app/javascripts/app.js

ERROR in ./app/javascripts/components/application/token/index.jsx
Module not found: Error: Can't resolve './app/javascripts/services/nfToken-type-image-url' in 'C:\Users\zfore\Documents\github\etherplate\app\javascripts\components\application\token'
@ ./app/javascripts/components/application/token/index.jsx 24:50-110
@ ./app/javascripts/components/application/index.jsx
@ ./app/javascripts/init.jsx
@ ./app/javascripts/app.js
@ multi (webpack)-dev-server/client?http://localhost:8080 @babel/polyfill ./app/javascripts/app.js

ERROR in ./app/javascripts/components/application/token-list/token-list-item.jsx
Module not found: Error: Can't resolve './app/javascripts/services/nfToken-type-image-url' in 'C:\Users\zfore\Documents\github\etherplate\app\javascripts\components\application\token-list'
@ ./app/javascripts/components/application/token-list/token-list-item.jsx 18:50-110
@ ./app/javascripts/components/application/token-list/index.jsx
@ ./app/javascripts/components/application/all-tokens.jsx
@ ./app/javascripts/components/application/index.jsx
@ ./app/javascripts/init.jsx
@ ./app/javascripts/app.js
@ multi (webpack)-dev-server/client?http://localhost:8080 @babel/polyfill ./app/javascripts/app.js
i 「wdm」: Failed to compile.

Compilation error

Hi checked out the code and updated to "@openzeppelin/contracts": "^2.5.0",
I get the below compilation error

/etherplate/contracts/NFToken.sol:47:21: DeclarationError: Undeclared identifier.
uint256 index = allTokens.length + 1;
^-------^
/etherplate/contracts/NFToken.sol:68:12: DeclarationError: Undeclared identifier.
return ownedTokens[msg.sender];
^---------^

Compilation failed. See above.
Truffle v5.1.35 (core: 5.1.35)
Node v8.11.3

React errors?

Preface, I'm super new to react/redux so this might be very easy. When I run npm run dev I get 50+ of these types of errors. Any ideas?

ERROR in ./app/javascripts/components/application/layout/header/index.jsx
Module not found: Error: Can't resolve './app/images/logos/etherplate-logo--white--lg.png' in 'C:\Users\github\etherplate\app\javascripts\components\application\layout\header'
@ ./app/javascripts/components/application/layout/header/index.jsx 16:52-112
@ ./app/javascripts/components/application/index.jsx
@ ./app/javascripts/init.jsx
@ ./app/javascripts/app.js
@ multi (webpack)-dev-server/client?http://localhost:8080 @babel/polyfill ./app/javascripts/app.js

ERROR in ./app/javascripts/components/application/token-list/token-list-item.jsx
Module not found: Error: Can't resolve './app/images/placeholder.png' in 'C:\Users\github\etherplate\app\javascripts\components\application\token-list'
@ ./app/javascripts/components/application/token-list/token-list-item.jsx 22:42-81
@ ./app/javascripts/components/application/token-list/index.jsx
@ ./app/javascripts/components/application/all-tokens.jsx
@ ./app/javascripts/components/application/index.jsx
@ ./app/javascripts/init.jsx
@ ./app/javascripts/app.js
@ multi (webpack)-dev-server/client?http://localhost:8080 @babel/polyfill ./app/javascripts/app.js

ERROR in ./app/javascripts/components/application/token/index.jsx
Module not found: Error: Can't resolve './app/javascripts/components/EtherscanButton' in 'C:\Users\github\etherplate\app\javascripts\components\application\token'
@ ./app/javascripts/components/application/token/index.jsx 22:46-101
@ ./app/javascripts/components/application/index.jsx
@ ./app/javascripts/init.jsx
@ ./app/javascripts/app.js
@ multi (webpack)-dev-server/client?http://localhost:8080 @babel/polyfill ./app/javascripts/app.js

running truffle compile throws error

when running truffle compile i get an error:

~/P/b/e/etherplate ❯❯❯ truffle compile                                                                                                                                                               master

/Users/brian/Public/blockchain/explorer/etherplate/node_modules/truffle-hdwallet-provider/node_modules/web3/lib/web3/errors.js:35
        return new Error(message);
               ^
Error: Invalid JSON RPC response: ""
    at Object.InvalidResponse (/Users/brian/Public/blockchain/explorer/etherplate/node_modules/truffle-hdwallet-provider/node_modules/web3/lib/web3/errors.js:35:16)
    at XMLHttpRequest.request.onreadystatechange (/Users/brian/Public/blockchain/explorer/etherplate/node_modules/truffle-hdwallet-provider/node_modules/web3/lib/web3/httpprovider.js:115:32)
    at XMLHttpRequestEventTarget.dispatchEvent (/Users/brian/Public/blockchain/explorer/etherplate/node_modules/xhr2/lib/xhr2.js:64:18)
    at XMLHttpRequest._setReadyState (/Users/brian/Public/blockchain/explorer/etherplate/node_modules/xhr2/lib/xhr2.js:354:12)
    at XMLHttpRequest._onHttpRequestError (/Users/brian/Public/blockchain/explorer/etherplate/node_modules/xhr2/lib/xhr2.js:544:12)
    at ClientRequest.<anonymous> (/Users/brian/Public/blockchain/explorer/etherplate/node_modules/xhr2/lib/xhr2.js:414:24)
    at emitOne (events.js:115:13)
    at ClientRequest.emit (events.js:210:7)
    at Socket.socketErrorListener (_http_client.js:401:9)
    at emitOne (events.js:115:13)

do you know what's going wrong? thanks in advance for your help!

/.node-gyp/10.2.0/include/node/node.h:53:10: fatal error: 'core.h' file not found

unable to install node modules

~/P/b/etherplate ❯❯❯ npm i                                                                                                                                                                         ⏎ master

> [email protected] preinstall /Users/brian/Public/blockchain/etherplate/node_modules/scrypt
> node node-scrypt-preinstall.js


> [email protected] install /Users/brian/Public/blockchain/etherplate/node_modules/scrypt
> node-gyp rebuild

  SOLINK_MODULE(target) Release/copied_files.node
  CC(target) Release/obj.target/scrypt_wrapper/src/util/memlimit.o
  CC(target) Release/obj.target/scrypt_wrapper/src/scryptwrapper/keyderivation.o
  CC(target) Release/obj.target/scrypt_wrapper/src/scryptwrapper/pickparams.o
  CC(target) Release/obj.target/scrypt_wrapper/src/scryptwrapper/hash.o
  LIBTOOL-STATIC Release/scrypt_wrapper.a
  CC(target) Release/obj.target/scrypt_lib/scrypt/scrypt-1.2.0/lib/crypto/crypto_scrypt.o
  CC(target) Release/obj.target/scrypt_lib/scrypt/scrypt-1.2.0/lib/crypto/crypto_scrypt_smix.o
  CC(target) Release/obj.target/scrypt_lib/scrypt/scrypt-1.2.0/libcperciva/util/warnp.o
  CC(target) Release/obj.target/scrypt_lib/scrypt/scrypt-1.2.0/libcperciva/alg/sha256.o
  CC(target) Release/obj.target/scrypt_lib/scrypt/scrypt-1.2.0/libcperciva/util/insecure_memzero.o
  CC(target) Release/obj.target/scrypt_lib/scrypt/scrypt-1.2.0/lib/scryptenc/scryptenc_cpuperf.o
  LIBTOOL-STATIC Release/scrypt_lib.a
  CXX(target) Release/obj.target/scrypt/src/node-boilerplate/scrypt_common.o
In file included from ../src/node-boilerplate/scrypt_common.cc:28:
In file included from ../../nan/nan.h:51:
/Users/brian/.node-gyp/10.2.0/include/node/node.h:53:10: fatal error: 'core.h' file not found
#include "core.h"  // NOLINT(build/include_order)
         ^~~~~~~~
1 error generated.
make: *** [Release/obj.target/scrypt/src/node-boilerplate/scrypt_common.o] Error 1
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/Users/brian/.nvm/versions/node/v10.2.0/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:258:23)
gyp ERR! stack     at ChildProcess.emit (events.js:182:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:237:12)
gyp ERR! System Darwin 17.5.0
gyp ERR! command "/Users/brian/.nvm/versions/node/v10.2.0/bin/node" "/Users/brian/.nvm/versions/node/v10.2.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/brian/Public/blockchain/etherplate/node_modules/scrypt
gyp ERR! node -v v10.2.0
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/brian/.npm/_logs/2018-05-29T23_53_00_165Z-debug.log

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.