Skip to content

Commit

Permalink
show v1 and v2 delegate factory in stats
Browse files Browse the repository at this point in the history
  • Loading branch information
tyler17 committed Oct 24, 2024
1 parent aadf438 commit 4887d8f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
1 change: 1 addition & 0 deletions modules/contracts/eth-sdk.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ const config: EthSdkConfig = {
pot: '0x197E90f9FAD81970bA7976f33CbD77088E5D7cf7',
vat: '0x35D1b3F3D7966A1DFe207aa4514C12a259A0492B',
voteDelegateFactory: '0xC3D809E87A2C9da4F6d98fECea9135d834d6F5A0',
voteDelegateFactoryOld: '0xD897F108670903D1d6070fcf818f9db3615AF272',
voteProxyFactory: '0x6FCD258af181B3221073A96dD90D1f7AE7eEc408',
voteProxyFactoryOld: '0xa63E145309cadaa6A903a19993868Ef7E85058BE',
vow: '0xA950524441892A31ebddF91d3cEEFa04Bf454466'
Expand Down
15 changes: 13 additions & 2 deletions modules/delegates/components/DelegatesSystemInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export function DelegatesSystemInfo({
className?: string;
}): React.ReactElement {
const delegateFactoryAddress = useContractAddress('voteDelegateFactory');
const oldDelegateFactoryAddress = useContractAddress('voteDelegateFactoryOld');
const { network } = useWeb3();

const { data: totalMkr } = useTotalSupply(Tokens.MKR);
Expand Down Expand Up @@ -64,7 +65,7 @@ export function DelegatesSystemInfo({
)
},
{
title: 'Total Delegators',
title: 'Total delegators',
id: 'total-delegators-system-info',
value: stats.totalDelegators
}
Expand All @@ -78,7 +79,7 @@ export function DelegatesSystemInfo({
<Card variant="compact">
<StackLayout gap={3}>
<Flex sx={{ justifyContent: 'space-between', flexDirection: 'row' }}>
<Text sx={{ fontSize: 3, color: 'textSecondary' }}>Delegate Factory</Text>
<Text sx={{ fontSize: 3, color: 'textSecondary' }}>V2 delegate factory</Text>
{delegateFactoryAddress ? (
<EtherscanLink type="address" showAddress hash={delegateFactoryAddress} network={network} />
) : (
Expand All @@ -87,6 +88,16 @@ export function DelegatesSystemInfo({
</Box>
)}
</Flex>
<Flex sx={{ justifyContent: 'space-between', flexDirection: 'row' }}>
<Text sx={{ fontSize: 3, color: 'textSecondary' }}>V1 delegate factory</Text>
{oldDelegateFactoryAddress ? (
<EtherscanLink type="address" showAddress hash={oldDelegateFactoryAddress} network={network} />
) : (
<Box sx={{ width: 6 }}>
<SkeletonThemed />
</Box>
)}
</Flex>
{statsItems.map(item => (
<Flex key={item.id} sx={{ justifyContent: 'space-between', flexDirection: 'row' }}>
<Text sx={{ fontSize: 3, color: 'textSecondary' }}>{item.title}</Text>
Expand Down

0 comments on commit 4887d8f

Please sign in to comment.