Skip to content

Commit

Permalink
Updated with optz and mainnet
Browse files Browse the repository at this point in the history
  • Loading branch information
Luca Pierpaoli committed Mar 21, 2023
1 parent ddecbf8 commit ad8726f
Show file tree
Hide file tree
Showing 8 changed files with 208 additions and 105 deletions.
180 changes: 180 additions & 0 deletions .openzeppelin/mainnet.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,180 @@
{
"manifestVersion": "3.2",
"admin": {
"address": "0x52D386E89E62Bf9F67126b94D730583f46D99466",
"txHash": "0x5b515f7c8babbf55ef4fccc032849c94dc3cc5e78f2b6ed0548170724bd3355e"
},
"proxies": [
{
"address": "0x6ADa73e6192a40922E926595539D768C983B836A",
"txHash": "0x6142870ca440f8e5babac80ac0d2699c6b92d131681e93882abf04eb2bfa612d",
"kind": "transparent"
}
],
"impls": {
"588042391d19db2c3b7e01bdcb9de401f473babc09b9bad6cd300d95ea5eef07": {
"address": "0x49621bE3d006f1AE3C2B27482a9216B11bbDCb66",
"txHash": "0x5af9289df747f7ab923ef15f0f17018c7a71cfdacbd64caa7f46624e0e49f827",
"layout": {
"solcVersion": "0.8.17",
"storage": [
{
"label": "_initialized",
"offset": 0,
"slot": "0",
"type": "t_uint8",
"contract": "Initializable",
"src": "@openzeppelin\\contracts-upgradeable\\proxy\\utils\\Initializable.sol:62",
"retypedFrom": "bool"
},
{
"label": "_initializing",
"offset": 1,
"slot": "0",
"type": "t_bool",
"contract": "Initializable",
"src": "@openzeppelin\\contracts-upgradeable\\proxy\\utils\\Initializable.sol:67"
},
{
"label": "__gap",
"offset": 0,
"slot": "1",
"type": "t_array(t_uint256)50_storage",
"contract": "ContextUpgradeable",
"src": "@openzeppelin\\contracts-upgradeable\\utils\\ContextUpgradeable.sol:36"
},
{
"label": "_owner",
"offset": 0,
"slot": "51",
"type": "t_address",
"contract": "OwnableUpgradeable",
"src": "@openzeppelin\\contracts-upgradeable\\access\\OwnableUpgradeable.sol:22"
},
{
"label": "__gap",
"offset": 0,
"slot": "52",
"type": "t_array(t_uint256)49_storage",
"contract": "OwnableUpgradeable",
"src": "@openzeppelin\\contracts-upgradeable\\access\\OwnableUpgradeable.sol:94"
},
{
"label": "_paused",
"offset": 0,
"slot": "101",
"type": "t_bool",
"contract": "PausableUpgradeable",
"src": "@openzeppelin\\contracts-upgradeable\\security\\PausableUpgradeable.sol:29"
},
{
"label": "__gap",
"offset": 0,
"slot": "102",
"type": "t_array(t_uint256)49_storage",
"contract": "PausableUpgradeable",
"src": "@openzeppelin\\contracts-upgradeable\\security\\PausableUpgradeable.sol:116"
},
{
"label": "cfContractAdr",
"offset": 0,
"slot": "151",
"type": "t_address",
"contract": "CrazyMap",
"src": "contracts\\CrazyMap.sol:14"
},
{
"label": "cfLocationsMap",
"offset": 0,
"slot": "152",
"type": "t_mapping(t_address,t_struct(CFLocation)781_storage)",
"contract": "CrazyMap",
"src": "contracts\\CrazyMap.sol:32"
},
{
"label": "inserted",
"offset": 0,
"slot": "153",
"type": "t_mapping(t_address,t_bool)",
"contract": "CrazyMap",
"src": "contracts\\CrazyMap.sol:34"
},
{
"label": "cfAddresses",
"offset": 0,
"slot": "154",
"type": "t_array(t_address)dyn_storage",
"contract": "CrazyMap",
"src": "contracts\\CrazyMap.sol:37"
}
],
"types": {
"t_address": {
"label": "address",
"numberOfBytes": "20"
},
"t_array(t_address)dyn_storage": {
"label": "address[]",
"numberOfBytes": "32"
},
"t_array(t_uint256)49_storage": {
"label": "uint256[49]",
"numberOfBytes": "1568"
},
"t_array(t_uint256)50_storage": {
"label": "uint256[50]",
"numberOfBytes": "1600"
},
"t_bool": {
"label": "bool",
"numberOfBytes": "1"
},
"t_mapping(t_address,t_bool)": {
"label": "mapping(address => bool)",
"numberOfBytes": "32"
},
"t_mapping(t_address,t_struct(CFLocation)781_storage)": {
"label": "mapping(address => struct CrazyMap.CFLocation)",
"numberOfBytes": "32"
},
"t_string_storage": {
"label": "string",
"numberOfBytes": "32"
},
"t_struct(CFLocation)781_storage": {
"label": "struct CrazyMap.CFLocation",
"members": [
{
"label": "discordName",
"type": "t_string_storage",
"offset": 0,
"slot": "0"
},
{
"label": "geohash",
"type": "t_string_storage",
"offset": 0,
"slot": "1"
},
{
"label": "cfMemberAdr",
"type": "t_address",
"offset": 0,
"slot": "2"
}
],
"numberOfBytes": "96"
},
"t_uint256": {
"label": "uint256",
"numberOfBytes": "32"
},
"t_uint8": {
"label": "uint8",
"numberOfBytes": "1"
}
}
}
}
}
}
14 changes: 13 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,19 @@ Crazy Map proxy contract:
```
## 🖇️ Mainnet smart contract references
```
Crazy Fury contract:
0x04047358179df7FE24E578219336212346dF1C07

