From 0c7337231f3d575c1ea4c5a62d007532e5cfba82 Mon Sep 17 00:00:00 2001 From: Gerald Host Date: Wed, 19 Apr 2023 13:16:57 +0100 Subject: [PATCH 01/77] feat: spruce --- .gitignore | 2 + package.json | 6 +- public/images/CheckIcon.svg | 3 + src/App.jsx | 75 +- src/App.routes.js | 13 +- src/Routes.jsx | 19 +- src/abis/bridgedToken.json | 600 +++++++++ src/abis/v2/uToken.json | 1088 +++++++++++++---- src/abis/v2/userManager.json | 955 ++++++++++++--- src/components/VouchFaucetButton.jsx | 2 - src/components/connect/Banner.jsx | 4 +- src/components/connect/Banner.scss | 9 +- src/components/connect/NetworkSelect.jsx | 105 +- src/components/connect/NetworkSelect.scss | 24 +- .../connect/NetworkSelectOption.jsx | 58 +- .../connect/NetworkSelectOption.scss | 20 +- src/components/contacts/ContactDetails.jsx | 247 ---- src/components/contacts/ContactList.jsx | 360 +++--- src/components/contacts/ContactList.scss | 46 + .../ContactsTable/ContactsFilterControls.jsx | 41 + .../ContactsTable/ContactsTableHead.jsx | 22 + .../ContactsTable/ContactsTypeToggle.jsx | 30 + .../ContactsTable/DesktopContactsTable.jsx | 68 ++ .../ContactsTable/DimmableTableCell.jsx | 16 + .../ContactsTable/DimmableTableCell.scss | 7 + .../ContactsTable/MobileColumnToggle.jsx | 125 ++ .../ContactsTable/MobileColumnToggle.scss | 68 ++ .../ContactsTable/MobileContactsTable.jsx | 76 ++ .../ContactsTable/ProvidingTableRow.jsx | 139 +++ .../ContactsTable/ProvidingTableRow.scss | 14 + .../ContactsTable/ReceivingTableRow.jsx | 116 ++ .../contacts/ContactsTable/index.js | 4 + src/components/contacts/Filters.jsx | 83 -- src/components/contacts/FiltersPopover.jsx | 91 ++ src/components/contacts/FiltersPopover.scss | 16 + src/components/credit/ActivityTable.jsx | 16 + src/components/credit/CreditStats.jsx | 218 ++-- src/components/credit/CreditStats.scss | 47 + .../credit/MyTransactionHistory.jsx | 18 - src/components/credit/ShareCard.jsx | 4 +- src/components/credit/VouchersCard.jsx | 13 +- src/components/credit/VouchersOverview.jsx | 145 +++ src/components/credit/VouchersOverview.scss | 49 + .../{governance => dao}/GovernanceStats.jsx | 43 +- src/components/dao/LeaderboardTable.jsx | 119 ++ src/components/dao/LeaderboardTable.scss | 7 + src/components/dao/LeaderboardTableRow.jsx | 43 + src/components/dao/MyGovernanceStats.jsx | 182 +++ src/components/dao/MyGovernanceStats.scss | 27 + .../ProposalHistoryCard.jsx | 0 src/components/dao/ProposalVotes.jsx | 65 + src/components/dao/ProposalsCard.jsx | 99 ++ .../dao/protocol/GovernanceOverview.jsx | 72 ++ src/components/dao/protocol/ProposalData.jsx | 45 + .../dao/protocol/ProposalStages.jsx | 73 ++ .../dao/protocol/ProtocolBalances.jsx | 77 ++ src/components/dao/protocol/ProtocolData.jsx | 49 + src/components/dao/protocol/ProtocolData.scss | 56 + .../dao/protocol/ProtocolDataHeader.jsx | 20 + .../dao/protocol/ProtocolDataHeader.scss | 6 + src/components/dao/protocol/ProtocolFees.jsx | 48 + .../dao/protocol/ProtocolLimits.jsx | 42 + .../dao/protocol/ProtocolPeriods.jsx | 52 + .../governance/MyGovernanceStats.jsx | 113 -- src/components/governance/NetworkNotice.jsx | 42 - src/components/governance/ProposalsCard.jsx | 96 -- src/components/governance/VotingCard.jsx | 115 -- src/components/modals/AccountModal.jsx | 67 +- src/components/modals/AccountModal.scss | 2 + src/components/modals/BorrowModal.jsx | 138 ++- src/components/modals/DelegateModal.jsx | 70 +- src/components/modals/EditVouch.jsx | 123 +- src/components/modals/ManageContactModal.jsx | 147 +-- src/components/modals/ManageContactModal.scss | 56 + .../ManageContactModal/ContactDetailsTab.jsx | 236 ++++ .../ManageContactModal/ContactDetailsTab.scss | 20 + .../CreditDetailsHeader.jsx | 44 + .../CreditDetailsHeader.scss | 7 + .../modals/NewMemberModalHeader.jsx | 81 -- .../modals/NewMemberModalHeader.scss | 31 - .../modals/PaymentReminderModal.jsx | 117 -- src/components/modals/RepayModal.jsx | 235 ++-- src/components/modals/Repaymodal.scss | 14 + src/components/modals/StakeModal.jsx | 118 +- src/components/modals/StakeModal.scss | 5 - src/components/modals/VouchLinkModal.jsx | 97 ++ src/components/modals/VouchModal.jsx | 148 ++- src/components/modals/VouchModal.scss | 33 - src/components/modals/WalletModal.jsx | 80 +- src/components/modals/WelcomeModal.jsx | 136 +++ src/components/modals/WelcomeModal.scss | 23 + src/components/modals/WriteOffDebtModal.jsx | 146 ++- .../profile/ProfileGovernanceStats.jsx | 32 +- src/components/register/RegisterButton.jsx | 53 +- src/components/register/StakeStep.jsx | 186 ++- src/components/register/StakeStep.scss | 27 +- src/components/register/VouchersStep.jsx | 84 +- src/components/register/VouchersStep.scss | 36 +- src/components/shared/AddressInput.jsx | 23 +- src/components/shared/AddressLabelBox.jsx | 25 + src/components/shared/AddressLabelBox.scss | 7 + src/components/shared/AddressSummary.jsx | 36 +- .../shared/AddressesAvatarBadgeRow.jsx | 10 + src/components/shared/Approval.jsx | 2 +- src/components/shared/Avatar.jsx | 2 +- src/components/shared/BlockRelativeTime.jsx | 30 - src/components/shared/ConnectButton.jsx | 12 +- .../shared/CreditSegmentedControl.jsx | 44 + .../shared/CreditSegmentedControl.scss | 15 + src/components/shared/DaoSegmentedControl.jsx | 44 + .../shared/DaoSegmentedControl.scss | 18 + src/components/shared/EditLabel.jsx | 26 +- src/components/shared/Header.jsx | 194 +-- src/components/shared/Header.scss | 69 +- src/components/shared/HeaderMobileMenu.jsx | 35 + src/components/shared/HeaderMobileMenu.scss | 60 + src/components/shared/NetworkSelect.jsx | 4 +- src/components/shared/OverdueAlert.jsx | 35 - src/components/shared/PrimaryLabel.jsx | 2 +- src/components/shared/SortableTableHead.jsx | 29 + src/components/shared/StatusBadge.jsx | 2 +- .../shared/TransactionHistory/Address.jsx | 23 + .../TransactionHistory/TransactionHistory.jsx | 75 ++ .../TransactionHistory.scss} | 4 +- .../TransactionHistoryRow.jsx | 62 + .../TransactionHistory/TransactionIcon.jsx | 47 + .../shared/TransactionHistory/index.js | 2 + src/components/shared/TxHistory.jsx | 180 --- src/components/shared/index.js | 14 + src/components/stake/BorrowersCard.jsx | 69 +- src/components/stake/NewVouchCard.jsx | 24 - src/components/stake/RewardStats.jsx | 111 ++ src/components/stake/RewardStats.scss | 34 + src/components/stake/StakeStats.jsx | 219 ++-- src/components/stake/StakeStats.scss | 53 + src/config/contracts/arbitrum.js | 14 +- src/config/contracts/mainnet.js | 6 + src/config/navigation.js | 43 +- src/constants.js | 30 +- src/fetchers/fetchVoteCasts.js | 21 + src/hooks/useBalance.js | 11 + src/hooks/useBlockTime.js | 31 + src/hooks/useContract.js | 2 + src/hooks/useCopyToClipboard.js | 2 +- src/hooks/useFirstPaymentDueDate.js | 7 +- src/hooks/useForm.js | 1 + src/hooks/useLastRepayData.js | 54 + src/hooks/usePollMember.js | 54 +- src/hooks/useRelatedAddresses.js | 4 +- src/hooks/useRepayBlockNumber.js | 8 + .../{useIsMobile.js => useResponsive.js} | 9 +- src/hooks/useScrollLock.js | 11 + src/hooks/useVoteCasts.js | 32 + src/hooks/useVoters.js | 76 ++ src/hooks/useWindowDimensions.js | 26 + src/images/BothRow.svg | 3 + src/images/ProvidingRow.svg | 3 + src/images/ReceivingRow.svg | 3 + src/index.scss | 32 +- src/pages/Connect.jsx | 65 +- src/pages/Connect.scss | 15 +- src/pages/Contacts.jsx | 73 +- src/pages/Credit.jsx | 42 +- src/pages/Error.jsx | 44 +- src/pages/Error.scss | 8 + src/pages/Governance.jsx | 48 +- src/pages/Leaderboard.jsx | 50 + src/pages/Profile.jsx | 48 +- src/pages/Proposal.jsx | 63 +- src/pages/Proposals.jsx | 39 - src/pages/Protocol.jsx | 22 + src/pages/Register.jsx | 75 +- src/pages/Register.scss | 39 +- src/pages/Stake.jsx | 23 +- src/providers/MemberData.jsx | 2 +- src/providers/ModalManager.jsx | 26 +- src/providers/ProtocolData.jsx | 29 +- src/providers/Toasts.jsx | 25 +- src/providers/VoucheesData.jsx | 4 + src/providers/VouchersData.jsx | 4 + src/utils/date.js | 16 + src/utils/dueDate.js | 83 +- src/utils/format.js | 28 +- src/utils/generateLinks.js | 4 +- src/utils/numbers.js | 22 +- src/utils/sum.js | 3 + src/variables.scss | 2 + yarn.lock | 37 +- 188 files changed, 8632 insertions(+), 3576 deletions(-) create mode 100644 public/images/CheckIcon.svg create mode 100644 src/abis/bridgedToken.json delete mode 100644 src/components/contacts/ContactDetails.jsx create mode 100644 src/components/contacts/ContactList.scss create mode 100644 src/components/contacts/ContactsTable/ContactsFilterControls.jsx create mode 100644 src/components/contacts/ContactsTable/ContactsTableHead.jsx create mode 100644 src/components/contacts/ContactsTable/ContactsTypeToggle.jsx create mode 100644 src/components/contacts/ContactsTable/DesktopContactsTable.jsx create mode 100644 src/components/contacts/ContactsTable/DimmableTableCell.jsx create mode 100644 src/components/contacts/ContactsTable/DimmableTableCell.scss create mode 100644 src/components/contacts/ContactsTable/MobileColumnToggle.jsx create mode 100644 src/components/contacts/ContactsTable/MobileColumnToggle.scss create mode 100644 src/components/contacts/ContactsTable/MobileContactsTable.jsx create mode 100644 src/components/contacts/ContactsTable/ProvidingTableRow.jsx create mode 100644 src/components/contacts/ContactsTable/ProvidingTableRow.scss create mode 100644 src/components/contacts/ContactsTable/ReceivingTableRow.jsx create mode 100644 src/components/contacts/ContactsTable/index.js delete mode 100644 src/components/contacts/Filters.jsx create mode 100644 src/components/contacts/FiltersPopover.jsx create mode 100644 src/components/contacts/FiltersPopover.scss create mode 100644 src/components/credit/ActivityTable.jsx create mode 100644 src/components/credit/CreditStats.scss delete mode 100644 src/components/credit/MyTransactionHistory.jsx create mode 100644 src/components/credit/VouchersOverview.jsx create mode 100644 src/components/credit/VouchersOverview.scss rename src/components/{governance => dao}/GovernanceStats.jsx (76%) create mode 100644 src/components/dao/LeaderboardTable.jsx create mode 100644 src/components/dao/LeaderboardTable.scss create mode 100644 src/components/dao/LeaderboardTableRow.jsx create mode 100644 src/components/dao/MyGovernanceStats.jsx create mode 100644 src/components/dao/MyGovernanceStats.scss rename src/components/{governance => dao}/ProposalHistoryCard.jsx (100%) create mode 100644 src/components/dao/ProposalVotes.jsx create mode 100644 src/components/dao/ProposalsCard.jsx create mode 100644 src/components/dao/protocol/GovernanceOverview.jsx create mode 100644 src/components/dao/protocol/ProposalData.jsx create mode 100644 src/components/dao/protocol/ProposalStages.jsx create mode 100644 src/components/dao/protocol/ProtocolBalances.jsx create mode 100644 src/components/dao/protocol/ProtocolData.jsx create mode 100644 src/components/dao/protocol/ProtocolData.scss create mode 100644 src/components/dao/protocol/ProtocolDataHeader.jsx create mode 100644 src/components/dao/protocol/ProtocolDataHeader.scss create mode 100644 src/components/dao/protocol/ProtocolFees.jsx create mode 100644 src/components/dao/protocol/ProtocolLimits.jsx create mode 100644 src/components/dao/protocol/ProtocolPeriods.jsx delete mode 100644 src/components/governance/MyGovernanceStats.jsx delete mode 100644 src/components/governance/NetworkNotice.jsx delete mode 100644 src/components/governance/ProposalsCard.jsx delete mode 100644 src/components/governance/VotingCard.jsx create mode 100644 src/components/modals/ManageContactModal.scss create mode 100644 src/components/modals/ManageContactModal/ContactDetailsTab.jsx create mode 100644 src/components/modals/ManageContactModal/ContactDetailsTab.scss create mode 100644 src/components/modals/ManageContactModal/CreditDetailsHeader.jsx create mode 100644 src/components/modals/ManageContactModal/CreditDetailsHeader.scss delete mode 100644 src/components/modals/NewMemberModalHeader.jsx delete mode 100644 src/components/modals/NewMemberModalHeader.scss delete mode 100644 src/components/modals/PaymentReminderModal.jsx create mode 100644 src/components/modals/Repaymodal.scss delete mode 100644 src/components/modals/StakeModal.scss create mode 100644 src/components/modals/VouchLinkModal.jsx delete mode 100644 src/components/modals/VouchModal.scss create mode 100644 src/components/modals/WelcomeModal.jsx create mode 100644 src/components/modals/WelcomeModal.scss create mode 100644 src/components/shared/AddressLabelBox.jsx create mode 100644 src/components/shared/AddressLabelBox.scss create mode 100644 src/components/shared/AddressesAvatarBadgeRow.jsx delete mode 100644 src/components/shared/BlockRelativeTime.jsx create mode 100644 src/components/shared/CreditSegmentedControl.jsx create mode 100644 src/components/shared/CreditSegmentedControl.scss create mode 100644 src/components/shared/DaoSegmentedControl.jsx create mode 100644 src/components/shared/DaoSegmentedControl.scss create mode 100644 src/components/shared/HeaderMobileMenu.jsx create mode 100644 src/components/shared/HeaderMobileMenu.scss delete mode 100644 src/components/shared/OverdueAlert.jsx create mode 100644 src/components/shared/SortableTableHead.jsx create mode 100644 src/components/shared/TransactionHistory/Address.jsx create mode 100644 src/components/shared/TransactionHistory/TransactionHistory.jsx rename src/components/shared/{TxHistory.scss => TransactionHistory/TransactionHistory.scss} (87%) create mode 100644 src/components/shared/TransactionHistory/TransactionHistoryRow.jsx create mode 100644 src/components/shared/TransactionHistory/TransactionIcon.jsx create mode 100644 src/components/shared/TransactionHistory/index.js delete mode 100644 src/components/shared/TxHistory.jsx create mode 100644 src/components/shared/index.js delete mode 100644 src/components/stake/NewVouchCard.jsx create mode 100644 src/components/stake/RewardStats.jsx create mode 100644 src/components/stake/RewardStats.scss create mode 100644 src/components/stake/StakeStats.scss create mode 100644 src/fetchers/fetchVoteCasts.js create mode 100644 src/hooks/useBalance.js create mode 100644 src/hooks/useBlockTime.js create mode 100644 src/hooks/useLastRepayData.js create mode 100644 src/hooks/useRepayBlockNumber.js rename src/hooks/{useIsMobile.js => useResponsive.js} (80%) create mode 100644 src/hooks/useScrollLock.js create mode 100644 src/hooks/useVoteCasts.js create mode 100644 src/hooks/useVoters.js create mode 100644 src/hooks/useWindowDimensions.js create mode 100644 src/images/BothRow.svg create mode 100644 src/images/ProvidingRow.svg create mode 100644 src/images/ReceivingRow.svg create mode 100644 src/pages/Error.scss create mode 100644 src/pages/Leaderboard.jsx delete mode 100644 src/pages/Proposals.jsx create mode 100644 src/pages/Protocol.jsx create mode 100644 src/utils/date.js create mode 100644 src/utils/sum.js diff --git a/.gitignore b/.gitignore index b59ec02d..4835011a 100644 --- a/.gitignore +++ b/.gitignore @@ -22,3 +22,5 @@ npm-debug.log* yarn-debug.log* yarn-error.log* .env +yalc.lock +.yalc/ \ No newline at end of file diff --git a/package.json b/package.json index 1061a196..12e3d94e 100644 --- a/package.json +++ b/package.json @@ -7,10 +7,11 @@ "@testing-library/jest-dom": "^5.16.5", "@testing-library/react": "^13.4.0", "@testing-library/user-event": "^13.5.0", - "@unioncredit/ui": "0.3.0-beta.29", + "@unioncredit/ui": "^0.4.7", "add-event-to-calendar": "^1.0.7", "buffer": "^6.0.3", "classnames": "^2.3.2", + "date-fns": "^2.29.3", "dayjs": "^1.11.6", "ethereum-blockies-base64": "^1.0.2", "ethers": "^5.7.2", @@ -19,11 +20,12 @@ "js-confetti": "^0.11.0", "lodash": "^4.17.21", "prettier": "^2.7.1", - "qrcode.react": "^3.1.0", "react": "18.2.0", "react-dom": "18.2.0", + "react-error-boundary": "^3.1.4", "react-helmet": "^6.1.0", "react-markdown": "5.0.3", + "react-minimal-pie-chart": "^8.4.0", "react-router-dom": "^6.4.2", "react-scripts": "5.0.1", "sass": "^1.55.0", diff --git a/public/images/CheckIcon.svg b/public/images/CheckIcon.svg new file mode 100644 index 00000000..19b20ba9 --- /dev/null +++ b/public/images/CheckIcon.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/App.jsx b/src/App.jsx index e76f4c0a..4214a5ef 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -1,12 +1,13 @@ import { useEffect } from "react"; import { useAccount, useNetwork } from "wagmi"; -import { Box, Label, Layout, Grid } from "@unioncredit/ui"; +import { Box, Text, Layout, Grid } from "@unioncredit/ui"; import { matchRoutes, useLocation } from "react-router-dom"; +import { ErrorBoundary } from "react-error-boundary"; import Routes from "./Routes"; import ConnectPage from "pages/Connect"; -import Header from "components/shared/Header"; +import { Header } from "components/shared/Header"; import { general as generalRoutes } from "App.routes"; import ScrollToTop from "components/misc/ScrollToTop"; @@ -22,6 +23,7 @@ import MemberData, { useMember } from "providers/MemberData"; import { isVersionSupported, useVersion } from "providers/Version"; import Settings from "providers/Settings"; import useChainParams from "hooks/useChainParams"; +import ErrorPage from "pages/Error"; /** * Shim component that checks if the App is ready @@ -49,6 +51,7 @@ function AppReadyShim({ children }) { } if (chain && appReady && (isDisconnected || chain?.unsupported)) { + setAppReady(false); return; } @@ -92,10 +95,13 @@ export default function App() { +
- + + + @@ -109,43 +115,50 @@ export default function App() { - - - - - - - - - - - - + + + + + + + + + +
+ + + + {appReady ? ( <> -
- + + + + + ) : ( )} - - - - - - - - - - - - + + + + + + + + + + + + - + diff --git a/src/App.routes.js b/src/App.routes.js index d423eff6..34c3feb1 100644 --- a/src/App.routes.js +++ b/src/App.routes.js @@ -1,20 +1,22 @@ -import { ContactsType } from "constants"; +import { ContactsType, Links } from "constants"; import ContactsPage from "pages/Contacts"; import GovernancePage from "pages/Governance"; -import ProposalsPage from "pages/Proposals"; import ProposalPage from "pages/Proposal"; import ProfilePage from "pages/Profile"; import RegisterPage from "pages/Register"; import CreditPage from "pages/Credit"; import StakePage from "pages/Stake"; +import LeaderboardPage from "pages/Leaderboard"; +import ProtocolPage from "pages/Protocol"; // prettier-ignore export const member = [ { path: "/", component: CreditPage, props: {} }, { path: "/stake", component: StakePage, props: {} }, { path: "/contacts", component: ContactsPage, props: { type: ContactsType.VOUCHEES } }, - { path: "/contacts/trusts-you", component: ContactsPage, props: { type: ContactsType.VOUCHERS } }, + { path: "/contacts/providing", component: ContactsPage, props: { type: ContactsType.VOUCHEES } }, + { path: "/contacts/receiving", component: ContactsPage, props: { type: ContactsType.VOUCHERS } }, ] // prettier-ignore @@ -25,7 +27,8 @@ export const nonMember = [ // prettier-ignore export const general = [ { path: "/profile/:addressOrEns", component: ProfilePage, props: {} }, - { path: "/governance", component: GovernancePage, props: { type: ContactsType.VOUCHERS } }, - { path: "/governance/proposals", component: ProposalsPage, props: {} }, + { path: Links.GOVERNANCE, component: GovernancePage, props: { type: ContactsType.VOUCHERS } }, + { path: Links.PROTOCOL, component: ProtocolPage, props: {} }, { path: "/governance/proposals/:hash", component: ProposalPage, props: {} }, + { path: Links.LEADERBOARD, component: LeaderboardPage, props: {} }, ] diff --git a/src/Routes.jsx b/src/Routes.jsx index 2b064e3b..f3096dba 100644 --- a/src/Routes.jsx +++ b/src/Routes.jsx @@ -10,7 +10,6 @@ import { useAccount } from "wagmi"; import * as routes from "./App.routes"; import { useMember } from "providers/MemberData"; -import ErrorPage from "pages/Error"; import LoadingPage from "pages/Loading"; export default function Routes() { @@ -73,20 +72,10 @@ export default function Routes() { - - { - // If we are on a valid route but we have made it to the - // fallback we should redirect the user to the app root / - } - {matchRoutes( - [...routes.member, ...routes.nonMember, ...routes.general], - location - ) && } - + matchRoutes( + [...routes.member, ...routes.nonMember, ...routes.general], + location + ) && } /> diff --git a/src/abis/bridgedToken.json b/src/abis/bridgedToken.json new file mode 100644 index 00000000..4c53ab6c --- /dev/null +++ b/src/abis/bridgedToken.json @@ -0,0 +1,600 @@ +[ + { + "inputs": [ + { + "internalType": "address", + "name": "_l2Gateway", + "type": "address" + }, + { + "internalType": "address", + "name": "_l1TokenAddress", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Transfer", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "_account", + "type": "address" + } + ], + "name": "Unwhitelisted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [], + "name": "WhitelistDisabled", + "type": "event" + }, + { + "anonymous": false, + "inputs": [], + "name": "WhitelistEnabled", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "_account", + "type": "address" + } + ], + "name": "Whitelisted", + "type": "event" + }, + { + "inputs": [], + "name": "DOMAIN_SEPARATOR", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + } + ], + "name": "allowance", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "approve", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "balanceOf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "bridgeBurn", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "bridgeMint", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "decimals", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "subtractedValue", + "type": "uint256" + } + ], + "name": "decreaseAllowance", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "disableWhitelist", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "enableWhitelist", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "getChainId", + "outputs": [ + { + "internalType": "uint256", + "name": "chainId", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "addedValue", + "type": "uint256" + } + ], + "name": "increaseAllowance", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + } + ], + "name": "isWhitelisted", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "l1Address", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "l2Gateway", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "nonces", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + }, + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + } + ], + "name": "permit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "symbol", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transfer", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transferFrom", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + } + ], + "name": "unwhitelist", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + } + ], + "name": "whitelist", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "whitelistEnabled", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + } +] \ No newline at end of file diff --git a/src/abis/v2/uToken.json b/src/abis/v2/uToken.json index 9a840db7..1a6f311e 100644 --- a/src/abis/v2/uToken.json +++ b/src/abis/v2/uToken.json @@ -1,27 +1,114 @@ [ - { "inputs": [], "name": "AccrueBlockParity", "type": "error" }, - { "inputs": [], "name": "AccrueInterestFailed", "type": "error" }, - { "inputs": [], "name": "AmountError", "type": "error" }, - { "inputs": [], "name": "AmountExceedGlobalMax", "type": "error" }, - { "inputs": [], "name": "AmountExceedMaxBorrow", "type": "error" }, - { "inputs": [], "name": "AmountLessMinBorrow", "type": "error" }, - { "inputs": [], "name": "AmountZero", "type": "error" }, - { "inputs": [], "name": "BorrowRateExceedLimit", "type": "error" }, - { "inputs": [], "name": "CallerNotMember", "type": "error" }, - { "inputs": [], "name": "CallerNotUserManager", "type": "error" }, - { "inputs": [], "name": "DepositToAssetManagerFailed", "type": "error" }, - { "inputs": [], "name": "InitExchangeRateNotZero", "type": "error" }, - { "inputs": [], "name": "InsufficientFundsLeft", "type": "error" }, - { "inputs": [], "name": "MemberIsOverdue", "type": "error" }, - { "inputs": [], "name": "MintFeeError", "type": "error" }, - { "inputs": [], "name": "NotPaused", "type": "error" }, - { "inputs": [], "name": "OriginationFeeExceedLimit", "type": "error" }, - { "inputs": [], "name": "Paused", "type": "error" }, - { "inputs": [], "name": "ReserveFactoryExceedLimit", "type": "error" }, - { "inputs": [], "name": "SenderNotAdmin", "type": "error" }, - { "inputs": [], "name": "SenderNotGuardian", "type": "error" }, - { "inputs": [], "name": "SenderNotPendingAdmin", "type": "error" }, - { "inputs": [], "name": "WithdrawFailed", "type": "error" }, + { + "inputs": [], + "name": "AccrueBlockParity", + "type": "error" + }, + { + "inputs": [], + "name": "AccrueInterestFailed", + "type": "error" + }, + { + "inputs": [], + "name": "AmountError", + "type": "error" + }, + { + "inputs": [], + "name": "AmountExceedGlobalMax", + "type": "error" + }, + { + "inputs": [], + "name": "AmountExceedMaxBorrow", + "type": "error" + }, + { + "inputs": [], + "name": "AmountLessMinBorrow", + "type": "error" + }, + { + "inputs": [], + "name": "AmountZero", + "type": "error" + }, + { + "inputs": [], + "name": "BorrowRateExceedLimit", + "type": "error" + }, + { + "inputs": [], + "name": "CallerNotMember", + "type": "error" + }, + { + "inputs": [], + "name": "CallerNotUserManager", + "type": "error" + }, + { + "inputs": [], + "name": "DepositToAssetManagerFailed", + "type": "error" + }, + { + "inputs": [], + "name": "InitExchangeRateNotZero", + "type": "error" + }, + { + "inputs": [], + "name": "InsufficientFundsLeft", + "type": "error" + }, + { + "inputs": [], + "name": "MemberIsOverdue", + "type": "error" + }, + { + "inputs": [], + "name": "NotPaused", + "type": "error" + }, + { + "inputs": [], + "name": "OriginationFeeExceedLimit", + "type": "error" + }, + { + "inputs": [], + "name": "Paused", + "type": "error" + }, + { + "inputs": [], + "name": "ReserveFactoryExceedLimit", + "type": "error" + }, + { + "inputs": [], + "name": "SenderNotAdmin", + "type": "error" + }, + { + "inputs": [], + "name": "SenderNotGuardian", + "type": "error" + }, + { + "inputs": [], + "name": "SenderNotPendingAdmin", + "type": "error" + }, + { + "inputs": [], + "name": "WithdrawFailed", + "type": "error" + }, { "anonymous": false, "inputs": [ @@ -79,19 +166,6 @@ "name": "BeaconUpgraded", "type": "event" }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint8", - "name": "version", - "type": "uint8" - } - ], - "name": "Initialized", - "type": "event" - }, { "anonymous": false, "inputs": [ @@ -148,25 +222,6 @@ "name": "LogMint", "type": "event" }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "oldRate", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "newRate", - "type": "uint256" - } - ], - "name": "LogMintFeeRateChanged", - "type": "event" - }, { "anonymous": false, "inputs": [ @@ -220,12 +275,6 @@ "name": "amountOut", "type": "uint256" }, - { - "indexed": false, - "internalType": "uint256", - "name": "uTokenAmount", - "type": "uint256" - }, { "indexed": false, "internalType": "uint256", @@ -365,77 +414,103 @@ { "inputs": [], "name": "DOMAIN_SEPARATOR", - "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], "stateMutability": "view", "type": "function" }, { "inputs": [], - "name": "MIN_MINT_AMOUNT", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "name": "WAD", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], "stateMutability": "view", "type": "function" }, { - "inputs": [], - "name": "WAD", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", + "inputs": [ + { + "internalType": "address", + "name": "admin_", + "type": "address" + } + ], + "name": "__Controller_init", + "outputs": [], + "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { - "components": [ - { "internalType": "string", "name": "name", "type": "string" }, - { "internalType": "string", "name": "symbol", "type": "string" }, - { - "internalType": "address", - "name": "underlying", - "type": "address" - }, - { - "internalType": "uint256", - "name": "initialExchangeRateMantissa", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "reserveFactorMantissa", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "originationFee", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "originationFeeMax", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "debtCeiling", - "type": "uint256" - }, - { "internalType": "uint256", "name": "maxBorrow", "type": "uint256" }, - { "internalType": "uint256", "name": "minBorrow", "type": "uint256" }, - { - "internalType": "uint256", - "name": "overdueTime", - "type": "uint256" - }, - { "internalType": "address", "name": "admin", "type": "address" }, - { - "internalType": "uint256", - "name": "mintFeeRate", - "type": "uint256" - } - ], - "internalType": "struct UToken.InitParams", - "name": "params", - "type": "tuple" + "internalType": "string", + "name": "name_", + "type": "string" + }, + { + "internalType": "string", + "name": "symbol_", + "type": "string" + }, + { + "internalType": "address", + "name": "underlying_", + "type": "address" + }, + { + "internalType": "uint256", + "name": "initialExchangeRateMantissa_", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "reserveFactorMantissa_", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "originationFee_", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "originationFeeMax_", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "debtCeiling_", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxBorrow_", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minBorrow_", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "overdueBlocks_", + "type": "uint256" + }, + { + "internalType": "address", + "name": "admin_", + "type": "address" } ], "name": "__UToken_init", @@ -452,21 +527,37 @@ }, { "inputs": [], - "name": "accrualTimestamp", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "name": "accrualBlockNumber", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "accrueInterest", - "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ - { "internalType": "uint256", "name": "addAmount", "type": "uint256" } + { + "internalType": "uint256", + "name": "addAmount", + "type": "uint256" + } ], "name": "addReserves", "outputs": [], @@ -476,113 +567,231 @@ { "inputs": [], "name": "admin", - "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], "stateMutability": "view", "type": "function" }, { "inputs": [ - { "internalType": "address", "name": "owner", "type": "address" }, - { "internalType": "address", "name": "spender", "type": "address" } + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + } ], "name": "allowance", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], "stateMutability": "view", "type": "function" }, { "inputs": [ - { "internalType": "address", "name": "spender", "type": "address" }, - { "internalType": "uint256", "name": "amount", "type": "uint256" } + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } ], "name": "approve", - "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "assetManager", - "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], "stateMutability": "view", "type": "function" }, { "inputs": [ - { "internalType": "address", "name": "account", "type": "address" } + { + "internalType": "address", + "name": "account", + "type": "address" + } ], "name": "balanceOf", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], "stateMutability": "view", "type": "function" }, { "inputs": [ - { "internalType": "address", "name": "owner", "type": "address" } + { + "internalType": "address", + "name": "owner", + "type": "address" + } ], "name": "balanceOfUnderlying", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], "stateMutability": "view", "type": "function" }, { "inputs": [ - { "internalType": "address", "name": "to", "type": "address" }, - { "internalType": "uint256", "name": "amount", "type": "uint256" } - ], - "name": "borrow", - "outputs": [], + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "borrow", + "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ - { "internalType": "address", "name": "account", "type": "address" } + { + "internalType": "address", + "name": "account", + "type": "address" + } ], "name": "borrowBalanceView", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "borrowIndex", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], "stateMutability": "view", "type": "function" }, { "inputs": [], - "name": "borrowRatePerSecond", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "name": "borrowRatePerBlock", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], "stateMutability": "view", "type": "function" }, { "inputs": [ - { "internalType": "uint256", "name": "amount", "type": "uint256" } + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } ], "name": "calculatingFee", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], "stateMutability": "view", "type": "function" }, { "inputs": [ - { "internalType": "address", "name": "account", "type": "address" } + { + "internalType": "address", + "name": "account", + "type": "address" + } ], "name": "calculatingInterest", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], "stateMutability": "view", "type": "function" }, { "inputs": [ - { "internalType": "address", "name": "account", "type": "address" } + { + "internalType": "address", + "name": "account", + "type": "address" + } ], "name": "checkIsOverdue", "outputs": [ - { "internalType": "bool", "name": "isOverdue", "type": "bool" } + { + "internalType": "bool", + "name": "isOverdue", + "type": "bool" + } ], "stateMutability": "view", "type": "function" @@ -590,14 +799,28 @@ { "inputs": [], "name": "debtCeiling", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], "stateMutability": "view", "type": "function" }, { "inputs": [ - { "internalType": "address", "name": "borrower", "type": "address" }, - { "internalType": "uint256", "name": "amount", "type": "uint256" } + { + "internalType": "address", + "name": "borrower", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } ], "name": "debtWriteOff", "outputs": [], @@ -607,13 +830,23 @@ { "inputs": [], "name": "decimals", - "outputs": [{ "internalType": "uint8", "name": "", "type": "uint8" }], + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], "stateMutability": "view", "type": "function" }, { "inputs": [ - { "internalType": "address", "name": "spender", "type": "address" }, + { + "internalType": "address", + "name": "spender", + "type": "address" + }, { "internalType": "uint256", "name": "subtractedValue", @@ -621,63 +854,127 @@ } ], "name": "decreaseAllowance", - "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "exchangeRateCurrent", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "exchangeRateStored", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], "stateMutability": "view", "type": "function" }, { "inputs": [ - { "internalType": "address", "name": "account", "type": "address" } + { + "internalType": "address", + "name": "account", + "type": "address" + } ], "name": "getBorrowed", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], "stateMutability": "view", "type": "function" }, { "inputs": [ - { "internalType": "address", "name": "account", "type": "address" } + { + "internalType": "address", + "name": "account", + "type": "address" + } ], "name": "getLastRepay", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "getRemainingDebtCeiling", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], "stateMutability": "view", "type": "function" }, { "inputs": [ - { "internalType": "address", "name": "spender", "type": "address" }, - { "internalType": "uint256", "name": "addedValue", "type": "uint256" } + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "addedValue", + "type": "uint256" + } ], "name": "increaseAllowance", - "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "initialExchangeRateMantissa", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], "stateMutability": "view", "type": "function" }, @@ -696,77 +993,130 @@ }, { "inputs": [ - { "internalType": "address", "name": "account", "type": "address" } + { + "internalType": "address", + "name": "account", + "type": "address" + } ], "name": "isAdmin", - "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "maxBorrow", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "minBorrow", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], "stateMutability": "view", "type": "function" }, { "inputs": [ - { "internalType": "uint256", "name": "amountIn", "type": "uint256" } + { + "internalType": "uint256", + "name": "amountIn", + "type": "uint256" + } ], "name": "mint", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, - { - "inputs": [], - "name": "mintFeeRate", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, { "inputs": [], "name": "name", - "outputs": [{ "internalType": "string", "name": "", "type": "string" }], + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], "stateMutability": "view", "type": "function" }, { "inputs": [ - { "internalType": "address", "name": "owner", "type": "address" } + { + "internalType": "address", + "name": "owner", + "type": "address" + } ], "name": "nonces", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "originationFee", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "originationFeeMax", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], "stateMutability": "view", "type": "function" }, { "inputs": [], - "name": "overdueTime", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "name": "overdueBlocks", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], "stateMutability": "view", "type": "function" }, @@ -780,50 +1130,97 @@ { "inputs": [], "name": "pauseGuardian", - "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "paused", - "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "pendingAdmin", - "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], "stateMutability": "view", "type": "function" }, { "inputs": [ - { "internalType": "address", "name": "owner", "type": "address" }, - { "internalType": "address", "name": "spender", "type": "address" }, - { "internalType": "uint256", "name": "value", "type": "uint256" }, - { "internalType": "uint256", "name": "deadline", "type": "uint256" }, - { "internalType": "uint8", "name": "v", "type": "uint8" }, - { "internalType": "bytes32", "name": "r", "type": "bytes32" }, - { "internalType": "bytes32", "name": "s", "type": "bytes32" } + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + }, + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + } ], "name": "permit", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, - { - "inputs": [], - "name": "proxiableUUID", - "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], - "stateMutability": "view", - "type": "function" - }, { "inputs": [ - { "internalType": "uint256", "name": "amountIn", "type": "uint256" }, - { "internalType": "uint256", "name": "amountOut", "type": "uint256" } + { + "internalType": "uint256", + "name": "amountIn", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountOut", + "type": "uint256" + } ], "name": "redeem", "outputs": [], @@ -832,8 +1229,16 @@ }, { "inputs": [ - { "internalType": "address", "name": "receiver", "type": "address" }, - { "internalType": "uint256", "name": "reduceAmount", "type": "uint256" } + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "uint256", + "name": "reduceAmount", + "type": "uint256" + } ], "name": "removeReserves", "outputs": [], @@ -842,8 +1247,16 @@ }, { "inputs": [ - { "internalType": "address", "name": "borrower", "type": "address" }, - { "internalType": "uint256", "name": "amount", "type": "uint256" } + { + "internalType": "address", + "name": "borrower", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } ], "name": "repayBorrow", "outputs": [], @@ -852,12 +1265,36 @@ }, { "inputs": [ - { "internalType": "address", "name": "borrower", "type": "address" }, - { "internalType": "uint256", "name": "amount", "type": "uint256" }, - { "internalType": "uint256", "name": "deadline", "type": "uint256" }, - { "internalType": "uint8", "name": "v", "type": "uint8" }, - { "internalType": "bytes32", "name": "r", "type": "bytes32" }, - { "internalType": "bytes32", "name": "s", "type": "bytes32" } + { + "internalType": "address", + "name": "borrower", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + }, + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + } ], "name": "repayBorrowWithERC20Permit", "outputs": [], @@ -866,7 +1303,11 @@ }, { "inputs": [ - { "internalType": "address", "name": "borrower", "type": "address" } + { + "internalType": "address", + "name": "borrower", + "type": "address" + } ], "name": "repayInterest", "outputs": [], @@ -875,11 +1316,31 @@ }, { "inputs": [ - { "internalType": "address", "name": "borrower", "type": "address" }, - { "internalType": "uint256", "name": "deadline", "type": "uint256" }, - { "internalType": "uint8", "name": "v", "type": "uint8" }, - { "internalType": "bytes32", "name": "r", "type": "bytes32" }, - { "internalType": "bytes32", "name": "s", "type": "bytes32" } + { + "internalType": "address", + "name": "borrower", + "type": "address" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + }, + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + } ], "name": "repayInterestWithPermit", "outputs": [], @@ -889,13 +1350,23 @@ { "inputs": [], "name": "reserveFactorMantissa", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], "stateMutability": "view", "type": "function" }, { "inputs": [ - { "internalType": "address", "name": "assetManager_", "type": "address" } + { + "internalType": "address", + "name": "assetManager_", + "type": "address" + } ], "name": "setAssetManager", "outputs": [], @@ -904,7 +1375,11 @@ }, { "inputs": [ - { "internalType": "uint256", "name": "debtCeiling_", "type": "uint256" } + { + "internalType": "uint256", + "name": "debtCeiling_", + "type": "uint256" + } ], "name": "setDebtCeiling", "outputs": [], @@ -913,7 +1388,11 @@ }, { "inputs": [ - { "internalType": "address", "name": "account", "type": "address" } + { + "internalType": "address", + "name": "account", + "type": "address" + } ], "name": "setGuardian", "outputs": [], @@ -935,7 +1414,11 @@ }, { "inputs": [ - { "internalType": "uint256", "name": "maxBorrow_", "type": "uint256" } + { + "internalType": "uint256", + "name": "maxBorrow_", + "type": "uint256" + } ], "name": "setMaxBorrow", "outputs": [], @@ -944,22 +1427,17 @@ }, { "inputs": [ - { "internalType": "uint256", "name": "minBorrow_", "type": "uint256" } + { + "internalType": "uint256", + "name": "minBorrow_", + "type": "uint256" + } ], "name": "setMinBorrow", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, - { - "inputs": [ - { "internalType": "uint256", "name": "newRate", "type": "uint256" } - ], - "name": "setMintFeeRate", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, { "inputs": [ { @@ -975,16 +1453,24 @@ }, { "inputs": [ - { "internalType": "uint256", "name": "overdueTime_", "type": "uint256" } + { + "internalType": "uint256", + "name": "overdueBlocks_", + "type": "uint256" + } ], - "name": "setOverdueTime", + "name": "setOverdueBlocks", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ - { "internalType": "address", "name": "account", "type": "address" } + { + "internalType": "address", + "name": "account", + "type": "address" + } ], "name": "setPendingAdmin", "outputs": [], @@ -1006,7 +1492,11 @@ }, { "inputs": [ - { "internalType": "address", "name": "userManager_", "type": "address" } + { + "internalType": "address", + "name": "userManager_", + "type": "address" + } ], "name": "setUserManager", "outputs": [], @@ -1015,71 +1505,145 @@ }, { "inputs": [], - "name": "supplyRatePerSecond", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "name": "supplyRatePerBlock", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "symbol", - "outputs": [{ "internalType": "string", "name": "", "type": "string" }], + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "totalBorrows", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "totalRedeemable", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "totalReserves", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "totalSupply", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], "stateMutability": "view", "type": "function" }, { "inputs": [ - { "internalType": "address", "name": "to", "type": "address" }, - { "internalType": "uint256", "name": "amount", "type": "uint256" } + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } ], "name": "transfer", - "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ - { "internalType": "address", "name": "from", "type": "address" }, - { "internalType": "address", "name": "to", "type": "address" }, - { "internalType": "uint256", "name": "amount", "type": "uint256" } + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } ], "name": "transferFrom", - "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "underlying", - "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], "stateMutability": "view", "type": "function" }, @@ -1110,7 +1674,11 @@ "name": "newImplementation", "type": "address" }, - { "internalType": "bytes", "name": "data", "type": "bytes" } + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } ], "name": "upgradeToAndCall", "outputs": [], @@ -1120,7 +1688,13 @@ { "inputs": [], "name": "userManager", - "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], "stateMutability": "view", "type": "function" } diff --git a/src/abis/v2/userManager.json b/src/abis/v2/userManager.json index d737b80c..5ce96943 100644 --- a/src/abis/v2/userManager.json +++ b/src/abis/v2/userManager.json @@ -1,28 +1,124 @@ [ - { "inputs": [], "name": "AmountZero", "type": "error" }, - { "inputs": [], "name": "AssetManagerDepositFailed", "type": "error" }, - { "inputs": [], "name": "AssetManagerWithdrawFailed", "type": "error" }, - { "inputs": [], "name": "AuthFailed", "type": "error" }, - { "inputs": [], "name": "ErrorSelfVouching", "type": "error" }, - { "inputs": [], "name": "ExceedsLocked", "type": "error" }, - { "inputs": [], "name": "InsufficientBalance", "type": "error" }, - { "inputs": [], "name": "InvalidParams", "type": "error" }, - { "inputs": [], "name": "LockedRemaining", "type": "error" }, - { "inputs": [], "name": "LockedStakeNonZero", "type": "error" }, - { "inputs": [], "name": "MaxVouchees", "type": "error" }, - { "inputs": [], "name": "MaxVouchers", "type": "error" }, - { "inputs": [], "name": "NoExistingMember", "type": "error" }, - { "inputs": [], "name": "NotEnoughStakers", "type": "error" }, - { "inputs": [], "name": "NotOverdue", "type": "error" }, - { "inputs": [], "name": "NotPaused", "type": "error" }, - { "inputs": [], "name": "Paused", "type": "error" }, - { "inputs": [], "name": "SenderNotAdmin", "type": "error" }, - { "inputs": [], "name": "SenderNotGuardian", "type": "error" }, - { "inputs": [], "name": "SenderNotPendingAdmin", "type": "error" }, - { "inputs": [], "name": "StakeLimitReached", "type": "error" }, - { "inputs": [], "name": "TrustAmountLtLocked", "type": "error" }, - { "inputs": [], "name": "VouchWhenOverdue", "type": "error" }, - { "inputs": [], "name": "VoucherNotFound", "type": "error" }, + { + "inputs": [], + "name": "AmountZero", + "type": "error" + }, + { + "inputs": [], + "name": "AssetManagerDepositFailed", + "type": "error" + }, + { + "inputs": [], + "name": "AssetManagerWithdrawFailed", + "type": "error" + }, + { + "inputs": [], + "name": "AuthFailed", + "type": "error" + }, + { + "inputs": [], + "name": "ErrorSelfVouching", + "type": "error" + }, + { + "inputs": [], + "name": "ExceedsLocked", + "type": "error" + }, + { + "inputs": [], + "name": "InsufficientBalance", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidParams", + "type": "error" + }, + { + "inputs": [], + "name": "LockedRemaining", + "type": "error" + }, + { + "inputs": [], + "name": "LockedStakeNonZero", + "type": "error" + }, + { + "inputs": [], + "name": "MaxVouchees", + "type": "error" + }, + { + "inputs": [], + "name": "MaxVouchers", + "type": "error" + }, + { + "inputs": [], + "name": "NoExistingMember", + "type": "error" + }, + { + "inputs": [], + "name": "NotEnoughStakers", + "type": "error" + }, + { + "inputs": [], + "name": "NotOverdue", + "type": "error" + }, + { + "inputs": [], + "name": "NotPaused", + "type": "error" + }, + { + "inputs": [], + "name": "Paused", + "type": "error" + }, + { + "inputs": [], + "name": "SenderNotAdmin", + "type": "error" + }, + { + "inputs": [], + "name": "SenderNotGuardian", + "type": "error" + }, + { + "inputs": [], + "name": "SenderNotPendingAdmin", + "type": "error" + }, + { + "inputs": [], + "name": "StakeLimitReached", + "type": "error" + }, + { + "inputs": [], + "name": "TrustAmountLtLocked", + "type": "error" + }, + { + "inputs": [], + "name": "VouchWhenOverdue", + "type": "error" + }, + { + "inputs": [], + "name": "VoucherNotFound", + "type": "error" + }, { "anonymous": false, "inputs": [ @@ -55,19 +151,6 @@ "name": "BeaconUpgraded", "type": "event" }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint8", - "name": "version", - "type": "uint8" - } - ], - "name": "Initialized", - "type": "event" - }, { "anonymous": false, "inputs": [ @@ -182,17 +265,17 @@ { "indexed": false, "internalType": "uint256", - "name": "oldMaxOverdueTime", + "name": "oldMaxOverdueBlocks", "type": "uint256" }, { "indexed": false, "internalType": "uint256", - "name": "newMaxOverdueTime", + "name": "newMaxOverdueBlocks", "type": "uint256" } ], - "name": "LogSetMaxOverdueTime", + "name": "LogSetMaxOverdueBlocks", "type": "event" }, { @@ -363,14 +446,47 @@ }, { "inputs": [ - { "internalType": "address", "name": "assetManager_", "type": "address" }, - { "internalType": "address", "name": "unionToken_", "type": "address" }, - { "internalType": "address", "name": "stakingToken_", "type": "address" }, - { "internalType": "address", "name": "comptroller_", "type": "address" }, - { "internalType": "address", "name": "admin_", "type": "address" }, + { + "internalType": "address", + "name": "admin_", + "type": "address" + } + ], + "name": "__Controller_init", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "assetManager_", + "type": "address" + }, + { + "internalType": "address", + "name": "unionToken_", + "type": "address" + }, + { + "internalType": "address", + "name": "stakingToken_", + "type": "address" + }, + { + "internalType": "address", + "name": "comptroller_", + "type": "address" + }, + { + "internalType": "address", + "name": "admin_", + "type": "address" + }, { "internalType": "uint256", - "name": "maxOverdueTime_", + "name": "maxOverdueBlocks_", "type": "uint256" }, { @@ -378,8 +494,16 @@ "name": "effectiveCount_", "type": "uint256" }, - { "internalType": "uint256", "name": "maxVouchers_", "type": "uint256" }, - { "internalType": "uint256", "name": "maxVouchees_", "type": "uint256" } + { + "internalType": "uint256", + "name": "maxVouchers_", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxVouchees_", + "type": "uint256" + } ], "name": "__UserManager_init", "outputs": [], @@ -395,7 +519,11 @@ }, { "inputs": [ - { "internalType": "address", "name": "account", "type": "address" } + { + "internalType": "address", + "name": "account", + "type": "address" + } ], "name": "addMember", "outputs": [], @@ -405,20 +533,36 @@ { "inputs": [], "name": "admin", - "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "assetManager", - "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], "stateMutability": "view", "type": "function" }, { "inputs": [ - { "internalType": "address[]", "name": "stakerList", "type": "address[]" } + { + "internalType": "address[]", + "name": "stakerList", + "type": "address[]" + } ], "name": "batchUpdateFrozenInfo", "outputs": [], @@ -427,8 +571,16 @@ }, { "inputs": [ - { "internalType": "address", "name": "staker", "type": "address" }, - { "internalType": "address", "name": "borrower", "type": "address" } + { + "internalType": "address", + "name": "staker", + "type": "address" + }, + { + "internalType": "address", + "name": "borrower", + "type": "address" + } ], "name": "cancelVouch", "outputs": [], @@ -437,10 +589,20 @@ }, { "inputs": [ - { "internalType": "address", "name": "account", "type": "address" } + { + "internalType": "address", + "name": "account", + "type": "address" + } ], "name": "checkIsMember", - "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], "stateMutability": "view", "type": "function" }, @@ -448,20 +610,32 @@ "inputs": [], "name": "comptroller", "outputs": [ - { "internalType": "contract IComptroller", "name": "", "type": "address" } + { + "internalType": "contract IComptroller", + "name": "", + "type": "address" + } ], "stateMutability": "view", "type": "function" }, { "inputs": [ - { "internalType": "address", "name": "stakerAddress", "type": "address" }, + { + "internalType": "address", + "name": "stakerAddress", + "type": "address" + }, { "internalType": "address", "name": "borrowerAddress", "type": "address" }, - { "internalType": "uint256", "name": "amount", "type": "uint256" } + { + "internalType": "uint96", + "name": "amount", + "type": "uint96" + } ], "name": "debtWriteOff", "outputs": [], @@ -471,52 +645,112 @@ { "inputs": [], "name": "effectiveCount", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], "stateMutability": "view", "type": "function" }, { - "inputs": [{ "internalType": "address", "name": "", "type": "address" }], + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], "name": "frozenCoinAge", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], "stateMutability": "view", "type": "function" }, { - "inputs": [{ "internalType": "address", "name": "", "type": "address" }], - "name": "gLastWithdrawRewards", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "inputs": [ + { + "internalType": "address", + "name": "borrower", + "type": "address" + } + ], + "name": "getCreditLimit", + "outputs": [ + { + "internalType": "uint256", + "name": "total", + "type": "uint256" + } + ], "stateMutability": "view", "type": "function" }, { "inputs": [ - { "internalType": "address", "name": "borrower", "type": "address" } + { + "internalType": "address", + "name": "", + "type": "address" + } ], - "name": "getCreditLimit", + "name": "getLastWithdrawRewards", "outputs": [ - { "internalType": "uint256", "name": "total", "type": "uint256" } + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } ], "stateMutability": "view", "type": "function" }, { "inputs": [ - { "internalType": "address", "name": "staker", "type": "address" }, - { "internalType": "address", "name": "borrower", "type": "address" } + { + "internalType": "address", + "name": "staker", + "type": "address" + }, + { + "internalType": "address", + "name": "borrower", + "type": "address" + } ], "name": "getLockedStake", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], "stateMutability": "view", "type": "function" }, { "inputs": [ - { "internalType": "address", "name": "staker", "type": "address" } + { + "internalType": "address", + "name": "staker", + "type": "address" + }, + { + "internalType": "uint256", + "name": "pastBlocks", + "type": "uint256" + } ], "name": "getStakeInfo", "outputs": [ - { "internalType": "bool", "name": "isMember", "type": "bool" }, { "internalType": "uint256", "name": "effectiveStaked", @@ -527,54 +761,112 @@ "name": "effectiveLocked", "type": "uint256" }, - { "internalType": "uint256", "name": "stakerFrozen", "type": "uint256" } + { + "internalType": "bool", + "name": "isMember", + "type": "bool" + } ], "stateMutability": "view", "type": "function" }, { "inputs": [ - { "internalType": "address", "name": "account", "type": "address" } + { + "internalType": "address", + "name": "account", + "type": "address" + } ], "name": "getStakerBalance", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], "stateMutability": "view", "type": "function" }, { "inputs": [ - { "internalType": "address", "name": "staker", "type": "address" } + { + "internalType": "address", + "name": "staker", + "type": "address" + } ], "name": "getTotalLockedStake", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", - "type": "function" + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" }, { "inputs": [ - { "internalType": "address", "name": "staker", "type": "address" } + { + "internalType": "address", + "name": "staker", + "type": "address" + } ], "name": "getVoucheeCount", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], "stateMutability": "view", "type": "function" }, { "inputs": [ - { "internalType": "address", "name": "borrower", "type": "address" } + { + "internalType": "address", + "name": "borrower", + "type": "address" + } ], "name": "getVoucherCount", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], "stateMutability": "view", "type": "function" }, { "inputs": [ - { "internalType": "address", "name": "_staker", "type": "address" }, - { "internalType": "address", "name": "borrower", "type": "address" } + { + "internalType": "address", + "name": "_staker", + "type": "address" + }, + { + "internalType": "address", + "name": "borrower", + "type": "address" + } ], "name": "getVouchingAmount", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], "stateMutability": "view", "type": "function" }, @@ -582,66 +874,125 @@ "inputs": [], "name": "globalTotalStaked", "outputs": [ - { "internalType": "uint256", "name": "globalTotal", "type": "uint256" } + { + "internalType": "uint256", + "name": "globalTotal", + "type": "uint256" + } ], "stateMutability": "view", "type": "function" }, { "inputs": [ - { "internalType": "address", "name": "account", "type": "address" } + { + "internalType": "address", + "name": "account", + "type": "address" + } ], "name": "isAdmin", - "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], "stateMutability": "view", "type": "function" }, { "inputs": [], - "name": "maxOverdueTime", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "name": "maxOverdueBlocks", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "maxStakeAmount", - "outputs": [{ "internalType": "uint96", "name": "", "type": "uint96" }], + "outputs": [ + { + "internalType": "uint96", + "name": "", + "type": "uint96" + } + ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "maxVouchees", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "maxVouchers", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], "stateMutability": "view", "type": "function" }, { - "inputs": [{ "internalType": "address", "name": "", "type": "address" }], + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], "name": "memberFrozen", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "newMemberFee", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], "stateMutability": "view", "type": "function" }, { "inputs": [ - { "internalType": "address", "name": "borrower", "type": "address" }, - { "internalType": "uint256", "name": "overdueTime", "type": "uint256" } + { + "internalType": "address", + "name": "borrower", + "type": "address" + } ], "name": "onRepayBorrow", "outputs": [], @@ -650,7 +1001,16 @@ }, { "inputs": [ - { "internalType": "address", "name": "staker", "type": "address" } + { + "internalType": "address", + "name": "staker", + "type": "address" + }, + { + "internalType": "uint256", + "name": "pastBlocks", + "type": "uint256" + } ], "name": "onWithdrawRewards", "outputs": [ @@ -664,7 +1024,11 @@ "name": "effectiveLocked", "type": "uint256" }, - { "internalType": "bool", "name": "isMember", "type": "bool" } + { + "internalType": "bool", + "name": "isMember", + "type": "bool" + } ], "stateMutability": "nonpayable", "type": "function" @@ -679,34 +1043,49 @@ { "inputs": [], "name": "pauseGuardian", - "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "paused", - "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "pendingAdmin", - "outputs": [{ "internalType": "address", "name": "", "type": "address" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "proxiableUUID", - "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], "stateMutability": "view", "type": "function" }, { "inputs": [ - { "internalType": "address", "name": "newMember", "type": "address" } + { + "internalType": "address", + "name": "newMember", + "type": "address" + } ], "name": "registerMember", "outputs": [], @@ -715,12 +1094,36 @@ }, { "inputs": [ - { "internalType": "address", "name": "newMember", "type": "address" }, - { "internalType": "uint256", "name": "value", "type": "uint256" }, - { "internalType": "uint256", "name": "deadline", "type": "uint256" }, - { "internalType": "uint8", "name": "v", "type": "uint8" }, - { "internalType": "bytes32", "name": "r", "type": "bytes32" }, - { "internalType": "bytes32", "name": "s", "type": "bytes32" } + { + "internalType": "address", + "name": "newMember", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + }, + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + } ], "name": "registerMemberWithPermit", "outputs": [], @@ -742,7 +1145,11 @@ }, { "inputs": [ - { "internalType": "address", "name": "account", "type": "address" } + { + "internalType": "address", + "name": "account", + "type": "address" + } ], "name": "setGuardian", "outputs": [], @@ -753,18 +1160,22 @@ "inputs": [ { "internalType": "uint256", - "name": "_maxOverdueTime", + "name": "_maxOverdueBlocks", "type": "uint256" } ], - "name": "setMaxOverdueTime", + "name": "setMaxOverdueBlocks", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ - { "internalType": "uint96", "name": "maxStakeAmount_", "type": "uint96" } + { + "internalType": "uint96", + "name": "maxStakeAmount_", + "type": "uint96" + } ], "name": "setMaxStakeAmount", "outputs": [], @@ -773,7 +1184,11 @@ }, { "inputs": [ - { "internalType": "uint256", "name": "_maxVouchees", "type": "uint256" } + { + "internalType": "uint256", + "name": "_maxVouchees", + "type": "uint256" + } ], "name": "setMaxVouchees", "outputs": [], @@ -782,7 +1197,11 @@ }, { "inputs": [ - { "internalType": "uint256", "name": "_maxVouchers", "type": "uint256" } + { + "internalType": "uint256", + "name": "_maxVouchers", + "type": "uint256" + } ], "name": "setMaxVouchers", "outputs": [], @@ -791,7 +1210,11 @@ }, { "inputs": [ - { "internalType": "uint256", "name": "amount", "type": "uint256" } + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } ], "name": "setNewMemberFee", "outputs": [], @@ -800,7 +1223,11 @@ }, { "inputs": [ - { "internalType": "address", "name": "account", "type": "address" } + { + "internalType": "address", + "name": "account", + "type": "address" + } ], "name": "setPendingAdmin", "outputs": [], @@ -809,7 +1236,11 @@ }, { "inputs": [ - { "internalType": "address", "name": "uToken_", "type": "address" } + { + "internalType": "address", + "name": "uToken_", + "type": "address" + } ], "name": "setUToken", "outputs": [], @@ -818,7 +1249,11 @@ }, { "inputs": [ - { "internalType": "uint96", "name": "amount", "type": "uint96" } + { + "internalType": "uint96", + "name": "amount", + "type": "uint96" + } ], "name": "stake", "outputs": [], @@ -827,11 +1262,31 @@ }, { "inputs": [ - { "internalType": "uint256", "name": "amount", "type": "uint256" }, - { "internalType": "uint256", "name": "deadline", "type": "uint256" }, - { "internalType": "uint8", "name": "v", "type": "uint8" }, - { "internalType": "bytes32", "name": "r", "type": "bytes32" }, - { "internalType": "bytes32", "name": "s", "type": "bytes32" } + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + }, + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + } ], "name": "stakeWithERC20Permit", "outputs": [], @@ -839,15 +1294,45 @@ "type": "function" }, { - "inputs": [{ "internalType": "address", "name": "", "type": "address" }], + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], "name": "stakers", "outputs": [ - { "internalType": "bool", "name": "isMember", "type": "bool" }, - { "internalType": "uint96", "name": "stakedAmount", "type": "uint96" }, - { "internalType": "uint96", "name": "locked", "type": "uint96" }, - { "internalType": "uint64", "name": "lastUpdated", "type": "uint64" }, - { "internalType": "uint256", "name": "stakedCoinAge", "type": "uint256" }, - { "internalType": "uint256", "name": "lockedCoinAge", "type": "uint256" } + { + "internalType": "bool", + "name": "isMember", + "type": "bool" + }, + { + "internalType": "uint96", + "name": "stakedAmount", + "type": "uint96" + }, + { + "internalType": "uint96", + "name": "locked", + "type": "uint96" + }, + { + "internalType": "uint64", + "name": "lastUpdated", + "type": "uint64" + }, + { + "internalType": "uint256", + "name": "stakedCoinAge", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "lockedCoinAge", + "type": "uint256" + } ], "stateMutability": "view", "type": "function" @@ -855,21 +1340,39 @@ { "inputs": [], "name": "stakingToken", - "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "totalFrozen", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "totalStaked", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], "stateMutability": "view", "type": "function" }, @@ -877,7 +1380,11 @@ "inputs": [], "name": "uToken", "outputs": [ - { "internalType": "contract IUToken", "name": "", "type": "address" } + { + "internalType": "contract IUToken", + "name": "", + "type": "address" + } ], "stateMutability": "view", "type": "function" @@ -885,7 +1392,13 @@ { "inputs": [], "name": "unionToken", - "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], "stateMutability": "view", "type": "function" }, @@ -898,7 +1411,11 @@ }, { "inputs": [ - { "internalType": "uint96", "name": "amount", "type": "uint96" } + { + "internalType": "uint96", + "name": "amount", + "type": "uint96" + } ], "name": "unstake", "outputs": [], @@ -907,9 +1424,21 @@ }, { "inputs": [ - { "internalType": "address", "name": "borrower", "type": "address" }, - { "internalType": "uint256", "name": "amount", "type": "uint256" }, - { "internalType": "bool", "name": "lock", "type": "bool" } + { + "internalType": "address", + "name": "borrower", + "type": "address" + }, + { + "internalType": "uint96", + "name": "amount", + "type": "uint96" + }, + { + "internalType": "bool", + "name": "lock", + "type": "bool" + } ], "name": "updateLocked", "outputs": [], @@ -918,8 +1447,16 @@ }, { "inputs": [ - { "internalType": "address", "name": "borrower", "type": "address" }, - { "internalType": "uint96", "name": "trustAmount", "type": "uint96" } + { + "internalType": "address", + "name": "borrower", + "type": "address" + }, + { + "internalType": "uint96", + "name": "trustAmount", + "type": "uint96" + } ], "name": "updateTrust", "outputs": [], @@ -946,7 +1483,11 @@ "name": "newImplementation", "type": "address" }, - { "internalType": "bytes", "name": "data", "type": "bytes" } + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } ], "name": "upgradeToAndCall", "outputs": [], @@ -955,54 +1496,126 @@ }, { "inputs": [ - { "internalType": "address", "name": "", "type": "address" }, - { "internalType": "address", "name": "", "type": "address" } + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "address", + "name": "", + "type": "address" + } ], "name": "voucheeIndexes", "outputs": [ - { "internalType": "bool", "name": "isSet", "type": "bool" }, - { "internalType": "uint128", "name": "idx", "type": "uint128" } + { + "internalType": "bool", + "name": "isSet", + "type": "bool" + }, + { + "internalType": "uint128", + "name": "idx", + "type": "uint128" + } ], "stateMutability": "view", "type": "function" }, { "inputs": [ - { "internalType": "address", "name": "", "type": "address" }, - { "internalType": "uint256", "name": "", "type": "uint256" } + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } ], "name": "vouchees", "outputs": [ - { "internalType": "address", "name": "borrower", "type": "address" }, - { "internalType": "uint96", "name": "voucherIndex", "type": "uint96" } + { + "internalType": "address", + "name": "borrower", + "type": "address" + }, + { + "internalType": "uint96", + "name": "voucherIndex", + "type": "uint96" + } ], "stateMutability": "view", "type": "function" }, { "inputs": [ - { "internalType": "address", "name": "", "type": "address" }, - { "internalType": "address", "name": "", "type": "address" } + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "address", + "name": "", + "type": "address" + } ], "name": "voucherIndexes", "outputs": [ - { "internalType": "bool", "name": "isSet", "type": "bool" }, - { "internalType": "uint128", "name": "idx", "type": "uint128" } + { + "internalType": "bool", + "name": "isSet", + "type": "bool" + }, + { + "internalType": "uint128", + "name": "idx", + "type": "uint128" + } ], "stateMutability": "view", "type": "function" }, { "inputs": [ - { "internalType": "address", "name": "", "type": "address" }, - { "internalType": "uint256", "name": "", "type": "uint256" } + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } ], "name": "vouchers", "outputs": [ - { "internalType": "address", "name": "staker", "type": "address" }, - { "internalType": "uint96", "name": "trust", "type": "uint96" }, - { "internalType": "uint96", "name": "locked", "type": "uint96" }, - { "internalType": "uint64", "name": "lastUpdated", "type": "uint64" } + { + "internalType": "address", + "name": "staker", + "type": "address" + }, + { + "internalType": "uint96", + "name": "trust", + "type": "uint96" + }, + { + "internalType": "uint96", + "name": "locked", + "type": "uint96" + }, + { + "internalType": "uint64", + "name": "lastUpdated", + "type": "uint64" + } ], "stateMutability": "view", "type": "function" diff --git a/src/components/VouchFaucetButton.jsx b/src/components/VouchFaucetButton.jsx index ddbae046..5dcd9cf4 100644 --- a/src/components/VouchFaucetButton.jsx +++ b/src/components/VouchFaucetButton.jsx @@ -17,8 +17,6 @@ export default function VouchFaucetButton() { onComplete: refetchVouchers, }); - console.log(onClick, loading, onClick); - if (![goerli.id, optimismGoerli.id].includes(chain.id)) { return ( <> diff --git a/src/components/connect/Banner.jsx b/src/components/connect/Banner.jsx index 90186acc..8c16f6f4 100644 --- a/src/components/connect/Banner.jsx +++ b/src/components/connect/Banner.jsx @@ -6,8 +6,8 @@ export default function Banner() {
- Welcome to Union, the place to create, manage and grow your on-chain - credit + Welcome to Union, the + place to create, manage and grow your on-chain credit
diff --git a/src/components/connect/Banner.scss b/src/components/connect/Banner.scss index 98eca5c2..cdce13cc 100644 --- a/src/components/connect/Banner.scss +++ b/src/components/connect/Banner.scss @@ -3,7 +3,6 @@ .ConnectBanner { height: 176px; display: flex; - width: 80%; align-items: center; justify-content: center; background-image: url("../../images/gradient.png"); @@ -14,12 +13,12 @@ background-size: cover; background-position: center; - @media screen and (max-width: $mobileWidth) { - height: 120px; + &__bold { + font-weight: 500; } - @media screen and (min-width: $mobileWidth - 1px) { - margin-top: -24px; + @media screen and (max-width: $mobileWidth) { + height: 120px; } .heading.heading { diff --git a/src/components/connect/NetworkSelect.jsx b/src/components/connect/NetworkSelect.jsx index 69d5f328..d40dc515 100644 --- a/src/components/connect/NetworkSelect.jsx +++ b/src/components/connect/NetworkSelect.jsx @@ -1,7 +1,8 @@ import "./NetworkSelect.scss"; +import { optimismGoerli, goerli } from "wagmi/chains"; import { useEffect, useState } from "react"; -import { Grid, Box, Button } from "@unioncredit/ui"; +import { WalletIcon, Grid, Box, Button } from "@unioncredit/ui"; import { useConnectModal } from "@rainbow-me/rainbowkit"; import { useAccount, useNetwork, useSwitchNetwork } from "wagmi"; @@ -9,7 +10,7 @@ import useNetworks from "hooks/useNetworks"; import { useAppNetwork } from "providers/Network"; import useMemberSummary from "hooks/useMemberSummary"; import { NetworkSelectOption } from "./NetworkSelectOption"; -import { optimismGoerli, goerli } from "wagmi/chains"; + export default function NetworkSelect() { const { chain } = useNetwork(); @@ -49,52 +50,62 @@ export default function NetworkSelect() { }, [chain?.id, JSON.stringify(networks)]); return ( - - - - - {networks.map((network) => ( - handleChangeNetwork(network)} - active={isConnected && selected?.chainId === network.chainId} - /> - ))} - - + )} + > + + + + Column Data + + + + + ({ + ...column, + type: "radio", + checked: column.id === active.id, + }))} + onChange={(selectedId) => { + setSelectedColumn( + columns.find((column) => column.id === selectedId) + ); + setSort({ ...sort, type: selectedId }); + setOpen(false); + }} + /> + + + + { + setSort({ + ...sort, + order: sort.order === selectedId ? null : selectedId, + }); + + setOpen(false); + }} + /> + + + + )} + + + +
+ {voucher ? ( + + ) : ( + + + You're not receiving from this contact + + + )} +
+ + ); +} + +const VoucherDetails = ({ voucher }) => { + const { trust = ZERO, vouch = ZERO, locked = ZERO } = voucher; + + return ( + + ); +}; + +const VoucheeDetails = ({ vouchee, clearContact }) => { + const { address } = vouchee; + const { open } = useModals(); + const { data: memberData = {} } = useMemberData(address); + + const { + locking = ZERO, + trust = ZERO, + vouch = ZERO, + lastRepay = ZERO, + minPayment = ZERO, + isOverdue, + } = { ...vouchee, ...memberData }; + + const { paymentDue, relative: lastRepayRelative } = + useLastRepayData(lastRepay); + + const stats = [ + { + title: "Trust", + value: format(trust), + buttonProps: { + label: "Change", + onClick: () => open(EDIT_VOUCH_MODAL, { address, clearContact }), + }, + }, + { + title: "Owes you", + value: format(locking), + buttonProps: { + label: "Write-off", + disabled: locking.lte(ZERO), + onClick: () => { + clearContact(); + open(WRITE_OFF_DEBT_MODAL, { address, clearContact }); + }, + }, + }, + ]; + + return ( + <> + + {stats.map(({ title, value, buttonProps }) => ( + + + +