Skip to content

Commit

Permalink
Merged main
Browse files Browse the repository at this point in the history
  • Loading branch information
namedotget committed Jan 7, 2025
2 parents 2bf76ac + 9ed5eea commit f98695c
Show file tree
Hide file tree
Showing 13 changed files with 314 additions and 319 deletions.
13 changes: 8 additions & 5 deletions ui/lib/nance/constants.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
// use chainId as env var for detecting dev mode
const prod = process.env.NEXT_PUBLIC_CHAIN === 'mainnet'
export const NANCE_SPACE_NAME = prod ? 'moondao' : 'waterbox'
export const SNAPSHOT_SPACE_NAME = prod ? 'tomoondao.eth' : 'jigglyjams.eth'
const mainnet = process.env.NEXT_PUBLIC_CHAIN === 'mainnet'
const dev = process.env.NEXT_PUBLIC_ENV === 'dev'
export const NANCE_SPACE_NAME = mainnet || dev ? 'moondao' : 'waterbox'
export const SNAPSHOT_SPACE_NAME =
mainnet || dev ? 'tomoondao.eth' : 'jigglyjams.eth'

export const proposalIdPrefix = 'MDP-';
export const proposalIdPrefix = 'MDP-'

export const NANCE_API_URL = prod ? 'https://api.nance.app' : 'http://localhost:3003'
export const NANCE_API_URL =
mainnet || dev ? 'https://api.nance.app' : 'http://localhost:3003'
79 changes: 63 additions & 16 deletions ui/lib/nance/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,32 +15,79 @@ export function formatNumberUSStyle(
}

export const TEMPLATE = `\n*Note: Please remove the italicized instructions before submitting*\n
## Abstract
*This is a high-level description of the idea. Please use ELI5 (explain like I'm five years old) wording and summarize things for anyone to understand what you want to achieve.*
## Problem
**Author:**
**Date:**
# Abstract
*This is a high-level description of the idea. Please use ELI5 (explain like I’m five years old) wording and summarize things for anyone to understand what you want to achieve.*
# Problem
*Describe the problem your proposal solves.*
## Solution
*Describe the "meat & potatoes" of the proposal. Go into necessary detail about the work that needs to be done, alternative solutions considered, open questions, and future directions. Keep it concise.*
# Solution
*Describe the “meat & potatoes” of the proposal. Go into necessary detail about the work that needs to be done, alternative solutions considered, open questions, and future directions. Keep it concise.*
# Benefits
## Benefits
*Point out the core benefits of the proposal implementation and how it will affect MoonDAO. If the proposal can create revenue please create justification for how much revenue it could generate.*
## Risks
# Risks
*Highlight any risks from implementing the proposal, how could this go wrong? How are you addressing those risks?*
## Objectives
# Objectives
*You can write as many OKRs as you think are needed. One focused goal is preferred instead of many. OKRs should use SMART principles (Specific, Measurable, Achievable, Relevant, and Time-Bound).*
**Objective #1:** *What do you want to achieve with this project. Be specific.*
**Objective \#1:** *What do you want to achieve with this project. Be specific.*
**Key Results for Objective \#1**:
- *What is a measurable result that indicates this objective has been met?*
- *Include 3-4 relevant metrics that indicate success for the objective*
**Member(s) responsible for OKR** **and their role:**
- *Is there a specific member or set of members that are responsible for this particular objective? If all of them are responsible for this just say “All”*
# Team (Table A)
***Project Lead:** The Project Lead and representative for the project within the MoonDAO Senate. The Project Lead is responsible for:*
1. *Attending weekly town hall meetings, reviewing incoming proposals and voting on them within the Senate. Missed attendance will result in a 5% penalty to the rocketeer’s retroactive rewards.*
2. *Creating weekly updates to the community on the progress of the project in the “progress” channel on DIscord.*
3. *Adding team members, removing team members, and making decisions about the use of the budget throughout the lifetime of the project.*
4. *Creating and managing the multi-sig Treasury for the project as well as the payments for each of the members.*
5. *Creating the Final Report and returning unused funds to the MoonDAO Treasury.*
***Initial Team:** Projects may not need an initial team. It can just be an individual submitting a proposal. You may also create generic roles and hire other teammates after the project is approved. As a general rule of thumb, try to keep teams small and focused in the beginning, **with clear roles, deliverables, and OKRs for each member**. Team members are responsible for:*
1. *Posting a weekly update in the “progress” channel on Discord with their contributions that week. Not posting a weekly update will result in a 5% penalty to their retroactive rewards.*
| Project Lead | *@DiscordUsername* |
| :---- | :---- |
| **Initial Team** | *Role 1: “Developer” @DiscordUsername1. “Description of the role and deliverable for this member” Role 2: “Designer” @DiscordUsername2. “Description of the role and deliverable for this member”* |
| **Multi-sig signers\*** | *Five required with their ETH addresses listed. “@DiscordUsername1: eth:0x0...1” “@DiscordUsername2: eth:0x0...2” “@DiscordUsername3: eth:0x0...3” “@DiscordUsername4: eth:0x0...4” “@DiscordUsername5: eth:0x0...5” You can create a multi-sig [here](https://app.safe.global/welcome)* |
| **Multi-sig Address\*** | *ETH address with the multi-sig* |
# Timeline (Table B)
| Days after Proposal Passes | Description |
| :---- | :---- |
| 0 | Proposal Passes |
| 7 | *Insert your milestones here.* |
| | |
**Deadline for the project: End of Q3.**
**Key Results for Objective #1:**
* *What is a measurable result that indicates this objective has been met?*
* *Include 3-4 relevant metrics that indicate success for the objective*
# Transactions (Table C)
**Member(s) responsible for OKR and their role:**
* *Is there a specific member or set of members that are responsible for this particular objective? If all of them are responsible for this just say "All"*
*Please write out the specific transactions that need to be executed if this proposal passes. Please include the exact amount and token type and the receiving address (this is the multi-sig if there is more than one transaction that needs to be executed throughout the lifetime of this project.)*
## Deadline
*Enter the expected completion date for this project..*`;
| Transaction Type | Amount | Token Type | Receiving Address |
| :---- | :---- | :---- | :---- |
| *Send* | *0* | *ETH* | *TBD* |
`
34 changes: 7 additions & 27 deletions ui/lib/project/useProjectData.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,13 @@ export default function useProjectData(

const [isLoading, setIsLoading] = useState<boolean>(false)

const [snapshotProposal, setSnapshotProposal] = useState<any>()
const proposalJSON = useProposalJSON(
snapshotProposal?.data?.message?.body as string
)
const { data: nanceProposalResponse } = useProposal({
space: NANCE_SPACE_NAME,
uuid: String(project?.MDP) || '',
})
const nanceProposal = nanceProposalResponse?.data

const proposalJSON = useProposalJSON(nanceProposal?.body as string)

const [isManager, setIsManager] = useState<boolean>(false)
const [hatTreeId, setHatTreeId] = useState<string>()
Expand All @@ -51,12 +54,6 @@ export default function useProjectData(
[project?.id || '']
)

const { data: nanceProposalResponse } = useProposal({
space: NANCE_SPACE_NAME,
uuid: String(project?.MDP) || '',
})
const nanceProposal = nanceProposalResponse?.data

const totalBudget = useMemo(() => {
let budget = 0
if (nanceProposal?.actions && nanceProposal.actions.length > 0) {
Expand All @@ -71,21 +68,6 @@ export default function useProjectData(
return budget
}, [nanceProposal])

const isActive = useMemo(() => {
return project?.active === 1
}, [project?.active])

useEffect(() => {
async function getProposal() {
const res = await fetch(
`https://ipfs.io/ipfs/${project?.proposalIPFS.split('ipfs://')[1]}`
)
const data = await res.json()
setSnapshotProposal(data)
}
if (project?.proposalIPFS) getProposal()
}, [project?.proposalIPFS])

