Moralis Upgradeable Smart Contract Tutorial

This is a thread to discuss the Moralis Upgradeable Smart Contract Repository (https://github.com/YosephKS/moralis-upgradeable-smart-contracts) we covered on YouTube.

We are here to help! If you have any questions about how to use it or how to set it up you can ask here!

2 Likes

110 vulnerabilities (95 moderate, 13 high, 2 critical)

To address issues that do not require attention, run:
npm audit fix

To address all issues possible (including breaking changes), run:
npm audit fix --force

Some issues need review, and may require choosing
a different dependency.

Run npm audit for details.
[email protected] moralis-upgradeable-smart-contracts % https://4veo0yvrjsbj.usemoralis.com:2053/server

And whats your question?

1 Like

yes what’s the issue?

im not sure what the problem is new to coding

when i try to go to the URL is does not load says {“error”:“unauthorized”}

which url exactly are you going to?

Hi @YosephKS,

I have cloned the starter version,
setup a Moralis testnet server (Ropsten, Polygon, BSC, Avax),
copied the .env file with the server appID and serverUrl and commented the other lines,
created the truffle/.secret file with the words of my Metamask,
copied the truffle/.env file with the speedy nodes key, others as is,
in root folder: “yarn” to get the dependices (node_modules folder)
in truffle folder: “yarn” to get dependices here
then “yarn compile” -> succesfull
then “yarn test” -> failed…
afbeelding

Did also a: “truffle compile --all” -> successfull
But “truffle test” -> fails…

How to solve?

Compiled successfully!

You can now view ethereum-boilerplate in the browser.

Local: http://localhost:3000
On Your Network: http://192.168.1.6:3000

Note that the development build is not optimized.
To create a production build, use npm run build.

npm run build

1 Like

ahhh I bumped into that problem actually in the video, what I do is delete all the ABIs in src/contracts folder and recompile everything from scratch and should be good :raised_hands:

niceee awesome :star_struck:

Hi,

ok, clear, thank you!
Works…
afbeelding

1 Like

Im not seeing anything on the local host

the local host :3000

hmmm :eyes:just all white screen? did you see any error from the console?

yes just a white screen
my apologies im a total noob to VScode can you help me identify the console?
Im more familure with Sublime text
I dont think i got any errors

console is not in the VSCode, go to your browser again and right click -> Inspect, and then a sidebar or something like that should appear and there and you can choose the console tab to check

1 Like

did you add your app id and server url yet? based on your error there you haven’t

i did edit the .env example file and add them

REACT_APP_MORALIS_APPLICATION_ID=yfiZZBLYCbuofCXntfT1f9MbQSjgDyX7cTu0YGkD
REACT_APP_MORALIS_SERVER_URL=https://4veo0yvrjsbj.usemoralis.com:2053/server

Optional info for connecting your localChain and Moralis Database

moralisApiKey =
moralisApiSecret = yfiZZBLYCbuofCXntfT1f9MbQSjgDyX7cTu0YGkD
frpcPath = F:\frpc\frpc.exe
chain = ganache
moralisSubdomain = https://4veo0yvrjsbj.usemoralis.com:2053/server.usemoralis.com
abiPath = “F:\ethereum-boilerplate\Truffle\build\contracts\Contract.json”

ohhh .env.example is just the example, you should copy and rename it as .env