Skip to content

Commit

Permalink
Merge branch 'develop' into enter-snapshot-space-bug
Browse files Browse the repository at this point in the history
  • Loading branch information
DarksightKellar committed Apr 15, 2024
2 parents 5375892 + 12b9753 commit 57cc68f
Show file tree
Hide file tree
Showing 167 changed files with 1,656 additions and 2,254 deletions.
8 changes: 8 additions & 0 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ VITE_APP_ALCHEMY_POLYGON_API_KEY=""
VITE_APP_ALCHEMY_SEPOLIA_API_KEY=""
# Alchemy provider API key, used on Base Sepolia
VITE_APP_ALCHEMY_BASE_SEPOLIA_API_KEY=""
# Alchemy provider API key, used on Base
VITE_APP_ALCHEMY_BASE_API_KEY=""
# Alchemy provider API key, used on Optimism
VITE_APP_ALCHEMY_OPTIMISM_API_KEY=""
# Alchemy automated testing workflows
VITE_APP_ALCHEMY_TESTING_API_KEY=""

Expand All @@ -25,6 +29,10 @@ VITE_APP_ETHERSCAN_POLYGON_API_KEY=""
VITE_APP_ETHERSCAN_SEPOLIA_API_KEY=""
# ABI selector, used on Base Sepolia
VITE_APP_ETHERSCAN_BASE_SEPOLIA_API_KEY=""
# ABI selector, used on Base
VITE_APP_ETHERSCAN_BASE_API_KEY=""
# ABI selector, used on Optimism
VITE_APP_ETHERSCAN_OPTIMISM_API_KEY=""

# IPFS pinning
VITE_APP_INFURA_IPFS_API_KEY=""
Expand Down
2 changes: 1 addition & 1 deletion .graphclientrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ sources:
- name: fractal
handler:
graphql:
endpoint: https://api.studio.thegraph.com/query/43215/fractal-{context.chainName:sepolia}/version/latest
endpoint: https://api.studio.thegraph.com/query/{context.subgraphSpace:71032}/{context.subgraphSlug:fractal-mainnet}/{context.subgraphVersion:v0.0.1}

documents:
- ./src/graphql/DAO.graphql
18 changes: 0 additions & 18 deletions docs/NETWORK_SUPPORT.md

This file was deleted.

8 changes: 4 additions & 4 deletions netlify/functions/tokenPrices.mts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// eslint-disable-next-line import/named
import { Store, getStore } from '@netlify/blobs';
import { ethers } from 'ethers';
import { getStore } from '@netlify/blobs';
import type { Store } from '@netlify/blobs';
import { isAddress } from 'viem';