Crazy Map proxy contract:
0x6ADa73e6192a40922E926595539D768C983B836A

Implementation
0x49621bE3d006f1AE3C2B27482a9216B11bbDCb66
```
## 🖇️ Sepolia smart contract references
```
Expand All @@ -116,4 +129,3 @@ Crazy Map proxy contract:
Implementation
0x52D386E89E62Bf9F67126b94D730583f46D99466
```
14 changes: 7 additions & 7 deletions app/src/App/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ export default function App() {
const [noNFTError, setNoNFTError] = useState("");
const [noLocationError, setNoLocationError] = useState("");
const [updatingLocation, setUpdatingLocation] = useState(false);
const contractAddress = "0xe85D9D9c4A470F43b41379Df30Dca1Df4e19fB6e";
const contractAddress = "0x6ADa73e6192a40922E926595539D768C983B836A";
const contractABI = abi.abi;

const cfFakeAddress = "0x49621bE3d006f1AE3C2B27482a9216B11bbDCb66";
const crazyFuryAddress = "0x04047358179df7FE24E578219336212346dF1C07";
const cfFakeABI = abiFake.abi;

const checkIfWalletIsConnected = async () => {
Expand Down Expand Up @@ -197,7 +197,7 @@ export default function App() {
const signer = provider.getSigner();

const crazyFuryContractFake = new ethers.Contract(
cfFakeAddress,
crazyFuryAddress,
cfFakeABI,
signer
);
Expand Down Expand Up @@ -272,17 +272,17 @@ export default function App() {
<br/>

{/* for goerli */}
<div className="plainText">
{/* <div className="plainText">
** CALL TO ACTION FOR GOERLI NETWORK **
<br/>
<br/>
For Goerli you have to "simulate" the ownership of CrazyFury NFT for using CrazyMap
<ul>
<li>open "Demo/mint-fake-crazyfury-nft.js" and follow the instructions</li>
</ul>
</div>
</div> */}
{/* for mainnet */}
{/* <a target="_blank" href="https://opensea.io/collection/montylab">Here</a> */}
<a target="_blank" href="https://opensea.io/collection/montylab">Here</a>
</div>
)}

Expand Down Expand Up @@ -310,7 +310,7 @@ export default function App() {
<div className="footerNames"> <a href="https://github.com/domenico88" target="_blank">Dome</a> and{" "}
<a href="https://github.com/NTTLuke" target="_blank">NTTLuke</a>
</div>
<a href="https://goerli.etherscan.io/address/0x9DdA4Fff341778C5E063Bed36FE15fBA28ada758#readProxyContract" className="transactionfee" target="_blank">cm fee: 0.0012 eth</a>
<a href="https://etherscan.io/address/0x6ada73e6192a40922e926595539d768c983b836a#code" className="transactionfee" target="_blank">cm fee: 0.0012 eth</a>
</div>
</div>
);
Expand Down
3 changes: 1 addition & 2 deletions hardhat.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ module.exports = {
},
mainnet: {
url: process.env.ALCHEMY_MAINNET_URL,
accounts: [process.env.MAINNET_PRIVATE_KEY],
gasPrice: 200
accounts: [process.env.MAINNET_PRIVATE_KEY]
},
sepolia: {
url: process.env.ALCHEMY_SEPOLIA_URL,
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 = "0xcb3663012AD17640F56441CAdEDc00D0f7a0D328";
const myAddress = "0x69FCf3F6B6722a6513cDfF45CC3996587572f7Db";


//----------------------------------
Expand Down
12 changes: 6 additions & 6 deletions scripts/Deploy/crazymap-deploy-mainnet.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@ require("dotenv").config();
// etherscan api key
const ETHERSCAN_KEY = process.env.ETHERSCAN_KEY;
//max price in USD for deployment
const MAX_PRICE = 30;
const MAX_PRICE = 61;
//crazy fury contract address on mainnet
const CF_CONTRACT_ADDR = "0x04047358179df7FE24E578219336212346dF1C07";

const main = async () => {

if (await DeploymentPriceIsCompliant()) {
// console.log("Deployment price is OK, starting deployment...");
// await DeployOnMainnet();
// console.log("Deployment completed!");
console.log("Deployment price is OK, starting deployment...");
await DeployOnNetwork();
console.log("Deployment completed!");
}
};

Expand Down Expand Up @@ -62,11 +62,11 @@ const DeploymentPriceIsCompliant = async () => {
// }
}

const DeployOnMainnet = async () => {
const DeployOnNetwork = async () => {


const CrazyMap = await ethers.getContractFactory('CrazyMap');
const proxy = await upgrades.deployProxy(CrazyMap, [CF_CONTRACT_ADDR], { gasPrice: 200 });
const proxy = await upgrades.deployProxy(CrazyMap, [CF_CONTRACT_ADDR]);
await proxy.deployed();

console.log('Proxy deployed at ' + proxy.address);
Expand Down
35 changes: 0 additions & 35 deletions scripts/Deploy/crazymap-deploy-mainnet2.js

This file was deleted.

Loading

0 comments on commit ad8726f

Please sign in to comment.