useEffect(() => {
async function checkManager() {
try {
Expand Down Expand Up @@ -116,12 +98,10 @@ export default function useProjectData(

return {
...project,
isActive,
isManager,
hatTreeId,
adminHatId,
managerHatId,
snapshotData: snapshotProposal,
nanceProposal,
proposalJSON,
totalBudget,
Expand Down
2 changes: 1 addition & 1 deletion ui/lib/utils/voting.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Solve } from '@bygdle/javascript-lp-solver'
import _ from 'lodash'
import { Distribution, Project } from '@/components/nance/RetroactiveRewards'
import { Distribution } from '@/components/nance/RetroactiveRewards'

// Function to minimize L1 distance
function minimizeL1Distance(D: number[], V: number[][]) {
Expand Down
25 changes: 20 additions & 5 deletions ui/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,11 +148,6 @@ module.exports = nextTranslate({
destination: '/zero-gravity',
permanent: true,
},
{
source: '/contribute',
destination: 'https://discord.gg/moondao',
permanent: true,
},
{
source: '/es',
destination: '/',
Expand Down Expand Up @@ -203,6 +198,26 @@ module.exports = nextTranslate({
destination: '/submit?tag=contribution',
permanent: true,
},
{
source: '/contribution',
destination: '/submit?tag=contribution',
permanent: true,
},
{
source: '/citizens',
destination: '/network?tab=citizens',
permanent: true,
},
{
source: '/propose',
destination: '/submit?tag=proposal',
permanent: true,
},
{
source: '/teams',
destination: '/network?tab=teams',
permanent: true,
},
]
},
webpack: (config, { isServer }) => {
Expand Down
2 changes: 1 addition & 1 deletion ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"@headlessui/react": "^2.0.4",
"@heroicons/react": "^2.0.18",
"@hookform/error-message": "^2.0.1",
"@nance/nance-editor": "^1.8.3",
"@nance/nance-editor": "^1.8.4",
"@nance/nance-hooks": "^4.1.6",
"@nance/nance-sdk": "^4.1.6",
"@privy-io/react-auth": "^1.92.1",
Expand Down
159 changes: 0 additions & 159 deletions ui/pages/contribution.tsx

This file was deleted.

Loading

0 comments on commit f98695c

Please sign in to comment.