Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release/0.3.3 #2362

Merged
merged 58 commits into from
Sep 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
470c5ec
Don't disable Payments when no existing Tree, and don't show tooltip …
adamgall Sep 11, 2024
ab6ac65
Update DecentHats ABI
adamgall Sep 11, 2024
f0387e1
New type for data shape required on contract for creating payments al…
adamgall Sep 11, 2024
6ae1dd8
Set up transaction data for new Hats Tree creation to include payment…
adamgall Sep 11, 2024
272da97
Bump fractal-contracts version to get access to new DecentHats address
adamgall Sep 12, 2024
ef5a442
Merge branch 'release/v0.3.2' into develop
adamgall Sep 12, 2024
2bcfcef
add check for other pending payments when calculating total amount fo…
Da-Colon Sep 13, 2024
1f314a2
Fix Snapshot proposals visualization with multiple strategies and pro…
mudrila Sep 13, 2024
b6c6284
Prettier
mudrila Sep 13, 2024
d3e264d
use deconstructed value
Da-Colon Sep 13, 2024
9197c3b
Merge pull request #2343 from decentdao/streams-on-new-hat-tree
adamgall Sep 13, 2024
0b2f25d
Merge branch 'develop' into fix/snapshot-proposal-ui-fixes
mudrila Sep 16, 2024
f49e0a1
Move call to submitProposal up into component
adamgall Sep 16, 2024
8858bee
Start to lay down some UI for sending assets from Role proposal
adamgall Sep 16, 2024
4d31de7
Merge pull request #2349 from decentdao/issue/2320-pending-payments-a…
mudrila Sep 16, 2024
fdd457c
Some additional validation and UI fixes
mudrila Sep 16, 2024
e9dc86a
Remove Send Assets modal from global thing, use it directly on Treasu…
adamgall Sep 16, 2024
2364277
Tighten up the typing in sendAssets proposal data creator helper
adamgall Sep 16, 2024
ee42148
Send Assets modal sends data back into Role Proposal component
adamgall Sep 16, 2024
93ade1a
Rename file/function and fix typing
adamgall Sep 17, 2024
ee38f25
Dependency inject the name of form submit button in Send Assets modal
adamgall Sep 17, 2024
06cba82
Use translation strings, not hardcoded english
adamgall Sep 17, 2024
35e2192
Add "actions" to the RoleFormValues formik form
adamgall Sep 17, 2024
c8f5e14
Add "send assets" actions to proposal data
adamgall Sep 17, 2024
26a186e
Function won't be undefined
adamgall Sep 17, 2024
a078b65
Only show button for Send Assets modal if Safe has fungible assets
adamgall Sep 17, 2024
0b68896
Conditionally show the Nonce Input on Send Assets modal
adamgall Sep 17, 2024
e511d0a
Fix icon color
adamgall Sep 17, 2024
414bc25
Make Send Assets row look nicer
adamgall Sep 17, 2024
ce5c0a7
Rename "Send Assets" to "Transfer Assets"
adamgall Sep 17, 2024
f5de870
Add more styling to new components
adamgall Sep 17, 2024
cc7b52f
More styling and localization updates
adamgall Sep 17, 2024
2b30993
move boxShadow to common; renamed
Da-Colon Sep 18, 2024
549a8bd
update action choice UI
Da-Colon Sep 18, 2024
773f7df
remove divide; update copy
Da-Colon Sep 18, 2024
a9ef496
adjust Action Card content
Da-Colon Sep 18, 2024
97ac521
pretty
Da-Colon Sep 18, 2024
bc80cd2
Always show the divider, for modal consistency
adamgall Sep 18, 2024
2c49a9b
Merge pull request #2350 from decentdao/fix/snapshot-proposal-ui-fixes
mudrila Sep 18, 2024
da1c7a0
Merge branch 'develop' into fix/sablier-proposal-builder
mudrila Sep 18, 2024
247b9c3
Remove log
mudrila Sep 18, 2024
81072f4
Move file
adamgall Sep 19, 2024
c55a6c0
Narrow down "size" prop on ModuleBaseProps
adamgall Sep 19, 2024
074e861
Create new components for Actions Modal and stuff
adamgall Sep 19, 2024
b8273ad
Fix disabled UI of action cards
adamgall Sep 19, 2024
8373751
Make RoleCardShort have cursor when hovered
adamgall Sep 19, 2024
db71c12
update wagmi
DarksightKellar Sep 19, 2024
eda3a45
Merge pull request #2358 from decentdao/update-wagmi
adamgall Sep 19, 2024
7d46458
Bump supported node version to latest LTS
adamgall Sep 19, 2024
8e343bb
Remove unused interface
adamgall Sep 19, 2024
5687807
Merge pull request #2351 from decentdao/add-send-assets-action-to-rol…
adamgall Sep 20, 2024
630149c
Merge pull request #2359 from decentdao/bump-node
adamgall Sep 20, 2024
ee19787
Debounce recipient input on Send Assets modal. Requires blur to work...
adamgall Sep 20, 2024
677d0f0
debounce the input
Da-Colon Sep 20, 2024
02d4c86
Merge branch 'develop' into fix-address-input-field-validation
adamgall Sep 20, 2024
80be2fe
Merge pull request #2360 from decentdao/fix-address-input-field-valid…
adamgall Sep 20, 2024
1938936
Merge pull request #2352 from decentdao/fix/sablier-proposal-builder
adamgall Sep 20, 2024
9526bb7
Bump version to 0.3.3
adamgall Sep 20, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
20.16.0
20.17.0
424 changes: 276 additions & 148 deletions package-lock.json

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "decent-interface",
"version": "0.3.2",
"version": "0.3.3",
"private": true,
"dependencies": {
"@amplitude/analytics-browser": "^2.11.1",
Expand All @@ -13,7 +13,7 @@
"@ethersproject/abstract-signer": "^5.7.0",
"@ethersproject/providers": "^5.7.2",
"@fontsource/space-mono": "^5.0.19",
"@fractal-framework/fractal-contracts": "^0.8.1",
"@fractal-framework/fractal-contracts": "^0.8.2",
"@graphprotocol/client-apollo": "^1.0.16",
"@hatsprotocol/sdk-v1-core": "^0.9.0",
"@hatsprotocol/sdk-v1-subgraph": "^1.0.0",
Expand Down Expand Up @@ -63,7 +63,7 @@
"viem": "^2.13.1",
"vite": "^5.1.0",
"vite-plugin-checker": "^0.6.4",
"wagmi": "^2.9.7",
"wagmi": "^2.12.12",
"yup": "^1",
"zustand": "^4.5.2"
},
Expand All @@ -83,8 +83,8 @@
"postinstall": "npm run graphql:build"
},
"engines": {
"node": "20.16.0",
"npm": "10.8.1"
"node": "20.17.0",
"npm": "10.8.2"
},
"browserslist": {
"production": [
Expand Down
152 changes: 152 additions & 0 deletions src/assets/abi/DecentHats_0_1_0_Abi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,82 @@ const DecentHats010Abi = [
name: 'wearer',
type: 'address',
},
{
components: [
{
internalType: 'contract ISablierV2LockupLinear',
name: 'sablier',
type: 'address',
},
{
internalType: 'address',
name: 'sender',
type: 'address',
},
{
internalType: 'uint128',
name: 'totalAmount',
type: 'uint128',
},
{
internalType: 'address',
name: 'asset',
type: 'address',
},
{
internalType: 'bool',
name: 'cancelable',
type: 'bool',
},
{
internalType: 'bool',
name: 'transferable',
type: 'bool',
},
{
components: [
{
internalType: 'uint40',
name: 'start',
type: 'uint40',
},
{
internalType: 'uint40',
name: 'cliff',
type: 'uint40',
},
{
internalType: 'uint40',
name: 'end',
type: 'uint40',
},
],
internalType: 'struct LockupLinear.Timestamps',
name: 'timestamps',
type: 'tuple',
},
{
components: [
{
internalType: 'address',
name: 'account',
type: 'address',
},
{
internalType: 'uint256',
name: 'fee',
type: 'uint256',
},
],
internalType: 'struct LockupLinear.Broker',
name: 'broker',
type: 'tuple',
},
],
internalType: 'struct DecentHats_0_1_0.SablierStreamParams[]',
name: 'sablierParams',
type: 'tuple[]',
},
],
internalType: 'struct DecentHats_0_1_0.Hat',
name: 'adminHat',
Expand Down Expand Up @@ -105,6 +181,82 @@ const DecentHats010Abi = [
name: 'wearer',
type: 'address',
},
{
components: [
{
internalType: 'contract ISablierV2LockupLinear',
name: 'sablier',
type: 'address',
},
{
internalType: 'address',
name: 'sender',
type: 'address',
},
{
internalType: 'uint128',
name: 'totalAmount',
type: 'uint128',
},
{
internalType: 'address',
name: 'asset',
type: 'address',
},
{
internalType: 'bool',
name: 'cancelable',
type: 'bool',
},
{
internalType: 'bool',
name: 'transferable',
type: 'bool',
},
{
components: [
{
internalType: 'uint40',
name: 'start',
type: 'uint40',
},
{
internalType: 'uint40',
name: 'cliff',
type: 'uint40',
},
{
internalType: 'uint40',
name: 'end',
type: 'uint40',
},
],
internalType: 'struct LockupLinear.Timestamps',
name: 'timestamps',
type: 'tuple',
},
{
components: [
{
internalType: 'address',
name: 'account',
type: 'address',
},
{
internalType: 'uint256',
name: 'fee',
type: 'uint256',
},
],
internalType: 'struct LockupLinear.Broker',
name: 'broker',
type: 'tuple',
},
],
internalType: 'struct DecentHats_0_1_0.SablierStreamParams[]',
name: 'sablierParams',
type: 'tuple[]',
},
],
internalType: 'struct DecentHats_0_1_0.Hat[]',
name: 'hats',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { GridItem, Text, Flex } from '@chakra-ui/react';
import { Flex, GridItem, Text } from '@chakra-ui/react';
import { useMemo } from 'react';
import { useTranslation } from 'react-i18next';
import useDisplayName from '../../../hooks/utils/useDisplayName';
import { useFractal } from '../../../providers/App/AppProvider';
Expand All @@ -22,6 +23,18 @@ export default function SnapshotProposalVoteItem({ proposal, vote }: ISnapshotPr
} = useFractal();

