Skip to content

Commit

Permalink
added gnosis network
Browse files Browse the repository at this point in the history
  • Loading branch information
utsavagupta committed Apr 30, 2023
1 parent 60fd739 commit ace348e
Show file tree
Hide file tree
Showing 10 changed files with 687 additions and 147 deletions.
8 changes: 4 additions & 4 deletions Implementations/Subgraph/daostar/build/subgraph.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ features:
templates:
- name: EIP4824Registration
kind: ethereum/contract
network: goerli
network: gnosis
source:
abi: EIP4824Registration
mapping:
Expand All @@ -25,11 +25,11 @@ templates:
dataSources:
- kind: ethereum
name: EIP4824Index
network: goerli
network: gnosis
source:
abi: EIP4824Index
address: "0xd8f49391ba81942d40c26a50f8ca63cdca6fb3da"
startBlock: 8901481
address: "0x8180cbfBFFe59F54BF3Ea5d7DdbaE1232e2bB298"
startBlock: 27702194
mapping:
kind: ethereum/events
apiVersion: 0.0.6
Expand Down
18 changes: 12 additions & 6 deletions Implementations/Subgraph/daostar/networks.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
{
"goerli": {
"EIP4824Index": {
"address": "0xd8f49391ba81942d40c26a50f8ca63cdca6fb3da",
"startBlock": 8901481
"goerli": {
"EIP4824Index": {
"address": "0xd8f49391ba81942d40c26a50f8ca63cdca6fb3da",
"startBlock": 8901481
}
},
"gnosis": {
"EIP4824Index": {
"address": "0x8180cbfBFFe59F54BF3Ea5d7DdbaE1232e2bB298",
"startBlock": 27702194
}
}
}
}
}
38 changes: 20 additions & 18 deletions Implementations/Subgraph/daostar/package.json
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@
{
"name": "daostar",
"license": "UNLICENSED",
"scripts": {
"build:mainnet": "graph codegen && graph build --network mainnet",
"build:goerli": "graph codegen && graph build --network goerli",
"codegen": "graph codegen",
"build": "graph build",
"deploy:mainnet": "graph deploy --node https://api.thegraph.com/deploy/ ipatka/daostar",
"deploy:goerli": "graph deploy --node https://api.thegraph.com/deploy/ ipatka/daostar-goerli",
"deploy:all": "yarn build:goerli && yarn deploy:goerli && yarn build:mainnet && yarn deploy:mainnet",
"create-local": "graph create --node http://localhost:8020/ ipatka/daostar",
"remove-local": "graph remove --node http://localhost:8020/ ipatka/daostar",
"deploy-local": "graph deploy --node http://localhost:8020/ --ipfs http://localhost:5001 ipatka/daostar"
},
"dependencies": {
"@graphprotocol/graph-cli": "0.29.0",
"@graphprotocol/graph-ts": "0.26.0"
}
"name": "daostar",
"license": "UNLICENSED",
"scripts": {
"build:mainnet": "graph codegen && graph build --network mainnet",
"build:goerli": "graph codegen && graph build --network goerli",
"build:gnosis": "graph codegen && graph build --network gnosis",
"codegen": "graph codegen",
"build": "graph build",
"deploy:mainnet": "graph deploy --node https://api.thegraph.com/deploy/ ipatka/daostar",
"deploy:goerli": "graph deploy --node https://api.thegraph.com/deploy/ ipatka/daostar-goerli",
"deploy:gnosis": "graph deploy --node https://api.thegraph.com/deploy/ mrutsavg/daostar-gnosis",
"deploy:all": "yarn build:goerli && yarn deploy:goerli && yarn build:mainnet && yarn deploy:mainnet && yarn build:gnosis && yarn deploy:gnosis",
"create-local": "graph create --node http://localhost:8020/ ipatka/daostar",
"remove-local": "graph remove --node http://localhost:8020/ ipatka/daostar",
"deploy-local": "graph deploy --node http://localhost:8020/ --ipfs http://localhost:5001 ipatka/daostar"
},
"dependencies": {
"@graphprotocol/graph-cli": "0.29.0",
"@graphprotocol/graph-ts": "0.26.0"
}
}
8 changes: 4 additions & 4 deletions Implementations/Subgraph/daostar/subgraph.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ features:
templates:
- name: EIP4824Registration
kind: ethereum/contract
network: goerli
network: gnosis
source:
abi: EIP4824Registration
mapping:
Expand All @@ -25,11 +25,11 @@ templates:
dataSources:
- kind: ethereum
name: EIP4824Index
network: goerli
network: gnosis
source:
abi: EIP4824Index
address: "0xd8f49391ba81942d40c26a50f8ca63cdca6fb3da"
startBlock: 8901481
address: "0x8180cbfBFFe59F54BF3Ea5d7DdbaE1232e2bB298"
startBlock: 27702194
mapping:
kind: ethereum/events
apiVersion: 0.0.6
Expand Down
80 changes: 80 additions & 0 deletions contracts/broadcast/Deploy.s.sol/100/run-1682830360.json

