Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
234 changes: 197 additions & 37 deletions abi/vault-viewer.ts
Original file line number Diff line number Diff line change
@@ -1,63 +1,137 @@
export const VaultViewerAbi = [
{
inputs: [
{ internalType: 'address', name: '_vaultHubAddress', type: 'address' },
{
internalType: 'address',
name: '_vaultHubAddress',
type: 'address',
},
],
stateMutability: 'nonpayable',
type: 'constructor',
},
{
inputs: [
{ internalType: 'uint256', name: '_from', type: 'uint256' },
{ internalType: 'uint256', name: '_to', type: 'uint256' },
{
internalType: 'uint256',
name: '_from',
type: 'uint256',
},
{
internalType: 'uint256',
name: '_to',
type: 'uint256',
},
],
name: 'WrongPaginationRange',
type: 'error',
},
{
inputs: [{ internalType: 'string', name: 'argName', type: 'string' }],
inputs: [
{
internalType: 'string',
name: 'argName',
type: 'string',
},
],
name: 'ZeroArgument',
type: 'error',
},
{
inputs: [],
name: 'DEFAULT_ADMIN_ROLE',
outputs: [{ internalType: 'bytes32', name: '', type: 'bytes32' }],
outputs: [
{
internalType: 'bytes32',
name: '',
type: 'bytes32',
},
],
stateMutability: 'view',
type: 'function',
},
{
inputs: [
{ internalType: 'contract IVault', name: 'vault', type: 'address' },
{ internalType: 'address', name: '_member', type: 'address' },
{ internalType: 'bytes32', name: '_role', type: 'bytes32' },
{
internalType: 'contract IVault',
name: 'vault',
type: 'address',
},
{
internalType: 'address',
name: '_member',
type: 'address',
},
{
internalType: 'bytes32',
name: '_role',
type: 'bytes32',
},
],
name: 'hasRole',
outputs: [{ internalType: 'bool', name: '', type: 'bool' }],
outputs: [
{
internalType: 'bool',
name: '',
type: 'bool',
},
],
stateMutability: 'view',
type: 'function',
},
{
inputs: [{ internalType: 'address', name: 'account', type: 'address' }],
inputs: [
{
internalType: 'address',
name: 'account',
type: 'address',
},
],
name: 'isContract',
outputs: [{ internalType: 'bool', name: '', type: 'bool' }],
outputs: [
{
internalType: 'bool',
name: '',
type: 'bool',
},
],
stateMutability: 'view',
type: 'function',
},
{
inputs: [
{ internalType: 'contract IVault', name: 'vault', type: 'address' },
{ internalType: 'address', name: '_owner', type: 'address' },
{
internalType: 'contract IVault',
name: 'vault',
type: 'address',
},
{
internalType: 'address',
name: '_owner',
type: 'address',
},
],
name: 'isOwner',
outputs: [{ internalType: 'bool', name: '', type: 'bool' }],
outputs: [
{
internalType: 'bool',
name: '',
type: 'bool',
},
],
stateMutability: 'view',
type: 'function',
},
{
inputs: [],
name: 'vaultHub',
outputs: [{ internalType: 'contract VaultHub', name: '', type: 'address' }],
outputs: [
{
internalType: 'contract VaultHub',
name: '',
type: 'address',
},
],
stateMutability: 'view',
type: 'function',
},
Expand All @@ -72,7 +146,7 @@ export const VaultViewerAbi = [
name: 'vaultState',
outputs: [
{
internalType: 'enum VaultDataViewer.VaultState',
internalType: 'enum VaultViewer.VaultState',
name: '',
type: 'uint8',
},
Expand All @@ -81,51 +155,117 @@ export const VaultViewerAbi = [
type: 'function',
},
{
inputs: [{ internalType: 'address', name: '_owner', type: 'address' }],
inputs: [
{
internalType: 'address',
name: '_owner',
type: 'address',
},
],
name: 'vaultsByOwner',
outputs: [
{ internalType: 'contract IVault[]', name: '', type: 'address[]' },
{
internalType: 'contract IVault[]',
name: '',
type: 'address[]',
},
],
stateMutability: 'view',
type: 'function',
},
{
inputs: [
{ internalType: 'address', name: '_owner', type: 'address' },
{ internalType: 'uint256', name: '_from', type: 'uint256' },
{ internalType: 'uint256', name: '_to', type: 'uint256' },
{
internalType: 'address',
name: '_owner',
type: 'address',
},
{
internalType: 'uint256',
name: '_from',
type: 'uint256',
},
{
internalType: 'uint256',
name: '_to',
type: 'uint256',
},
],
name: 'vaultsByOwnerBound',
outputs: [
{ internalType: 'contract IVault[]', name: '', type: 'address[]' },
{ internalType: 'uint256', name: '', type: 'uint256' },
{
internalType: 'contract IVault[]',
name: '',
type: 'address[]',
},
{
internalType: 'uint256',
name: '',
type: 'uint256',
},
],
stateMutability: 'view',
type: 'function',
},
{
inputs: [
{ internalType: 'bytes32', name: '_role', type: 'bytes32' },
{ internalType: 'address', name: '_member', type: 'address' },
{
internalType: 'bytes32',
name: '_role',
type: 'bytes32',
},
{
internalType: 'address',
name: '_member',
type: 'address',
},
],
name: 'vaultsByRole',
outputs: [
{ internalType: 'contract IVault[]', name: '', type: 'address[]' },
{
internalType: 'contract IVault[]',
name: '',
type: 'address[]',
},
],
stateMutability: 'view',
type: 'function',
},
{
inputs: [
{ internalType: 'bytes32', name: '_role', type: 'bytes32' },
{ internalType: 'address', name: '_member', type: 'address' },
{ internalType: 'uint256', name: '_from', type: 'uint256' },
{ internalType: 'uint256', name: '_to', type: 'uint256' },
{
internalType: 'bytes32',
name: '_role',
type: 'bytes32',
},
{
internalType: 'address',
name: '_member',
type: 'address',
},
{
internalType: 'uint256',
name: '_from',
type: 'uint256',
},
{
internalType: 'uint256',
name: '_to',
type: 'uint256',
},
],
name: 'vaultsByRoleBound',
outputs: [
{ internalType: 'contract IVault[]', name: '', type: 'address[]' },
{ internalType: 'uint256', name: '', type: 'uint256' },
{
internalType: 'contract IVault[]',
name: '',
type: 'address[]',
},
{
internalType: 'uint256',
name: '',
type: 'uint256',
},
],
stateMutability: 'view',
type: 'function',
Expand All @@ -134,20 +274,40 @@ export const VaultViewerAbi = [
inputs: [],
name: 'vaultsConnected',
outputs: [
{ internalType: 'contract IVault[]', name: '', type: 'address[]' },
{
internalType: 'contract IVault[]',
name: '',
type: 'address[]',
},
],
stateMutability: 'view',
type: 'function',
},
{
inputs: [
{ internalType: 'uint256', name: '_from', type: 'uint256' },
{ internalType: 'uint256', name: '_to', type: 'uint256' },
{
internalType: 'uint256',
name: '_from',
type: 'uint256',
},
{
internalType: 'uint256',
name: '_to',
type: 'uint256',
},
],
name: 'vaultsConnectedBound',
outputs: [
{ internalType: 'contract IVault[]', name: '', type: 'address[]' },
{ internalType: 'uint256', name: '', type: 'uint256' },
{
internalType: 'contract IVault[]',
name: '',
type: 'address[]',
},
{
internalType: 'uint256',
name: '',
type: 'uint256',
},
],
stateMutability: 'view',
type: 'function',
Expand Down
33 changes: 16 additions & 17 deletions features/adjustment/adjustment-tabs.tsx
Original file line number Diff line number Diff line change
@@ -1,34 +1,33 @@
import { useRouter } from 'next/router';
import { useAdjustment } from 'features/adjustment/contexts/adjustment-provider';
import { useVaultInfo } from 'features/overview/contexts';

import { ToggleSwitch } from 'shared/components/toggle';
import { Switch } from 'shared/components/switch';
import { ManifestConfigPageEnum } from 'config/external-config';

import { Mint } from './mint';
import { Repay } from './repay';
import { adjustmentToggleList } from './const';
import { FormBlock, PageWrapper } from './styles';

import { AdjustmentPaths, adjustmentToggleList } from './const';
import { ManifestConfigPageEnum } from 'config/external-config';

export const AdjustmentTabs = () => {
const router = useRouter();
const initialPath = router.query.mode as AdjustmentPaths;
const { isMintTab } = useAdjustment();
const { activeVault } = useVaultInfo();

const handleToggleCb = (value: AdjustmentPaths) => {
void router.push(
`/${activeVault?.address}/${ManifestConfigPageEnum.adjustment}/${value}`,
);
};
// TODO: improve creation of the path
const mintRoutes = [
{
path: `/${activeVault?.address}${ManifestConfigPageEnum.adjustment}/${adjustmentToggleList[0].value}`,
Comment thread
Jeday marked this conversation as resolved.
name: adjustmentToggleList[0].label,
},
{
path: `/${activeVault?.address}${ManifestConfigPageEnum.adjustment}/${adjustmentToggleList[1].value}`,
name: adjustmentToggleList[1].label,
},
];

return (
<PageWrapper>
<ToggleSwitch
options={adjustmentToggleList}
defaultActive={initialPath}
onToggle={({ value }) => handleToggleCb(value as AdjustmentPaths)}
/>
<Switch checked={!isMintTab} routes={mintRoutes} />
<FormBlock>{isMintTab ? <Mint /> : <Repay />}</FormBlock>
</PageWrapper>
);
Expand Down
Loading
Loading