Skip to content

Commit

Permalink
Merge pull request #50 from dmccartney/daniel-nodeset-prelim
Browse files Browse the repository at this point in the history
feat: add /nodeset with basic info
  • Loading branch information
dmccartney authored Oct 19, 2024
2 parents 4806633 + 35dc6f2 commit eda424f
Show file tree
Hide file tree
Showing 11 changed files with 3,865 additions and 1 deletion.
2 changes: 2 additions & 0 deletions web/src/App.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { BrowserRouter, HashRouter, Route, Routes } from "react-router-dom";
import HomePage from "./pages/HomePage";
import NodePage from "./pages/NodePage";
import NodeSetPage from "./pages/NodeSetPage";
import IntervalPage from "./pages/IntervalPage";

function Router({ children }) {
Expand All @@ -21,6 +22,7 @@ function App() {
exact
element={<IntervalPage />}
/>
<Route path="/nodeset" exact element={<NodeSetPage />} />
</Routes>
</Router>
);
Expand Down
12 changes: 12 additions & 0 deletions web/src/components/NodeSetIcon.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { SvgIcon } from "@mui/material";

export default function NodeSetIcon(props) {
return (
<SvgIcon {...props}>
{/* from https://nodeset.io */}
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 38.21 29.85">
<path d="M27.77 9.95a3.48 3.48 0 1 1-6.96 0 3.48 3.48 0 0 1 6.96 0zm7.99 1.53V5.71c0-3.66-2.04-5.7-6.02-5.7h-1.85V3.9h.57c1.56 0 2.33.86 2.33 2.36v5.1c0 2.2.67 3.12 2.13 3.57-1.47.45-2.13 1.37-2.13 3.57v5.1c0 1.5-.76 2.36-2.33 2.36h-.57v3.89h1.85c3.98 0 6.02-2.04 6.02-5.7v-5.77c0-1.02.54-1.5 1.4-1.5h1.05v-3.89h-1.05c-.86 0-1.4-.48-1.4-1.5zm-11.47 4.9a3.48 3.48 0 1 0 0 6.96 3.48 3.48 0 0 0 0-6.96zM2.45 5.71v5.77c0 1.02-.54 1.5-1.4 1.5H0v3.89h1.05c.86 0 1.4.48 1.4 1.5v5.77c0 3.66 2.04 5.7 6.02 5.7h1.85v-3.89h-.57c-1.56 0-2.33-.86-2.33-2.36v-5.1c0-2.2-.67-3.12-2.13-3.57 1.47-.45 2.13-1.37 2.13-3.57v-5.1c0-1.5.76-2.36 2.33-2.36h.57V0H8.47C4.49 0 2.45 2.04 2.45 5.7ZM14 16.41a3.48 3.48 0 1 0 0 6.96 3.48 3.48 0 0 0 0-6.96zm0-9.94a3.48 3.48 0 1 0 0 6.96 3.48 3.48 0 0 0 0-6.96z"></path>
</svg>
</SvgIcon>
);
}
5 changes: 4 additions & 1 deletion web/src/components/WalletChip.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@ export default function WalletChip({
});
return (
<Chip
sx={sx}
sx={{
cursor: !(href || to || onClick) ? "inherit" : undefined,
...sx,
}}
variant={"filled"}
avatar={<WalletAvatar size={avatarSize} walletAddress={walletAddress} />}
component={href ? "a" : to ? Link : "div"}
Expand Down
20 changes: 20 additions & 0 deletions web/src/contracts.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import OperatorDistributor from "./generated/contracts/OperatorDistributor.json";
import RocketMerkleDistributorMainnet from "./generated/contracts/RocketMerkleDistributorMainnet.json";
import RocketMinipoolBase from "./generated/contracts/RocketMinipoolBase.json";
import RocketMinipoolDelegate from "./generated/contracts/RocketMinipoolDelegate.json";
Expand All @@ -7,11 +8,18 @@ import RocketNodeDistributorInterface from "./generated/contracts/RocketNodeDist
import RocketNodeManager from "./generated/contracts/RocketNodeManager.json";
import RocketRewardsPool from "./generated/contracts/RocketRewardsPool.json";
import RocketStorageK from "./generated/contracts/RocketStorage.json";
import SuperNodeAccount from "./generated/contracts/SuperNodeAccount.json";
import WETH from "./generated/contracts/WETH.json";
import WETHVault from "./generated/contracts/WETHVault.json";

// This names, locates, and defines the interface to the contracts we use.
// The address can change during a rocketpool upgrade. The first `address` is the latest address.
// But we hang onto the old addresses for things like searching all event logs.
const contracts = {
OperatorDistributor: {
address: "0x102809fE582ecaa527bB316DCc4E99fc35FBAbb9",
abi: OperatorDistributor.abi,
},
RocketMerkleDistributorMainnet: {
address: [
"0x5cE71E603B138F7e65029Cc1918C0566ed0dBD4B",
Expand Down Expand Up @@ -64,6 +72,18 @@ const contracts = {
address: "0x1d8f8f00cfa6758d7bE78336684788Fb0ee0Fa46",
abi: RocketStorageK.abi,
},
SuperNodeAccount: {
address: "0x2A906f92B0378Bb19a3619E2751b1e0b8cab6B29",
abi: SuperNodeAccount.abi,
},
WETH: {
address: "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
abi: WETH.abi,
},
WETHVault: {
address: "0xbb22d59b73d7a6f3a8a83a214becc67eb3b511fe",
abi: WETHVault.abi,
},
};

// TODO: consider pulling addresses/abi from on-chain like this:
Expand Down
Loading

0 comments on commit eda424f

Please sign in to comment.