This is the front end app for the PRotocol Guild DAO to interact with the Cross Chain Member Registries.
git clone <this repo>
cd <into folder>
yarn
cp .env.sample .env
VITE_RIVET_KEY
VITE_WALLET_CONNECT_ID
Get a free Rivet key here
Get a free Wallet Connect id here
Add your DAO's data and other deployed contracts and network meta data here
yarn dev
yarn build
build is a single file see plugin in vite config
github/workflows/deploy.yml
this Github action uses web3storage to deploy the signle file build to ipfs. Set env vars in action secrets including your web3storage key. This will automatically deploy when merged to main. IPFS CID can be pulled from the action log after succesfull deploy.
VITE_RIVET_KEY
VITE_WALLET_CONNECT_ID
WEB3_STORAGE_TOKEN
get free web3storage token here
add record to your ENS pointing to IPFS gateway with CID
- Sets up the
react-query
provider@daohaus/moloch-v3-hooks
will use - Sets up
DHConnectProvider
- that handles the Wallet Connect functionality - Sets up
HausThemeProvider
- that provides the styling theme to the app - Adds the router to the app
- Parent component wrapping all routes/pages
- Sets up
DHLayout
which adds the connect button and navigation to the app- You can update the navigation in
navLinks
- You can update the navigation in
- Sets up
TXBuilder
which enables easy transaction creation
tbd
- DAO Toolbox docs
- HausDAO monorepo libs
- monorepo admin/admin-new
Follow these instructions if setting up and deploying new set of networked registries. New contract addresses should be set under TARGETS
in targetDAO.ts.
Clone or download the protocol-guild-contract repository to your machine
git clone https://github.com/HausDAO/protocol-guild-contracts.git
Output
Addr_1
Addr_2
- Use DAOHaus Summoner dApp. You can include an initial set of members, setup DAO config and vote settings for initial new member proposals.
Output:
moloch
DAO address (DAO_ADDRESS
)safe
treasury address (SAFE_ADDRESS
)
- Go to the 0xSplit dApp to create new Split with initial members (at least two), split amounts can be equal as these will be updated in the first split proposals. You can either set the DAO Safe address or an EOA as the split controller (you must transfer ownership later). You can freely set the distribution threshold and sponsorship fee.
Output:
split
address (SPLIT_ADDRESS
)
- Before running the deployment script in the
protocol-guild-contract
repository you download locally, go to theconstants/config.ts
directory, find the chainID of thehome network
you plan to work with and set themoloch
,safe
&split
addresses to the contract addresses you deployed in the previous steps. - Open a terminal, go to the directory where
protocol-guild-contract
is located and run the following command line (example uses Goerli):
pnpm hardhat --network goerli deploy --tags PGNetworkRegistry
- Confirm the DAO Safe has ownership over the registry contract
- Finally, set the new
pgRegistry
address within thehome network
in theconstants/config.ts
file.
Output:
registry
address (REGISTRY_ADDRESS
)
- If you set the 0xSplit controller to an EOA, you can
transferControl
to theregistry
contract through 0xSplits dApp. Alternatively, you can run the following script in theprotocol-guild-contract
repo:
pnpm hardhat --network goerli registry:ownSplit
If you initially set the 0xSplit controller to the DAO's Safe, you'll need to submit a DAO proposal using the DAOHaus Multicall Proposal Builder
. For this, you need the splitMain
address to craft a tx that calls transferControl(<split>, <new_controller>)
-
If you set the 0xSplit controller to an external smart contract wallet, try using wallet connect or a vendor tx builder dApp.
-
Make sure the
registry
address is set as the new potential 0xSplit controller.
-
Now the new controller must accept the role for the 0xSplit contract, so you need to submit a DAO proposal using the DAOHaus
Multicall Proposal Builder
to craft a tx that callsacceptSplitControl()
in theregistry
contract. -
Make sure the
registry
address is set as the 0xSplit controller: you verify that in the 0xSplit dApp or by opening thesplitMain
contract in the block explorer and look for thegetController(split)
function.
You can deploy as many foreign registries as you want as long as these networks can communicate with each other using Connext cross-chain messagging. Below, there's an example on how to deploy a foreign registry on Optimism Goerli.
- You can either follow the same instructions in Step 3 above, however, the 0xSplit dApp might not support certain testnet networks, so for our purpose, we'll use the following script from the
protocol-guild-contract
repo to deploy a new 0xSplit on the L2 test network:
pnpm hardhat --network optimismGoerli deploy:split --controller
- NOTICE: The
--controlller
flag will set the deployer address as the 0xSplit controller. Run it with--help
for further info about script parameters.
Output:
split
address in the replica network
- Before running the deployment script in the
protocol-guild-contract
repo, go to theconstants/config.ts
directory, find thereplica network
you plan to work with and set thesplit
address to the contract address you deployed in the previous step. Additionally, you can set theregistryOwner
address that will act as a fallback owner to setup the registry in the replica network before using connext to perform sync actions through the main registry. - Run the following command line under the
protocol-guild-contract
repo directory:
pnpm hardhat --network optimismGoerli deploy --tags PGNetworkRegistry
- Confirm the registry contract has either an owner (
registryOwner
) or renounced ownership (AddressZero) and the main NetworkRegitry address & network domainID are set as theupdater
settings. - Finally, set the new
registry
address within thereplica network
in theconstants/config.ts
file.
Output:
- replica
registry
address
-
You can follow the same instructions in Steps 5 & 6 from above but for the replica network. Remember that you might set your deployer address (EOA) as the 0xSplit controller, so you might just need to call
acceptSplitControl()
. Otherwise, you'll to craft a cross-chain tx by calling theacceptNetworkSplitControl([<chainId>], [<relayerFee>])
through the mainregistry
contract. -
However,you can also use the UI to batch the two actions required to add a new replica in the main registry (
updateNetworkRegistry
+acceptNetworkSplitControl
). See the next section for instructions. -
In the end, make sure the replica
registry
address is set as the new controller.
- Open the targetDao.ts config file and add a new record (if not exists) under
REPLICA_CHAINS
in theTARGETS
object. - Make sure the keychain.ts config file supports the network where you deployed the new registry.
- In the frontend, navigate to the
Registries
page, open the menu for the new network registry and click onRegister
. This proposal form will batch the two actions required to enable a new replica in the main registry (updateNetworkRegistry
+acceptNetworkSplitControl
).
optimisticGoerli foriforeignegn registry addrs:
split: 0x41F757dC2122bD72967Cc6124345a3526200C472 (update contract config before running this)
registry: 0x6B67d35D0B93F0a5C8ADFca64d50F14D6A5cb1D6
new: 0x0b19D9cDF9172A8D760605357B5331ce802BfB91
pnpm hardhat --network optimismGoerli deploy --tags PGNetworkRegistry
arbitrumGoerli foreign registry addrs: split: 0x7C80Fd0C51E6eb02d14B9bBaf6a916E4C4fE2ded registry:0x16465c10D98FB97d2adA84e5C19E08060085240c
pnpm hardhat --network arbitrumGoerli deploy --tags PGNetworkRegistry
mumbai foreign registry addrs split: 0xb2686820c23d266d74bfe46dab3f9faa3e04f27b registry: 0x28C57030923f781861852C01371624ed50C8F1aE
if you want to save gas you should update members from l2 chain. this needs to be done before transfer of updater/owner
- begin 0xsplit controller transfer to registry
- change registry updater