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>
yarncp .env.sample .envVITE_RIVET_KEY
VITE_WALLET_CONNECT_IDGet 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 devyarn buildbuild 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_TOKENget free web3storage token here
add record to your ENS pointing to IPFS gateway with CID
- Sets up the
react-queryprovider@daohaus/moloch-v3-hookswill 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
DHLayoutwhich adds the connect button and navigation to the app- You can update the navigation in
navLinks
- You can update the navigation in
- Sets up
TXBuilderwhich 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.gitOutput
Addr_1Addr_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:
molochDAO address (DAO_ADDRESS)safetreasury 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:
splitaddress (SPLIT_ADDRESS)
- Before running the deployment script in the
protocol-guild-contractrepository you download locally, go to theconstants/config.tsdirectory, find the chainID of thehome networkyou plan to work with and set themoloch,safe&splitaddresses to the contract addresses you deployed in the previous steps. - Open a terminal, go to the directory where
protocol-guild-contractis 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
pgRegistryaddress within thehome networkin theconstants/config.tsfile.
Output:
registryaddress (REGISTRY_ADDRESS)
- If you set the 0xSplit controller to an EOA, you can
transferControlto theregistrycontract through 0xSplits dApp. Alternatively, you can run the following script in theprotocol-guild-contractrepo:
pnpm hardhat --network goerli registry:ownSplitIf 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
registryaddress 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 Builderto craft a tx that callsacceptSplitControl()in theregistrycontract. -
Make sure the
registryaddress is set as the 0xSplit controller: you verify that in the 0xSplit dApp or by opening thesplitMaincontract 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-contractrepo to deploy a new 0xSplit on the L2 test network:
pnpm hardhat --network optimismGoerli deploy:split --controller- NOTICE: The
--controlllerflag will set the deployer address as the 0xSplit controller. Run it with--helpfor further info about script parameters.
Output:
splitaddress in the replica network
- Before running the deployment script in the
protocol-guild-contractrepo, go to theconstants/config.tsdirectory, find thereplica networkyou plan to work with and set thesplitaddress to the contract address you deployed in the previous step. Additionally, you can set theregistryOwneraddress 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-contractrepo 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 theupdatersettings. - Finally, set the new
registryaddress within thereplica networkin theconstants/config.tsfile.
Output:
- replica
registryaddress
-
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 mainregistrycontract. -
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
registryaddress is set as the new controller.
- Open the targetDao.ts config file and add a new record (if not exists) under
REPLICA_CHAINSin theTARGETSobject. - Make sure the keychain.ts config file supports the network where you deployed the new registry.
- In the frontend, navigate to the
Registriespage, 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