diff --git a/public/legal/tosDao.pdf b/public/legal/tosDao.pdf new file mode 100644 index 0000000..63d1936 Binary files /dev/null and b/public/legal/tosDao.pdf differ diff --git a/src/constants/deployments.ts b/src/constants/deployments.ts index d6f1659..a45ed0c 100644 --- a/src/constants/deployments.ts +++ b/src/constants/deployments.ts @@ -8,6 +8,7 @@ interface Contracts { wyUNA: string lexCharter: string orCharter: string + tosDao?: string subgraph?: string } @@ -141,6 +142,7 @@ export const deployments: { [key: number]: Contracts } = { wyUNA: '0x73Af00b92073D93b47e1077f796A3D6A12F63909', lexCharter: '0xa958f8D815a037E8eDe8194DAD70f9A3f3f94041', orCharter: '0x5228eBc680BA2Ac70A8dB9FBF01CEAaC9Dd9b2Ea', + tosDao: '0x5228eBc680BA2Ac70A8dB9FBF01CEAaC9Dd9b2Ea', subgraph: 'https://api.thegraph.com/subgraphs/name/nerderlyne/wrappr-goerli', }, // Q Testnet diff --git a/src/minter/Confirm.tsx b/src/minter/Confirm.tsx index 5257900..60748af 100644 --- a/src/minter/Confirm.tsx +++ b/src/minter/Confirm.tsx @@ -35,6 +35,8 @@ export default function Confirm({ store, setStore, setView }: Props) { const { isConnected, address } = useAccount() const { chain } = useNetwork() const contractAddress = deployments[1][(store.juris + store.entity) as keyof typeof deployments[1]] as string + const termsAddress = deployments[5][store.juris as keyof typeof deployments[1]] as string + const { writeAsync } = useContractWrite({ mode: 'recklesslyUnprepared', addressOrName: contractAddress, @@ -42,6 +44,13 @@ export default function Confirm({ store, setStore, setView }: Props) { functionName: 'mint', }) + const { writeAsync: writeAsync2 } = useContractWrite({ + mode: 'recklesslyUnprepared', + addressOrName: termsAddress, + contractInterface: WRAPPR, + functionName: 'mint', + }) + const { writeAsync: writeAsyncQtest } = useContractWrite({ mode: 'recklesslyUnprepared', addressOrName: deployments[35443][(store.juris + store.entity) as keyof typeof deployments[35443]] as string, @@ -89,21 +98,21 @@ export default function Confirm({ store, setStore, setView }: Props) { }) setLoading(false) } + // creating agreement - let agreement = getAgreement(store.juris + store.entity) + let agreement + if (store.entity == 'Terms') { + agreement = getAgreement(store.juris) + } else { + agreement = getAgreement(store.juris + store.entity) + } + try { setMessage({ text: 'Creating agreement...', icon: , }) - const res = await createAgreement( - store.juris + store.entity, - store.name, - tokenId.toString(), - store.mission, - store.jurisdiction, - chain.id.toString(), - ) + const res = await createAgreement(tokenId.toString(), chain.id.toString(), store) if (typeof res === 'string') { agreement = res @@ -162,6 +171,10 @@ export default function Confirm({ store, setStore, setView }: Props) { }, }) } + } else if (store.entity === 'Terms') { + res = await writeAsync2({ + recklesslySetUnpreparedArgs: [address, tokenId, 1, ethers.constants.HashZero, tokenURI, address], + }) } else { if (chain.id == 35443) { res = await writeAsyncQtest({ @@ -230,7 +243,11 @@ export default function Confirm({ store, setStore, setView }: Props) { - + {store.entity == 'Terms' ? ( + + ) : ( + + )} I have read and accept the terms of this agreement.} + label={I have read and reviewed this agreement.} onCheckedChange={() => setChecked(!checked)} > {isConnected ? ( diff --git a/src/minter/choice/Entity.tsx b/src/minter/choice/Entity.tsx index 31fc6d9..8722c9b 100644 --- a/src/minter/choice/Entity.tsx +++ b/src/minter/choice/Entity.tsx @@ -93,6 +93,15 @@ export default function Entity({ choice, setChoice, setView }: Props) { > Charter + diff --git a/src/minter/choice/Juris.tsx b/src/minter/choice/Juris.tsx index b54ef2d..5ba81e8 100644 --- a/src/minter/choice/Juris.tsx +++ b/src/minter/choice/Juris.tsx @@ -54,6 +54,10 @@ export default function Juris({ choice, setChoice, setView, setScreen }: Props) 'Your DAO Charter will be drafted after minting. This is a simple membership agreement signable with DAO vote or key-signature.', link: 'https://docs.wrappr.wtf/how-to/charter/#%F0%9F%93%9C-dao-charter', }, + Terms: { + description: 'Terms selected will be drafted after minting.', + link: 'https://docs.wrappr.wtf/how-to/', + }, } return ( @@ -92,11 +96,25 @@ export default function Juris({ choice, setChoice, setView, setScreen }: Props) - Select Jurisdiction + {choice.entity.toLowerCase() !== 'terms' ? 'Select Jurisdiction' : 'Select Terms'} - {choice.entity.toLowerCase() !== 'charter' + {choice.entity.toLowerCase() == 'terms' + ? terms.map(({ text, set }) => ( + + )) + : choice.entity.toLowerCase() !== 'charter' ? entity.map(({ text, set }) => ( + ) : ( + + )} + + + ) +} diff --git a/src/minter/form/index.tsx b/src/minter/form/index.tsx index 3413df5..bfd8559 100644 --- a/src/minter/form/index.tsx +++ b/src/minter/form/index.tsx @@ -17,8 +17,15 @@ interface Form { } export default function Form({ store, setStore, setView }: Props) { - const choice: string = store?.juris + store?.entity + let choice: string + if (store?.entity == 'Terms') { + choice = store?.juris + } else { + choice = store?.juris + store?.entity + } + + console.log(choice) const form: { [key: string]: Form } = { deLLC: { heading: 'Delaware LLC', @@ -58,6 +65,25 @@ export default function Form({ store, setStore, setView }: Props) { link: 'https://docs.wrappr.wtf/how-to/charter/#lexpunk-dao-charter', component: , }, + tosDao: { + heading: 'DAO Terms of Service', + description: 'A terms of service suitable for DAOs developing full-stack solution.', + link: 'https://docs.wrappr.wtf/how-to/charter/#lexpunk-dao-charter', + component: , + }, + privacy: { + heading: 'Privacy Policy', + description: '.', + link: 'https://docs.wrappr.wtf/how-to/charter/#lexpunk-dao-charter', + component: , + }, + tosWeb: { + heading: 'Website Terms of Service', + description: + 'A simple membership agreement for DAOs with emphasis on social structure and regular cadence. Based on Orange DAO.', + link: 'https://docs.wrappr.wtf/how-to/charter/#lexpunk-dao-charter', + component: , + }, } return ( @@ -108,3 +134,4 @@ export default function Form({ store, setStore, setView }: Props) { import LLC from './LLC' import Charter from './Charter' import UNA from './UNA' +import TosDao from './TosDao' diff --git a/src/minter/types.ts b/src/minter/types.ts index be2fae6..514f7fc 100644 --- a/src/minter/types.ts +++ b/src/minter/types.ts @@ -14,4 +14,9 @@ export type StoreT = { agreement: string uri: string txHash: string + date: string + dao_address: string + entity_name: string + email: string + privacy_url: string } diff --git a/src/minter/utils/createAgreement.ts b/src/minter/utils/createAgreement.ts index 4e97743..b964a99 100644 --- a/src/minter/utils/createAgreement.ts +++ b/src/minter/utils/createAgreement.ts @@ -1,55 +1,74 @@ import { uploadFile } from '~/utils' +import { StoreT } from '../types' export async function createAgreement( - template_name: string, - name: string, + // template_name: string, + // name: string, tokenId: string, - mission: string, - jurisdiction: string, + // mission: string, + // jurisdiction: string, chainId: string, + store: StoreT, ) { let agreement_params + let template_name + + if (store.entity == 'Terms') { + template_name = store.juris + } else { + template_name = store.juris + store.entity + } + + console.log(store) switch (template_name) { case 'deLLC': agreement_params = { - name: name, + name: store.name, ricardianId: `${chainId}:${tokenId}`, } break case 'wyLLC': agreement_params = { - name: `Wrappr LLC - ${name} - Series ${tokenId}`, + name: `Wrappr LLC - ${store.name} - Series ${tokenId}`, ricardianId: `${chainId}:${tokenId}`, } break case 'deUNA': agreement_params = { - name: name, + name: store.name, ricardianId: `${chainId}:${tokenId}`, - mission: mission, + mission: store.mission, } break case 'wyUNA': agreement_params = { name: name, ricardianId: `${chainId}:${tokenId}`, - mission: mission, + mission: store.mission, } break case 'lexCharter': agreement_params = { - name: name, + name: store.name, ricardianId: `${chainId}:${tokenId}`, - mission: mission, - jurisdiction: jurisdiction, + mission: store.mission, + jurisdiction: store.jurisdiction, } break case 'orCharter': agreement_params = { - name: name, + name: store.name, ricardianId: `${chainId}:${tokenId}`, - mission: mission, - jurisdiction: jurisdiction, + mission: store.mission, + jurisdiction: store.jurisdiction, + } + break + case 'tosDao': + agreement_params = { + date: store.name, + // ricardianId: `${chainId}:${tokenId}`, + // mission: store.mission, + // jurisdiction: store.jurisdiction, } break } @@ -58,6 +77,7 @@ export async function createAgreement( template_name: template_name, agreement_params: agreement_params, } + console.log(obj) const res = await fetch('https://engine.wrappr.wtf/v1/gen', { method: 'POST', headers: { diff --git a/src/minter/utils/getAgreement.ts b/src/minter/utils/getAgreement.ts index 8560254..43d1f9b 100644 --- a/src/minter/utils/getAgreement.ts +++ b/src/minter/utils/getAgreement.ts @@ -1,4 +1,5 @@ export function getAgreement(entity: string): string { + console.log(entity) switch (entity) { case 'deLLC': return 'https://de.llc.ricardian.eth.limo/' diff --git a/src/minter/utils/getName.ts b/src/minter/utils/getName.ts index f684f43..f03d5d1 100644 --- a/src/minter/utils/getName.ts +++ b/src/minter/utils/getName.ts @@ -1,4 +1,4 @@ -export default function getName(juris: string, type: string) { +export default function getName(juris: string, entity: string) { let jurisdiction switch (juris) { @@ -14,7 +14,11 @@ export default function getName(juris: string, type: string) { case 'lex': jurisdiction = 'LexPunk' break + case 'tosDao': + jurisdiction = 'DAO Terms of Service' + entity = '' + break } - return jurisdiction + ' ' + type + return jurisdiction + ' ' + entity } diff --git a/styles/DateInput/index.tsx b/styles/DateInput/index.tsx new file mode 100644 index 0000000..9758e30 --- /dev/null +++ b/styles/DateInput/index.tsx @@ -0,0 +1,31 @@ +import * as styles from './styles.css' +import { Field, Box } from '@kalidao/reality' + +type Props = { + name?: string + label: string + description?: string + error?: string + onChange: (e: React.ChangeEvent) => void + disabled?: boolean + defaultValue?: string +} + +export function DateInput({ name, label, disabled, error, onChange, defaultValue }: Props) { + const hasError = error ? true : undefined + + return ( + + + + ) +} diff --git a/styles/DateInput/styles.css.ts b/styles/DateInput/styles.css.ts new file mode 100644 index 0000000..29cd7d4 --- /dev/null +++ b/styles/DateInput/styles.css.ts @@ -0,0 +1,25 @@ +import { style } from '@vanilla-extract/css' +import { vars } from '@kalidao/reality' + +export const container = style({ + backgroundColor: vars.colors.background, + outlineWidth: vars.borderWidths.px, + outlineColor: vars.colors.foregroundSecondary, + outlineStyle: 'solid', + borderWidth: vars.borderWidths.px, + borderColor: vars.colors.foregroundSecondary, + borderRadius: vars.radii.large, + color: vars.colors.text, + fontSize: vars.fontSizes.small, + paddingRight: vars.space[3.5], + paddingLeft: vars.space[3.5], + paddingTop: vars.space[3.5], + paddingBottom: vars.space[3.5], + + display: 'flex', + + ':hover': { + outlineColor: vars.colors.accent, + backgroundColor: vars.colors.backgroundSecondary, + }, +})