diff --git a/.env b/.env
index aa925c7..8d77d23 100644
--- a/.env
+++ b/.env
@@ -2,10 +2,8 @@ VITE_SHOW_MANUAL_VERIFICATION=true
VITE_VERIFIER_ID=orbs.com
VITE_BACKEND_URL=https://ton-source-prod-1.herokuapp.com,https://ton-source-prod-2.herokuapp.com,https://ton-source-prod-3.herokuapp.com
-VITE_VERIFIER_REGISTRY=EQDS0AW7NV1w3nFwx-mmryfpH4OGQ3PXnoFGOJA_8PTHuLrw
VITE_SOURCES_REGISTRY=EQD-BJSVUJviud_Qv7Ymfd3qzXdrmV525e3YDzWQoHIAiInL
VITE_VERIFIER_ID_TESTNET=orbs-testnet
VITE_BACKEND_URL_TESTNET=https://ton-source-prod-testnet-1.herokuapp.com
-VITE_VERIFIER_REGISTRY_TESTNET=EQB--CRXUbqYbqJKScEWeOrnk0TKJxB071M-WwvMpMEvq6Ed
VITE_SOURCES_REGISTRY_TESTNET=EQCsdKYwUaXkgJkz2l0ol6qT_WxeRbE_wBCwnEybmR0u5TO8
\ No newline at end of file
diff --git a/package-lock.json b/package-lock.json
index ca579ea..8ebde27 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -39,6 +39,7 @@
"react-dom": "^18.2.0",
"react-dropzone": "^14.2.3",
"react-ga4": "^1.4.1",
+ "react-hook-form": "^7.48.2",
"react-qr-code": "^2.0.8",
"react-router-dom": "^6.4.2",
"source-map-explorer": "^2.5.3",
@@ -3544,6 +3545,21 @@
"resolved": "https://registry.npmjs.org/react-ga4/-/react-ga4-1.4.1.tgz",
"integrity": "sha512-ioBMEIxd4ePw4YtaloTUgqhQGqz5ebDdC4slEpLgy2sLx1LuZBC9iYCwDymTXzcntw6K1dHX183ulP32nNdG7w=="
},
+ "node_modules/react-hook-form": {
+ "version": "7.48.2",
+ "resolved": "https://registry.npmjs.org/react-hook-form/-/react-hook-form-7.48.2.tgz",
+ "integrity": "sha512-H0T2InFQb1hX7qKtDIZmvpU1Xfn/bdahWBN1fH19gSe4bBEqTfmlr7H3XWTaVtiK4/tpPaI1F3355GPMZYge+A==",
+ "engines": {
+ "node": ">=12.22.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/react-hook-form"
+ },
+ "peerDependencies": {
+ "react": "^16.8.0 || ^17 || ^18"
+ }
+ },
"node_modules/react-is": {
"version": "18.2.0",
"resolved": "https://registry.npmjs.org/react-is/-/react-is-18.2.0.tgz",
@@ -6871,6 +6887,12 @@
"resolved": "https://registry.npmjs.org/react-ga4/-/react-ga4-1.4.1.tgz",
"integrity": "sha512-ioBMEIxd4ePw4YtaloTUgqhQGqz5ebDdC4slEpLgy2sLx1LuZBC9iYCwDymTXzcntw6K1dHX183ulP32nNdG7w=="
},
+ "react-hook-form": {
+ "version": "7.48.2",
+ "resolved": "https://registry.npmjs.org/react-hook-form/-/react-hook-form-7.48.2.tgz",
+ "integrity": "sha512-H0T2InFQb1hX7qKtDIZmvpU1Xfn/bdahWBN1fH19gSe4bBEqTfmlr7H3XWTaVtiK4/tpPaI1F3355GPMZYge+A==",
+ "requires": {}
+ },
"react-is": {
"version": "18.2.0",
"resolved": "https://registry.npmjs.org/react-is/-/react-is-18.2.0.tgz",
diff --git a/package.json b/package.json
index b82199f..1ea9807 100644
--- a/package.json
+++ b/package.json
@@ -43,12 +43,13 @@
"react-dom": "^18.2.0",
"react-dropzone": "^14.2.3",
"react-ga4": "^1.4.1",
+ "react-hook-form": "^7.48.2",
"react-qr-code": "^2.0.8",
"react-router-dom": "^6.4.2",
"source-map-explorer": "^2.5.3",
- "tvm-disassembler": "^2.0.2",
"ton": "^13.4.1",
"ton-core": "^0.49.0",
+ "tvm-disassembler": "^2.0.2",
"web-tree-sitter": "^0.20.7",
"zustand": "^4.1.3"
},
diff --git a/src/components/admin/Admin.tsx b/src/components/admin/Admin.tsx
index 077dbab..ed77aec 100644
--- a/src/components/admin/Admin.tsx
+++ b/src/components/admin/Admin.tsx
@@ -1,23 +1,19 @@
-import { Box } from "@mui/material";
+import { Box, Stack } from "@mui/material";
import { TestnetBar } from "../TestnetBar";
import SourcesRegistry from "./SourcesRegistry";
import { VerifierRegistry } from "./VerifierRegistry";
import { FlexBoxRow } from "../Getters.styled";
import { Footer } from "../Footer";
-import ConnectButton from "../ConnectButton";
+import { StyledTonConnectButton } from "../../styles";
export function Admin() {
return (
{window.isTestnet &&
}
-
+
Admin
-
-
+
+
diff --git a/src/components/admin/SourcesRegistry.tsx b/src/components/admin/SourcesRegistry.tsx
index 8eecd40..d38d662 100644
--- a/src/components/admin/SourcesRegistry.tsx
+++ b/src/components/admin/SourcesRegistry.tsx
@@ -1,37 +1,15 @@
-import InfoPiece from "../../components/InfoPiece";
-import { getClient } from "../../lib/getClient";
-import { Address, beginCell, Cell, fromNano, toNano } from "ton";
-import { useQuery } from "@tanstack/react-query";
-import Button from "../../components/Button";
-import React from "react";
-import { Dialog, DialogTitle, DialogContent, TextField, DialogActions } from "@mui/material";
-import { getAdmin } from "../../lib/getAdmin";
+import InfoPiece from "../InfoPiece";
+import { Address, beginCell, Cell, toNano } from "ton";
+import Button from "../Button";
+import { useEffect, useState } from "react";
+import { Stack, Box, Snackbar, Alert, CircularProgress } from "@mui/material";
+import { useTonConnectUI } from "@tonconnect/ui-react";
+import { useForm } from "react-hook-form";
+import { TextField } from "./form/TextField";
import { useRequestTXN } from "../../hooks";
-import { SourcesRegistry as SourcesRegistryContract } from "../../lib/wrappers/sources-registry";
-
-function useLoadSourcesRegistryInfo() {
- const address = Address.parse(window.sourcesRegistryAddress);
- return useQuery(["sourcesRegistry", address], async () => {
- const tc = await getClient();
- const admin = await getAdmin(address, tc);
- const contract = tc.open(SourcesRegistryContract.createFromAddress(address));
-
- const verifierRegistry = (await contract.getVerifierRegistryAddress()).toString();
- const deploymentCosts = await contract.getDeploymentCosts();
-
- const codeCellHash = Cell.fromBoc((await tc.getContractState(address)).code as Buffer)[0]
- .hash()
- .toString("base64");
- return {
- admin,
- verifierRegistry,
- codeCellHash,
- address,
- deploymentCosts,
- };
- });
-}
+import { useLoadSourcesRegistryInfo } from "../../lib/useLoadSourcesRegistryInfo";
+// TODO: combine into a single cell
function changeVerifierRegistry(newVerifierRegistry: Address): Cell {
return beginCell()
.storeUint(2003, 32)
@@ -53,106 +31,222 @@ function setDeploymentCosts(minTon: bigint, maxTon: bigint): Cell {
.endCell();
}
-function ActionDialog({
- text,
- action,
- address,
-}: {
- text: string;
- action: (param: string) => Cell;
- address: Address;
-}) {
- const [open, setOpen] = React.useState(false);
- const [value, setValue] = React.useState("");
-
- const handleClose = () => {
- setOpen(false);
- };
+type AdminForm = {
+ admin: string;
+};
- const requestTXN = useRequestTXN();
+type VerifierRegistryForm = {
+ verifierRegistry: string;
+};
- return (
- <>
-