Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add support for offchain space creation #1103

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

wa0x6e
Copy link
Contributor

@wa0x6e wa0x6e commented Jan 18, 2025

Summary

Closes: https://github.com/snapshot-labs/workflow/issues/151

This PR adds the ability to create an offchain.
Workflow is stripped down to the basic, so not delegation/reasuries/etc...

NOTE: the process of configuring voteValidation when using the ticker strategy has been hidden, and is set automatically when necessary

Workflow-wise, it should feel natural, so no more details will be given for unbiaised feedback. (see todo below for missing features)

How to test

Start and connect this branch with a local instance of the hub and sequencer with

diff --git a/apps/ui/.env b/apps/ui/.env
index c136c279..de0836fe 100644
--- a/apps/ui/.env
+++ b/apps/ui/.env
@@ -1,5 +1,5 @@
-VITE_ENABLED_NETWORKS=
-VITE_METADATA_NETWORK=
+VITE_ENABLED_NETWORKS=s-tn,s,s-tn,eth,matic,arb1,base,oeth,sep,sn,sn-sep
+VITE_METADATA_NETWORK=s-tn
 VITE_MANA_URL=https://mana.box
 VITE_HIGHLIGHT_URL=https://testnet.highlight.red
 VITE_IPFS_GATEWAY=ipfs.snapshot.box
diff --git a/apps/ui/src/networks/offchain/index.ts b/apps/ui/src/networks/offchain/index.ts
index 013b4061..bba5a28b 100644
--- a/apps/ui/src/networks/offchain/index.ts
+++ b/apps/ui/src/networks/offchain/index.ts
@@ -9,8 +9,8 @@ import { createApi } from './api';
 import * as constants from './constants';

 const HUB_URLS: Partial<Record<NetworkID, string | undefined>> = {
-  s: 'https://hub.snapshot.org/graphql',
-  's-tn': 'https://testnet.hub.snapshot.org/graphql'
+  s: 'http://localhost:3000/graphql',
+  's-tn': 'http://localhost:3000/graphql'
 };
 export const SNAPSHOT_URLS: Partial<Record<NetworkID, string | undefined>> = {
   s: 'https://v1.snapshot.box',
diff --git a/packages/sx.js/src/clients/offchain/ethereum-sig/index.ts b/packages/sx.js/src/clients/offchain/ethereum-sig/index.ts
index edab0712..4ab868d6 100644
--- a/packages/sx.js/src/clients/offchain/ethereum-sig/index.ts
+++ b/packages/sx.js/src/clients/offchain/ethereum-sig/index.ts
@@ -58,8 +58,8 @@ import {
 import { encryptChoices } from '../utils';

 const SEQUENCER_URLS: Record<OffchainNetworkConfig['eip712ChainId'], string> = {
-  1: 'https://seq.snapshot.org',
-  5: 'https://testnet.seq.snapshot.org'
+  1: 'http://localhost:3001',
+  5: 'http://localhost:3001'
 };

 const RELAYER_URLS: Record<OffchainNetworkConfig['eip712ChainId'], string> = {

Order of VITE_ENABLED_NETWORKS matter, the first offchain network ID will be used as network for the offchain space creation

  1. Go to http://localhost:8080/#/create
  2. Follow the steps to create an onchain or offchain space
  3. It should works

You can use impersonator and connect as 0x91FD2c8d24767db4Ece7069AA27832ffaf8590f3 on s-tn to see all possible ENS names errors

To-Do

Those extra feature will come in a later PR, as not essential

  • Add a confirmation modal when exiting the space creation workflow (will also be used to clear cache, like ENS names cache)
  • Push each step of the creation workflow in router history, so the browser BACK button will redirect to the previous step

@wa0x6e wa0x6e force-pushed the feat-create-offchain-space branch 8 times, most recently from d340d35 to 18d144e Compare January 20, 2025 19:54
@wa0x6e wa0x6e force-pushed the feat-create-offchain-space branch 14 times, most recently from 00fecc8 to 288e85b Compare January 21, 2025 22:35
@wa0x6e wa0x6e force-pushed the feat-create-offchain-space branch from 288e85b to b38f393 Compare January 21, 2025 23:00
@wa0x6e wa0x6e marked this pull request as ready for review January 21, 2025 23:01
@wa0x6e wa0x6e requested a review from bonustrack January 21, 2025 23:11
@wa0x6e
Copy link
Contributor Author

wa0x6e commented Jan 21, 2025

@bonustrack This feature can be tester for UI/workflow/UX. Will ask for code review once more polished

@wa0x6e wa0x6e requested a review from Sekhmet January 21, 2025 23:27
@wa0x6e wa0x6e force-pushed the feat-create-offchain-space branch from 44a3610 to db2c620 Compare January 22, 2025 19:27
@bonustrack
Copy link
Member

Some comments:

  • We should not mention "Help Center" but "Helpdesk" instead.

  • This loading should be aligned to the right

image
  • I can't find the form for voting validation even when using ticket strategy. I think anyhow we shouldn't show ticket as the first option and whitelist as second in the voting strategies section. These are not the most common strategies, we should instead give easy access first to ERC 20 and ERC 721 strategies, and allow for custom strategy selection. We should also not have 2 different screens for voting strategies section ("quick selection" and "custom setup"), we should merge this to 1 screen, with the ability to see all the voting strategies.

  • To simplify the flow we can also remove the shielded voting section.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants