Skip to content

Commit

Permalink
Updated
Browse files Browse the repository at this point in the history
  • Loading branch information
Luca Pierpaoli committed Mar 23, 2023
1 parent 8182d8f commit 19634c2
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 40 deletions.
59 changes: 32 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,20 @@ In case of issues, use the following temporary address

Crazy Map is a smart contract for storing geolocation data of CrazyFury NFT community members into the ethereum blockchain.


## 🖇️ Mainnet smart contract references

```
Official Crazy Fury
0x04047358179df7FE24E578219336212346dF1C07
Crazy Map proxy contract
0x6ADa73e6192a40922E926595539D768C983B836A
Implementation
0x49621bE3d006f1AE3C2B27482a9216B11bbDCb66
```

## ✨ Dependency libraries

- defi-wonderland/smock for mocking and faking
Expand All @@ -32,9 +46,23 @@ npx hardhat test .\test\crazymap.js

> **Caveat** : Mock/Fake library used works on hardhat network only.
## 🤖 Run the webapp locally using Test network (Sepolia)

> For the current version, smart contract addresses are set into App.js page. Check variables before running the frontend, in order to user the right smart contract addresses based on the chain (mainnet|sepolia).
```
//from app.js
## 🤖 Run the webapp locally
// SET THE CRAZY MAP ADDRESS U WANT TO TEST
// mainnet or sepolia
const contractAddress = "";
// SET THE CRAZY FURY ADDRESS U WANT TO TEST
// real (mainnet) or the testing one (sepolia)
const crazyFuryAddress = "";
```


Then run these commands
```
cd app
npm restore
Expand All @@ -54,8 +82,8 @@ For doing that :
1. **Create ```.env``` file in the project root and set environment variables as below**

```
ALCHEMY_GOERLI_URL=YOUR_ALCHEMY_APP_URL
GOERLI_PRIVATE_KEY=YOUR ACCOUNT_PRIVATE_KEY
ALCHEMY_SEPOLIA_URL=YOUR_ALCHEMY_APP_URL
SEPOLIA_PRIVATE_KEY=YOUR ACCOUNT_PRIVATE_KEY
```
> Create your app on [Alchemy](http://www.alchemy.com) if you don't already have one.
Expand All @@ -69,7 +97,7 @@ For doing that :
4. **Run the script:**
```npx hardhat run .\scripts\Demo\mint-fake-crazyfury-nft.js --network goerli ```
```npx hardhat run .\scripts\Demo\mint-fake-crazyfury-nft.js --network sepolia ```
### 🏠 **Add your home base**
A **Crazy Map member** is someone who have added his location and only **Crazy Map members** can see others members' locations on the map.
Expand All @@ -93,29 +121,6 @@ Crazy Map smart contract has a dependency with Crazy Fury ERC721 smart contract,
For testing purpose a fake ERC721 called [MyFakeCrazyFuryNFT.sol](/contracts/MyFakeCrazyFuryNFT.sol) has been created in order to simulate the mainnet behaviour.
## 🖇️ Goerli smart contract references
```
Crazy Fury fake contract:
0xC2Dddd7241a7C258c25a594007B6BB0F03207DF4

Crazy Map proxy contract:
0x9DdA4Fff341778C5E063Bed36FE15fBA28ada758
```
## 🖇️ Mainnet smart contract references
```
Crazy Fury contract:
0x04047358179df7FE24E578219336212346dF1C07

Crazy Map proxy contract:
0x6ADa73e6192a40922E926595539D768C983B836A

Implementation
0x49621bE3d006f1AE3C2B27482a9216B11bbDCb66
```
## 🖇️ Sepolia smart contract references
Expand Down
28 changes: 21 additions & 7 deletions app/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"@types/node": "^18.14.2",
"@types/react": "^18.0.28",
"@types/react-dom": "^18.0.11",
"dotenv": "^16.0.3",
"ethers": "^5.6.8",
"latlon-geohash": "^2.0.0",
"leaflet": "^1.9.3",
Expand Down Expand Up @@ -49,4 +50,4 @@
"last 1 safari version"
]
}
}
}
5 changes: 1 addition & 4 deletions app/src/App/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { faWarning } from "@fortawesome/free-solid-svg-icons";
import LogoTitle from "../assets/Logo.jpg";
import MadeFooter from "../assets/made footer.jpg";
//import LogoMap from "../assets/image 1logo.svg";



export default function App() {
/*
Expand Down Expand Up @@ -144,7 +141,7 @@ export default function App() {
const getLocationByAddress = async () => {
try {
const { ethereum } = window;

if (ethereum) {
const accounts = await ethereum.request({ method: "eth_accounts" });
const account = accounts[0];
Expand Down
2 changes: 1 addition & 1 deletion scripts/Demo/mint-fake-crazyfury-nft.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ async function main() {
//----------------------------------
//REPLACE THIS BEFORE RUN
//----------------------------------
const myAddress = "0x69FCf3F6B6722a6513cDfF45CC3996587572f7Db";
const myAddress = "SET YOUR ADDRESS BEFORE RUN";


//----------------------------------
Expand Down

0 comments on commit 19634c2

Please sign in to comment.