Large diffs are not rendered by default.

158 changes: 158 additions & 0 deletions contracts/broadcast/Deploy.s.sol/100/run-1682830367.json

Large diffs are not rendered by default.

158 changes: 158 additions & 0 deletions contracts/broadcast/Deploy.s.sol/100/run-1682830396.json

Large diffs are not rendered by default.

144 changes: 110 additions & 34 deletions contracts/broadcast/Deploy.s.sol/100/run-latest.json

Large diffs are not rendered by default.

177 changes: 115 additions & 62 deletions daostar-website/src/App.js
Original file line number Diff line number Diff line change
@@ -1,82 +1,135 @@
import { Route, Routes } from 'react-router-dom';
import Homepage from './components/Homepage/Homepage';
import Register from './components/Register/Register';
import TopNavigation from './components/TopNavigation/TopNavigation';
import RegistrationPage from './components/RegistrationPage/RegistrationPage';
import ExplorePage from './components/ExplorePage/ExplorePage';
import { Route, Routes } from "react-router-dom";
import Homepage from "./components/Homepage/Homepage";
import Register from "./components/Register/Register";
import TopNavigation from "./components/TopNavigation/TopNavigation";
import RegistrationPage from "./components/RegistrationPage/RegistrationPage";
import ExplorePage from "./components/ExplorePage/ExplorePage";
import { WagmiConfig, createClient } from "wagmi";
import { ConnectKitProvider, getDefaultClient } from "connectkit";
import { useQuery } from '@apollo/client'
import { useQuery } from "@apollo/client";

import queries from './components/ExplorePage/queries/registrations'
import queries from "./components/ExplorePage/queries/registrations";

import './App.css';
import './bp4-theme.css';
import Eye from './components/Homepage/Eye/Eye';
import "./App.css";
import "./bp4-theme.css";
import Eye from "./components/Homepage/Eye/Eye";

const alchemyId = process.env.ALCHEMY_ID;

const client = createClient(
getDefaultClient({
appName: "Your App Name",
alchemyId,
}),
getDefaultClient({
appName: "Your App Name",
alchemyId,
})
);

function App() {
const { loading, error, data: mainnetData } = useQuery(queries.REGISTRATIONS, { context: { apiName: 'mainnet' }, variables: { id: 'mainnet' } })
const goerliRes = useQuery(queries.REGISTRATIONS, { context: { apiName: 'goerli' }, variables: { id: 'goerli' } })
const { loading: goerliLoading, error: goerliError, data: goerliData } = goerliRes
console.log({ mainnetData, goerliData })
const {
loading,
error,
data: mainnetData,
} = useQuery(queries.REGISTRATIONS, {
context: { apiName: "mainnet" },
variables: { id: "mainnet" },
});
const goerliRes = useQuery(queries.REGISTRATIONS, {
context: { apiName: "goerli" },
variables: { id: "goerli" },
});
const {
loading: goerliLoading,
error: goerliError,
data: goerliData,
} = goerliRes;
const gnosisRes = useQuery(queries.REGISTRATIONS, {
context: { apiName: "gnosis" },
variables: { id: "gnosis" },
});
const {
loading: gnosisLoading,
error: gnosisError,
data: gnosisData,
} = gnosisRes;
console.log({ mainnetData, goerliData, gnosisData });

if (error || goerliError) return 'error'
if (loading || goerliLoading) return 'loading...'
const mainnetRegistrations = mainnetData?.registrationNetwork?.registrations || []
const goerliRegistrations = goerliData?.registrationNetwork?.registrations || []
const registrationInstances = mainnetRegistrations.concat(goerliRegistrations)
if (error || goerliError || gnosisError) return "error";
if (loading || goerliLoading || gnosisLoading) return "loading...";
const mainnetRegistrations =
mainnetData?.registrationNetwork?.registrations || [];
const goerliRegistrations =
goerliData?.registrationNetwork?.registrations || [];
const gnosisRegistrations =
gnosisData?.registrationNetwork?.registrations || [];
const registrationInstances = mainnetRegistrations.concat(
goerliRegistrations,
gnosisRegistrations
);

console.log({ registrationInstances })
console.log({ registrationInstances });

return (
<WagmiConfig client={client}>
<ConnectKitProvider
mode='dark'
customTheme={{
"--ck-font-family": "IBM Plex Mono, 'Roboto Condensed', 'Roboto', 'Arial', sans-serif"
}}
options={{
hideNoWalletCTA: true,
walletConnectName: 'WalletConnect',
showAvatar: false,
hideQuestionMarkCTA: true
}}
>
<div className="App">

<TopNavigation />
{/* <Homepage /> */}
return (
<WagmiConfig client={client}>
<ConnectKitProvider
mode="dark"
customTheme={{
"--ck-font-family":
"IBM Plex Mono, 'Roboto Condensed', 'Roboto', 'Arial', sans-serif",
}}
options={{
hideNoWalletCTA: true,
walletConnectName: "WalletConnect",
showAvatar: false,
hideQuestionMarkCTA: true,
}}
>
<div className="App">
<TopNavigation />
{/* <Homepage /> */}

<Routes>
<Route path='/eye' element={<Eye />} />
<Route path='/register' element={<Register />} />
<Route path='/registration/:regID' element={<RegistrationPage />} />
<Route path='/explore' element={<ExplorePage registrationInstances={registrationInstances} />} />
<Route path='/' element={<Homepage registrationInstances={registrationInstances} />} />
<Route path='/creative-universe' component={() => {
window.location.href = 'https://github.com/metagov/daostar/discussions/41';
return null;
}}/>
</Routes>
</div>

</ConnectKitProvider>
</WagmiConfig>
);
<Routes>
<Route path="/eye" element={<Eye />} />
<Route path="/register" element={<Register />} />
<Route
path="/registration/:regID"
element={<RegistrationPage />}
/>
<Route
path="/explore"
element={
<ExplorePage
registrationInstances={
registrationInstances
}
/>
}
/>
<Route
path="/"
element={
<Homepage
registrationInstances={
registrationInstances
}
/>
}
/>
<Route
path="/creative-universe"
component={() => {
window.location.href =
"https://github.com/metagov/daostar/discussions/41";
return null;
}}
/>
</Routes>
</div>
</ConnectKitProvider>
</WagmiConfig>
);
}

