Ethereum Boilerplate Questions

Thanks. Where is the code for the smart contracts?

in the truffle folder

Thank you.

Now I am getting this error:

Error: A cross-origin error was thrown. React doesnā€™t have access to the actual error object in development. See https://reactjs.org/link/crossorigin-error for more information.

:arrow_forward: 13 stack frames were collapsed.

Module.

C:/Users/yonat/Downloads/ethereum-nft-marketplace-boilerplate-main/ethereum-nft-marketplace-boilerplate-main/src/index.js:33

  30 |   }  31 | };  32 | > 33 | ReactDOM.render(  34 |   // <React.StrictMode>  35 |   <Application />,  36 |   // </React.StrictMode>,

View compiled

Moduleā€¦/src/index.js

http://localhost:3000/static/js/main.chunk.js:5728:30

webpack_require

C:/Users/yonat/Downloads/ethereum-nft-marketplace-boilerplate-main/ethereum-nft-marketplace-boilerplate-main/webpack/bootstrap:851

  848 |   849 | __webpack_require__.$Refresh$.init();  850 | try {> 851 | 	modules[moduleId].call(module.exports, module, module.exports, hotCreateRequire(moduleId));      | ^  852 | } finally {  853 | 	__webpack_require__.$Refresh$.cleanup(moduleId);  854 | }

View compiled

fn

C:/Users/yonat/Downloads/ethereum-nft-marketplace-boilerplate-main/ethereum-nft-marketplace-boilerplate-main/webpack/bootstrap:150

  147 | 		);  148 | 		hotCurrentParents = [];  149 | 	}> 150 | 	return __webpack_require__(request);      | ^  151 | };  152 | var ObjectFactory = function ObjectFactory(name) {  153 | 	return {

View compiled

1

http://localhost:3000/static/js/main.chunk.js:6254:18

webpack_require

C:/Users/yonat/Downloads/ethereum-nft-marketplace-boilerplate-main/ethereum-nft-marketplace-boilerplate-main/webpack/bootstrap:851

  848 |   849 | __webpack_require__.$Refresh$.init();  850 | try {> 851 | 	modules[moduleId].call(module.exports, module, module.exports, hotCreateRequire(moduleId));      | ^  852 | } finally {  853 | 	__webpack_require__.$Refresh$.cleanup(moduleId);  854 | }

View compiled

checkDeferredModules

C:/Users/yonat/Downloads/ethereum-nft-marketplace-boilerplate-main/ethereum-nft-marketplace-boilerplate-main/webpack/bootstrap:45

  42 | 	}  43 | 	if(fulfilled) {  44 | 		deferredModules.splice(i--, 1);> 45 | 		result = __webpack_require__(__webpack_require__.s = deferredModule[0]);     | ^  46 | 	}  47 | }  48 | 

View compiled

Array.webpackJsonpCallback [as push]

C:/Users/yonat/Downloads/ethereum-nft-marketplace-boilerplate-main/ethereum-nft-marketplace-boilerplate-main/webpack/bootstrap:32

  29 | 	deferredModules.push.apply(deferredModules, executeModules || []);  30 |   31 | 	// run deferred modules when all chunks ready> 32 | 	return checkDeferredModules();     | ^  33 | };  34 | function checkDeferredModules() {  35 | 	var result;

View compiled

(anonymous function)

http://localhost:3000/static/js/main.chunk.js:1:93

Help please, i added uniswapv3core and periphery to the boilerplate and i tried yarn start but iā€™m prompt to install typescript. should i go on?

Hi @mejmerlin

You can install typescript, but you also should allow js, jsx in the typescript config. So your tsconfig.json will be like this:

{
  "compilerOptions": {
    "allowJs": true,
    "jsx": "react-jsx",
     // other settings
  },
}

Hi @John

You should ask questions about nft-marketplace here: https://forum.moralis.io/t/cloning-opensea-nft-boilerplate-questions

Please follow the quickstart steps. You need to add your contract ABI and contract address like this:

const [contractABI, setContractABI] = useState([abi: "abi"]);
const [marketAddress, setMarketAddress] = useState("0x12...ssdgf");

Hi!
is it possible to upload this to my own hosting and domain?
Thx!

Hi @Baldal

Yes, you can upload it to your own hosting. Itā€™s better to find instructions how to upload app on your hosting site

localhost works perfectly. So isnā€™t it all I have to do to put the files in storage? will it work that way?

Hello @Baldal yes it is, but keep in mind you need to host the production version of your app by running npm run build or yarn build and run the build version instead of the dev version you use in npm run start or yarn start.

Hi guys,
The setup Moralis/Ganache/Boilerplate works in the background (I can do contracts through terminal) but I have issues with the Boilerplate. see attached
Metamask is connected.
When I use the local chain ā€˜Token Balancesā€™ doesnā€™t have a table and with the Ethereum network it does show a table but without any tokens.
Any help is appreciated.

Seems a chain reference is missing on the local network. Any idea what the chain reference must be and where to set in the VS code project?
Screenshot 3

Has the instructions been created? It would be great if this was a YouTube training like your others!

I would also like to know the answer to this. Please help :slight_smile:

What is the status of this? Thank you!

Hi @cstanleyhns @BooneBergsma

Please update your boilerplate version and follow instructions https://github.com/ethereum-boilerplate/ethereum-boilerplate/blob/main/README.md#dex-

For example you can create an object customTokens in App.jsx with custom tokens and provide them as props to <DEX customTokens={customTokens} /> component

1 Like

I believe today/tomorrow this feature will be finally released :raised_hands:

1 Like

Great questions! I am learning JS and Solidity now and coming from a WordPress background. I am trying think about how to reverse engineer the boilerplate for WP. The Moralis DAO should really be thinking about how they can make it easy for one of the largest pool of developers to take part in Web3 by making a WordPress plugin or template. And would also love to see it work well with Elementor. You would see massive growth in your platform if you empower the WP community to build on web3.0

I created my own using this boilerplate and start testing.

I found two bugs.

  1. In DEX, I canā€™t change ETH to something else, but ok on the 2nd option selecting other token. Same issue when I choose BNC or Polygon, canā€™t choose other token.
    2ā€¦ I logged successfully using Metamask. When I tried to logout to use other eth account, I have no way of changing it.

Let me know how to fix it.
Thank you.

Hi @Hacker

This bug was fixed on the latest version. Pull the latest version or you can fix it yourself: ethereum-boilerplate\src\components\DEX\DEX.jsx. Change the code in the useEffect hook on 125th line to:

 useEffect(() => {
    if (!tokens || fromToken) return null;
    setFromToken(tokens[nativeAddress]);
  }, [tokens, fromToken]);

Hello @Yomoo
I have the new install.

I will try your recommendation and let you know.