const PUBLIC_DEMO_API_BASE_URL = 'https://api.coingecko.com/api/v3/';
const AUTH_QUERY_PARAM = `?x_cg_demo_api_key=${process.env.COINGECKO_API_KEY}`;
Expand All @@ -27,7 +27,7 @@ type SupportedNetworks = (typeof SUPPORTED_NETWORKS)[number];
function sanitizeUserInput(tokensString: string, network: SupportedNetworks) {
const rawTokenAddresses = tokensString.split(',');
const needNativeAsset = rawTokenAddresses.map(address => address.toLowerCase()).includes(network);
const validTokenAddresses = rawTokenAddresses.filter(address => ethers.utils.isAddress(address));
const validTokenAddresses = rawTokenAddresses.filter(address => isAddress(address));
const lowerCaseTokenAddresses = validTokenAddresses.map(address => address.toLowerCase());
const tokens = [...new Set(lowerCaseTokenAddresses)];
if (needNativeAsset) tokens.push(network);
Expand Down
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"@ethersproject/providers": "^5.7.2",
"@fontsource/ibm-plex-mono": "^4.5.12",
"@fontsource/ibm-plex-sans": "^4.5.13",
"@fractal-framework/fractal-contracts": "^0.5.0",
"@fractal-framework/fractal-contracts": "^0.7.0",
"@graphprotocol/client-apollo": "^1.0.16",
"@lido-sdk/contracts": "^3.0.2",
"@netlify/blobs": "^6.5.0",
Expand Down Expand Up @@ -62,7 +62,7 @@
"dev": "VITE_APP_GIT_HASH=`git rev-parse HEAD` vite --force",
"start": "vite start",
"preview": "vite preview",
"build": "npm run graphql:build && VITE_APP_GIT_HASH=`git rev-parse HEAD` vite build",
"build": "VITE_APP_GIT_HASH=`git rev-parse HEAD` vite build",
"graphql:build": "graphclient build",
"graphql:dev-server": "graphclient serve-dev",
"test": "vitest --dir=test",
Expand Down
64 changes: 0 additions & 64 deletions src/components/CreateProposalTemplate/ProposalTemplateMetadata.tsx

This file was deleted.

23 changes: 0 additions & 23 deletions src/components/CreateProposalTemplate/constants.ts

This file was deleted.

23 changes: 12 additions & 11 deletions src/components/DaoCreator/constants.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { BigNumber } from 'ethers';
import {
CreatorFormState,
GovernanceType,
Expand All @@ -8,6 +7,8 @@ import {

export const DEFAULT_TOKEN_DECIMALS = 18;

// @todo make the time lengths dynamic for whatever real-life values we're targeting here

export const initialState: CreatorFormState = {
essentials: {
daoName: '',
Expand Down Expand Up @@ -45,7 +46,7 @@ export const initialState: CreatorFormState = {
],
quorumThreshold: {
value: '10',
bigNumberValue: BigNumber.from(10),
bigintValue: 10n,
},
},
/**
Expand All @@ -58,42 +59,42 @@ export const initialState: CreatorFormState = {
azorius: {
quorumPercentage: {
value: '4',
bigNumberValue: BigNumber.from(4),
bigintValue: 4n,
},
timelock: {
value: '1440',
bigNumberValue: BigNumber.from(1440),
bigintValue: 1440n,
},
votingPeriod: {
value: '10080',
bigNumberValue: BigNumber.from(10080),
bigintValue: 10080n,
},
executionPeriod: {
value: '2880',
bigNumberValue: BigNumber.from(2880),
bigintValue: 2880n,
},
votingStrategyType: VotingStrategyType.LINEAR_ERC20,
},
freeze: {
executionPeriod: {
value: '2880',
bigNumberValue: BigNumber.from(2880),
bigintValue: 2880n,
},
timelockPeriod: {
value: '1440',
bigNumberValue: BigNumber.from(1440),
bigintValue: 1440n,
},
freezeVotesThreshold: {
value: '1',
bigNumberValue: BigNumber.from(1),
bigintValue: 1n,
},
freezeProposalPeriod: {
value: '10080',
bigNumberValue: BigNumber.from(10080),
bigintValue: 10080n,
},
freezePeriod: {
value: '10080',
bigNumberValue: BigNumber.from(10080),
bigintValue: 10080n,
},
},
multisig: {
Expand Down
22 changes: 11 additions & 11 deletions src/components/DaoCreator/formComponents/AzoriusGovernance.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { Info } from '@decent-org/fractal-ui';
import { useTranslation } from 'react-i18next';
import { ICreationStepProps, CreatorSteps, VotingStrategyType } from '../../../types';
import ContentBoxTitle from '../../ui/containers/ContentBox/ContentBoxTitle';
import { BigNumberInput } from '../../ui/forms/BigNumberInput';
import { BigIntInput } from '../../ui/forms/BigIntInput';
import { LabelComponent } from '../../ui/forms/InputComponent';
import { StepButtons } from '../StepButtons';
import { StepWrapper } from '../StepWrapper';
Expand Down Expand Up @@ -39,8 +39,8 @@ export function AzoriusGovernance(props: ICreationStepProps) {
isRequired
>
<InputGroup>
<BigNumberInput
value={values.azorius.votingPeriod.bigNumberValue}
<BigIntInput
value={values.azorius.votingPeriod.bigintValue}
onChange={valuePair => setFieldValue('azorius.votingPeriod', valuePair)}
decimalPlaces={0}
min="1"
Expand All @@ -63,8 +63,8 @@ export function AzoriusGovernance(props: ICreationStepProps) {
isRequired
>
<InputGroup>
<BigNumberInput
value={values.azorius.quorumPercentage.bigNumberValue}
<BigIntInput
value={values.azorius.quorumPercentage.bigintValue}
onChange={valuePair => setFieldValue('azorius.quorumPercentage', valuePair)}
max="100"
decimalPlaces={0}
Expand All @@ -79,8 +79,8 @@ export function AzoriusGovernance(props: ICreationStepProps) {
helper={t('helperQuorumThreshold')}
isRequired
>
<BigNumberInput
value={values.erc721Token.quorumThreshold.bigNumberValue}
<BigIntInput
value={values.erc721Token.quorumThreshold.bigintValue}
onChange={valuePair => setFieldValue('erc721Token.quorumThreshold', valuePair)}
decimalPlaces={0}
min="1"
Expand All @@ -94,8 +94,8 @@ export function AzoriusGovernance(props: ICreationStepProps) {
isRequired
>
<InputGroup>
<BigNumberInput
value={values.azorius.timelock.bigNumberValue}
<BigIntInput
value={values.azorius.timelock.bigintValue}
onChange={valuePair => setFieldValue('azorius.timelock', valuePair)}
decimalPlaces={0}
data-testid="govConfig-timelock"
Expand All @@ -116,8 +116,8 @@ export function AzoriusGovernance(props: ICreationStepProps) {
isRequired
>
<InputGroup>
<BigNumberInput
value={values.azorius.executionPeriod.bigNumberValue}
<BigIntInput
value={values.azorius.executionPeriod.bigintValue}
onChange={valuePair => setFieldValue('azorius.executionPeriod', valuePair)}
decimalPlaces={0}
min="1"
Expand Down
8 changes: 4 additions & 4 deletions src/components/DaoCreator/formComponents/AzoriusNFTDetail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ import { Flex, Box, Text } from '@chakra-ui/react';
import { ethers } from 'ethers';
import { useState, useEffect } from 'react';
import { useTranslation } from 'react-i18next';
import { erc721Abi } from 'viem';
import { erc721Abi, isAddress } from 'viem';
import useDisplayName from '../../../hooks/utils/useDisplayName';
import { useEthersProvider } from '../../../providers/Ethers/hooks/useEthersProvider';
import { BigNumberValuePair, ERC721TokenConfig } from '../../../types';
import { BigIntValuePair, ERC721TokenConfig } from '../../../types';
import { BarLoader } from '../../ui/loaders/BarLoader';

type TokenDetails = {
Expand All @@ -18,7 +18,7 @@ export default function AzoriusNFTDetail({
nft,
hasAddressError,
}: {
nft: ERC721TokenConfig<BigNumberValuePair>;
nft: ERC721TokenConfig<BigIntValuePair>;
hasAddressError: boolean;
}) {
const [loading, setLoading] = useState<boolean>();
Expand All @@ -36,7 +36,7 @@ export default function AzoriusNFTDetail({

setLoading(true);
try {
if (nft.tokenAddress && ethers.utils.isAddress(nft.tokenAddress)) {
if (nft.tokenAddress && isAddress(nft.tokenAddress)) {
const tokenContract = new ethers.Contract(nft.tokenAddress, erc721Abi, provider);
const [name, symbol] = await Promise.all([tokenContract.name(), tokenContract.symbol()]);
setTokenDetails({
Expand Down
Loading

0 comments on commit 57cc68f

Please sign in to comment.