if (window.location.path === "creative-universe"){
window.location = "https://github.com/metagov/daostar/discussions/41"
if (window.location.path === "creative-universe") {
window.location = "https://github.com/metagov/daostar/discussions/41";
}

export default App;

45 changes: 26 additions & 19 deletions daostar-website/src/index.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,28 @@
import React from 'react'
import ReactDOM from 'react-dom/client'
import { Web3ReactProvider } from '@web3-react/core'
import { Web3Provider } from '@ethersproject/providers'
import App from './App.js'
import reportWebVitals from './reportWebVitals'
import { BrowserRouter } from 'react-router-dom'
import { FocusStyleManager } from '@blueprintjs/core'
import { ApolloClient, ApolloLink, HttpLink, InMemoryCache, ApolloProvider } from '@apollo/client'
import { createHttpLink } from 'apollo-link-http'
import { MultiAPILink } from '@habx/apollo-multi-endpoint-link'
import './index.css'
import React from "react";
import ReactDOM from "react-dom/client";
import { Web3ReactProvider } from "@web3-react/core";
import { Web3Provider } from "@ethersproject/providers";
import App from "./App.js";
import reportWebVitals from "./reportWebVitals";
import { BrowserRouter } from "react-router-dom";
import { FocusStyleManager } from "@blueprintjs/core";
import {
ApolloClient,
ApolloLink,
HttpLink,
InMemoryCache,
ApolloProvider,
} from "@apollo/client";
import { createHttpLink } from "apollo-link-http";
import { MultiAPILink } from "@habx/apollo-multi-endpoint-link";
import "./index.css";

const root = ReactDOM.createRoot(document.getElementById('root'))
const root = ReactDOM.createRoot(document.getElementById("root"));

FocusStyleManager.onlyShowFocusOnTabs()
FocusStyleManager.onlyShowFocusOnTabs();

function getLibrary(provider) {
return new Web3Provider(provider)
return new Web3Provider(provider);
}

const client = new ApolloClient({
Expand All @@ -25,14 +31,15 @@ const client = new ApolloClient({
endpoints: {
goerli: `https://api.thegraph.com/subgraphs/name/ipatka/daostar-goerli`,
mainnet: `https://api.thegraph.com/subgraphs/name/ipatka/daostar`,
gnosis: `https://api.thegraph.com/subgraphs/name/mrutsavg/daostar-gnosis`,
},
// defaultEndpoint: 'https://api.thegraph.com/subgraphs/name/ipatka/daostar',
httpSuffix: '',
httpSuffix: "",
createHttpLink: createHttpLink,
}),
]),
cache: new InMemoryCache({}),
})
});

root.render(
<React.StrictMode>
Expand All @@ -44,9 +51,9 @@ root.render(
</BrowserRouter>
</Web3ReactProvider>
</React.StrictMode>
)
);

// If you want to start measuring performance in your app, pass a function
// to log results (for example: reportWebVitals(console.log))
// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
reportWebVitals()
reportWebVitals();

0 comments on commit ace348e

Please sign in to comment.