const isWeighted = proposal.type === 'weighted';
const voteSymbol = useMemo(() => {
return proposal.strategies
.filter(
(strategy, index) => !!strategy.params.symbol && vote.votingWeightByStrategy[index] > 0,
)
.map(strategy => strategy.params.symbol)
.join();
}, [proposal.strategies, vote.votingWeightByStrategy]);

const totalVoteWeightedWeight = useMemo(() => {
return vote.votingWeightByStrategy.reduce((prev, curr) => prev + curr, 0);
}, [vote.votingWeightByStrategy]);

return (
<>
Expand Down Expand Up @@ -68,12 +81,38 @@ export default function SnapshotProposalVoteItem({ proposal, vote }: ISnapshotPr
)}
</GridItem>
<GridItem>
<Text
textStyle="body-base"
color="neutral-7"
>
{vote.votingWeight} {proposal.strategies[0].params.symbol}
</Text>
{isWeighted ? (
<Flex
gap={1}
flexWrap="wrap"
>
{proposal.strategies.map((strategy, strategyIdx) => {
const choiceWeight =
(vote.votingWeightByStrategy[strategyIdx] / totalVoteWeightedWeight) *
vote.votingWeight;
if (!choiceWeight) {
return null;
}
return (
<StatusBox key={strategyIdx}>
<Text
textStyle="body-base"
color="neutral-7"
>
{choiceWeight} {strategy.params.symbol}
</Text>
</StatusBox>
);
})}
</Flex>
) : (
<Text
textStyle="body-base"
color="neutral-7"
>
{vote.votingWeight} {voteSymbol}
</Text>
)}
</GridItem>
</>
);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { Flex, Grid, GridItem, Text } from '@chakra-ui/react';
import { Box, Flex, Grid, GridItem, Text } from '@chakra-ui/react';
import { useTranslation } from 'react-i18next';
import { ExtendedSnapshotProposal, FractalProposalState } from '../../../types';
import StatusBox from '../../ui/badges/StatusBox';
import ContentBox from '../../ui/containers/ContentBox';
import { ProposalCountdown } from '../../ui/proposal/ProposalCountdown';
import Divider from '../../ui/utils/Divider';
Expand All @@ -16,7 +17,6 @@ export default function SnapshotProposalVotes({ proposal }: ISnapshotProposalVot
const { t } = useTranslation('proposal');
const { totalVotesCasted } = useTotalVotes({ proposal });
const { votes, votesBreakdown, choices, strategies, privacy, state, type } = proposal;
const strategySymbol = strategies[0].params.symbol;

return (
<>
Expand All @@ -41,7 +41,19 @@ export default function SnapshotProposalVotes({ proposal }: ISnapshotProposalVot
ml={1}
textStyle="display-lg"
>
{totalVotesCasted} {strategySymbol}
{totalVotesCasted}
{strategies.map((strategy, index) =>
strategy.params.symbol ? (
<Box
mx={1}
key={index}
display="inline-block"
as="span"
>
<StatusBox>{strategy.params.symbol}</StatusBox>
</Box>
) : null,
)}
</Text>
</Flex>
</Flex>
Expand All @@ -58,7 +70,7 @@ export default function SnapshotProposalVotes({ proposal }: ISnapshotProposalVot
? votesBreakdownChoice?.total
: 0;
const choicePercentageFromTotal =
(votesBreakdownChoiceTotal * 100) / totalVotesCasted;
totalVotesCasted > 0 ? (votesBreakdownChoiceTotal * 100) / totalVotesCasted : 0;

return (
<VotesPercentage
Expand Down
59 changes: 0 additions & 59 deletions src/components/pages/DAOTreasury/sendAssets.ts

This file was deleted.

Loading