Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Uniswap tenant + a ton of multi-tenant upgrades #225

Merged
merged 139 commits into from
Jun 18, 2024

Conversation

andreitr
Copy link
Contributor

@andreitr andreitr commented Apr 9, 2024

Buckle up, this PR is massive! Please take the time to look through the changes and understand the code 🙏

Staking

The functionality is encapsulated under the /staking route and should not affect the rest of the application.

Multi-tenant

The changes have an impact across the board:

  • Updated timestamp calculations based on the chain
  • Provider and chain is now in the tenant config
  • Basic delegation
  • Basic voting
  • Tenant configurations moved into separate files
  • Tenant-specific delegate icons

PR-Codex overview

This PR updates font styles, adds new tenant namespaces, changes API key initialization, introduces new dependencies, adjusts contract methods, and enhances UI components.

Detailed summary

  • Updated font styles in OPProposalPage.module.scss
  • Added new tenant namespace UNISWAP
  • Changed API key initialization in agoraAPI.js
  • Introduced @radix-ui/react-checkbox dependency
  • Adjusted contract methods in ITokenContract.ts
  • Enhanced UI components in ReceiptContainer.tsx and StakingIntro.tsx

The following files were skipped due to too many changes: src/components/RetroPGF/RetroPGFApplicationBanner.tsx, src/hooks/useTokenAllowance.ts, src/hooks/useDepositorTotalStaked.ts, src/components/Proposals/ProposalPage/OPProposalPage/OpManagerDeleteProposal.tsx, src/app/api/common/authority-chains/getAuthorityChains.ts, src/components/Proposals/ProposalCreation/SubmitButton.tsx, src/components/Dialogs/AdvancedDelegateDialog/SuccessView.tsx, tailwind.config.js, src/app/staking/components/RedirectOrConnect.tsx, src/app/lib/provider.ts, src/hooks/useConnectedDelegate.ts, src/hooks/useAdvancedVoting.tsx, src/app/staking/deposits/[deposit_id]/page.jsx, src/app/api/staking/getDeposit.ts, src/components/Proposals/ProposalPage/OPProposalApprovalPage/OPProposalApprovalPage.tsx, src/lib/voteUtils.ts, src/lib/contracts/common/interfaces/IGovernorContract.ts, src/components/Dialogs/DialogProvider/dialogs.tsx, src/lib/contracts/common/interfaces/IStaker.ts, src/app/api/common/proposals/getNeedsMyVoteProposals.ts, src/app/staking/components/Breadcrumbs.tsx, src/app/staking/components/RedirectAfterSuccess.tsx, src/lib/contracts/generated/factories/index.ts, src/components/Proposals/ProposalPage/OPProposalPage/OPProposalOptimisticPage.jsx, src/app/staking/new/page.jsx, src/app/api/staking/getDeposits.ts, src/app/staking/components/PanelNewDeposit.tsx, src/components/Header/Navbar.jsx, src/app/staking/components/delegates/DelegateProfileImage.tsx, src/components/ui/checkbox.tsx, src/lib/tenant/configs/contracts/ens.ts, src/components/Proposals/ProposalPage/ProposalDescription/ProposalDescription.jsx, src/lib/tenant/configs/contracts/etherfi.ts, src/components/Proposals/ProposalPage/OPProposalPage/ProposalVotesBar/ProposalVotesBar.jsx, src/lib/proposalUtils.ts, src/app/staking/[addressOrENSName]/deposits/DepositList.tsx, src/app/staking/deposits/[deposit_id]/delegate/page.jsx, src/app/api/common/proposals/getProposals.ts, src/lib/tenant/tenantContract.ts, src/components/Proposals/ProposalPage/ProposalTitle/ProposalTitle.jsx, src/lib/types.d.ts, src/components/shared/ENSAvatar.jsx, src/app/staking/components/delegates/DelegateCard.tsx, src/app/staking/components/PanelSetAllowance.tsx, src/app/staking/components/StakingStats.tsx, src/app/staking/components/PanelClaimRewards.tsx, src/lib/tenant/tenantUI.ts, src/app/staking/[addressOrENSName]/deposits/DepositListAction.tsx, src/app/api/common/delegations/getDelegations.ts, src/lib/tenant/configs/ui/uniswap.ts, src/lib/tenant/configs/ui/ens.ts, src/components/Proposals/ProposalPage/OPProposalPage/OPProposalPage.tsx, src/lib/contracts/generated/index.ts, src/lib/tenant/configs/contracts/uniswap.ts, src/lib/blockTimes.ts, src/components/Proposals/ProposalPage/OPProposalPage/ProposalVotesSummaryDetails/ProposalVotesSummaryDetails.tsx, src/app/api/common/quorum/getQuorum.ts, src/app/staking/page.jsx, src/app/proposals/[proposal_id]/page.jsx, src/lib/tenant/configs/contracts/optimism.ts, src/app/staking/deposits/[deposit_id]/components/EditDepositAmount.tsx, src/app/staking/deposits/[deposit_id]/delegate/components/EditDelegateConfirm.tsx, src/components/Proposals/ProposalPage/ApprovedTransactions/ApprovedTransactions.jsx, src/app/api/common/votes/getVotes.ts, src/hooks/useStandardVoting.tsx, yarn.lock, src/app/staking/deposits/[deposit_id]/delegate/components/EditDelegateFlow.tsx, src/app/staking/components/StakingFaq.tsx, src/app/staking/components/receipt/Receipt.tsx, src/lib/tenant/configs/ui/optimism.ts, src/app/staking/[addressOrENSName]/page.jsx, src/lib/tenant/configs/ui/etherfi.ts, src/app/staking/new/components/NewStakeFlow.tsx, src/app/staking/components/delegates/DelegateCardList.tsx, src/app/staking/components/PanelSetStakeAmount.tsx, src/app/staking/deposits/[deposit_id]/components/EditDepositConfirm.tsx, src/app/staking/new/components/NewStakeConfirm.tsx, src/lib/utils.ts, src/components/Proposals/ProposalPage/CastVoteDialog/CastVoteDialog.tsx, src/lib/tenant/tenantContractFactory.ts, src/app/staking/[addressOrENSName]/deposits/Deposit.tsx, public/images/receipt_bg.svg, src/lib/tenant/tenantUIFactory.ts, src/assets/tenant/uniswap_logo.svg, src/assets/tenant/uniswap_delegate.svg, src/app/api/images/og/assets/shared.tsx, src/lib/contracts/generated/factories/UniswapToken__factory.ts, src/lib/contracts/abis/UniswapToken.json, src/lib/contracts/abis/UniswapGovernor.json, src/assets/pending.svg, src/lib/contracts/generated/UniswapToken.ts, src/lib/contracts/generated/factories/UniswapStaker__factory.ts, src/lib/contracts/abis/UniswapStaker.json, src/lib/contracts/generated/UniswapStaker.ts, src/assets/tenant/uniswap_hero.svg, src/assets/success.svg, public/images/uni_rewards.svg, public/images/uni_deposit.svg

✨ Ask PR-Codex anything about this PR by commenting with /codex {your question}

Copy link

linear bot commented Apr 9, 2024

Copy link

vercel bot commented Apr 9, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
agora-next ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 6, 2024 5:44pm
agora-next-ens ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 6, 2024 5:44pm
agora-next-etherfi ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 6, 2024 5:44pm
agora-next-uniswap ✅ Ready (Inspect) Visit Preview 💬 9 unresolved
✅ 13 resolved
Jul 6, 2024 5:44pm


votingPeriod?: TypedContractMethod<[], [bigint], "view">;

weightCast?: TypedContractMethod<
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice this was blowing up the scroll governor

@@ -2,6 +2,11 @@ import type { TypedContractMethod } from "@/lib/contracts/generated/common";
import type { BaseContract, AddressLike } from "ethers";

export interface ITokenContract extends BaseContract {
allowance: TypedContractMethod<
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is the point of these to just add the the functions that we use in the app so that way we can ensure the contracts we are using have the needed properties? bc these are surely not all of the functions on the contract.

another benefit to viem/wagmi is it typechecks against the abi so you don't have to do this
I feel like a painpoint here is you need to remember to update this file everything you add a block of code that calls a function not yet included here

Comment on lines +13 to +14
const TOKEN = "0xC18360217D8F7Ab5e7c516566761Ea12Ce7F9D72";
const GOVERNOR = "0x0";
Copy link
Collaborator

@mcgingras mcgingras Jun 14, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd love to have isProd ? "0xProd" : "0xTest" for each tenant eventually

// Sepolia ETH
return `https://sepolia.etherscan.io/address/${address}`;

default:
Copy link
Collaborator

@mcgingras mcgingras Jun 14, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are ens + uni on mainnet? are you just letting them fall through to default

Copy link
Collaborator

@mcgingras mcgingras left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice!!

@stepandel
Copy link
Contributor

🔥🚀

kent pushed a commit that referenced this pull request Aug 30, 2024
* Tenant scaffolding

* OG image previews

* More tenant config

* Contract scaffolding

* Misc

* Staking route

* Uniswap tenant db placehoder

* Misc

* Prettier

* Misc

* Generated

* Staking contract scaffolding

* Uni token and staker abis

* Uni token and staker factoris

* work in progress

* WIP

* Staking flow

* Unstake flow dialog

* Unstake flow

* feat:Added Uni Staking UI/UX components

* Uniswap UI implementation

* Total staked

* feat:uni staking select delegate ui/ux components

* Wiring in the unstaking flow

* Rewards metrics header

* Prettier

* Refactor ui components for uni staking

* Work in progress

* Merge

* Delegate more flow

* feat:staking transaction receipt ui/ux components

* Additional delegations

* Fixed dialog refresh

* Fractional withdrawals

* Work in progress

* Implementing db calls

* Replaced contract calls with db

* wip Implementing deposit management flow

* revamp:updated ui of claim reward component and transaction receipt

* wip

* Implementing ui in deposit / withdrawal flows

* Prettier

* Implemented new delegation flow

* Misc

* New deposit flow

* Implementing UI on unistaker

* Minor refactor of the delegate card component

* Fixed pool stats

* Withdraw refresh flow and component cleanup

* Work in progress on editing deposit

* Edit deposit and displayed sktaed amount per user

* Unistaker

* Unistaker flow update

* More cleanup and bug bashing

* Merge and bugfixes

* Fixed delegate voting activity and build fixes

* Alligator dependecny

* Tenant abstracted delegation flow

* Prettier

* Resolved issue with scientific notation

* Impelmenting abstract vote contract

* Displaying transaction link and simplified button code

* Prettier

* Fixed a flicker issue with the deposit list

* Deposit list padding

* Disabled uniswap prop creation

* Refactored deposits to work with static wallet paths

* Misc

* Misc refactor

* Dynamic data refresh

* Updated the FAQ page and disconnect page layout

* Staking confirmation display

* Invalidation strategy

* Receipt background

* Implemented allowance approval

* Copy correction

* QA fixes

* Don't display duplicate delegate

* Tenant svg icon

* Display allowance and delegate icons

* Tenant-based ens avatars

* Fixed decimal rounding issue.

* Fixed max amount bugs and disable deposit button when no balance

* Refactored spending allowance flow

* Minor styling fix

* Abstract naming

* Disabled proposal cancel for non-alligator tenants. Misc UI fixes

* Minor cleanup and removed alligator requirement

* Console log

* Implemented chain-specific timestamps

* Implemented tenant-specific quorum calculations

* quorum votes for Uniswap governor

* Split advanced voting from the basic voting

* Linking proposed transactions to correct URLs

* Merge

* Merge with main

* Tenant copy

* Merge

* Mainnet contracts and a small bugfix

* Code review cleanup

* staking page flag and metadata

* Code review changes

* Misc

* minor code review

* Code review fix

---------

Co-authored-by: sbvhev <[email protected]>
Co-authored-by: Andrei Taraschuk <[email protected]>
jefag pushed a commit that referenced this pull request Oct 4, 2024
* Tenant scaffolding

* OG image previews

* More tenant config

* Contract scaffolding

* Misc

* Staking route

* Uniswap tenant db placehoder

* Misc

* Prettier

* Misc

* Generated

* Staking contract scaffolding

* Uni token and staker abis

* Uni token and staker factoris

* work in progress

* WIP

* Staking flow

* Unstake flow dialog

* Unstake flow

* feat:Added Uni Staking UI/UX components

* Uniswap UI implementation

* Total staked

* feat:uni staking select delegate ui/ux components

* Wiring in the unstaking flow

* Rewards metrics header

* Prettier

* Refactor ui components for uni staking

* Work in progress

* Merge

* Delegate more flow

* feat:staking transaction receipt ui/ux components

* Additional delegations

* Fixed dialog refresh

* Fractional withdrawals

* Work in progress

* Implementing db calls

* Replaced contract calls with db

* wip Implementing deposit management flow

* revamp:updated ui of claim reward component and transaction receipt

* wip

* Implementing ui in deposit / withdrawal flows

* Prettier

* Implemented new delegation flow

* Misc

* New deposit flow

* Implementing UI on unistaker

* Minor refactor of the delegate card component

* Fixed pool stats

* Withdraw refresh flow and component cleanup

* Work in progress on editing deposit

* Edit deposit and displayed sktaed amount per user

* Unistaker

* Unistaker flow update

* More cleanup and bug bashing

* Merge and bugfixes

* Fixed delegate voting activity and build fixes

* Alligator dependecny

* Tenant abstracted delegation flow

* Prettier

* Resolved issue with scientific notation

* Impelmenting abstract vote contract

* Displaying transaction link and simplified button code

* Prettier

* Fixed a flicker issue with the deposit list

* Deposit list padding

* Disabled uniswap prop creation

* Refactored deposits to work with static wallet paths

* Misc

* Misc refactor

* Dynamic data refresh

* Updated the FAQ page and disconnect page layout

* Staking confirmation display

* Invalidation strategy

* Receipt background

* Implemented allowance approval

* Copy correction

* QA fixes

* Don't display duplicate delegate

* Tenant svg icon

* Display allowance and delegate icons

* Tenant-based ens avatars

* Fixed decimal rounding issue.

* Fixed max amount bugs and disable deposit button when no balance

* Refactored spending allowance flow

* Minor styling fix

* Abstract naming

* Disabled proposal cancel for non-alligator tenants. Misc UI fixes

* Minor cleanup and removed alligator requirement

* Console log

* Implemented chain-specific timestamps

* Implemented tenant-specific quorum calculations

* quorum votes for Uniswap governor

* Split advanced voting from the basic voting

* Linking proposed transactions to correct URLs

* Merge

* Merge with main

* Tenant copy

* Merge

* Mainnet contracts and a small bugfix

* Code review cleanup

* staking page flag and metadata

* Code review changes

* Misc

* minor code review

* Code review fix

---------

Co-authored-by: sbvhev <[email protected]>
Co-authored-by: Andrei Taraschuk <[email protected]>
jefag pushed a commit that referenced this pull request Oct 4, 2024
* Tenant scaffolding

* OG image previews

* More tenant config

* Contract scaffolding

* Misc

* Staking route

* Uniswap tenant db placehoder

* Misc

* Prettier

* Misc

* Generated

* Staking contract scaffolding

* Uni token and staker abis

* Uni token and staker factoris

* work in progress

* WIP

* Staking flow

* Unstake flow dialog

* Unstake flow

* feat:Added Uni Staking UI/UX components

* Uniswap UI implementation

* Total staked

* feat:uni staking select delegate ui/ux components

* Wiring in the unstaking flow

* Rewards metrics header

* Prettier

* Refactor ui components for uni staking

* Work in progress

* Merge

* Delegate more flow

* feat:staking transaction receipt ui/ux components

* Additional delegations

* Fixed dialog refresh

* Fractional withdrawals

* Work in progress

* Implementing db calls

* Replaced contract calls with db

* wip Implementing deposit management flow

* revamp:updated ui of claim reward component and transaction receipt

* wip

* Implementing ui in deposit / withdrawal flows

* Prettier

* Implemented new delegation flow

* Misc

* New deposit flow

* Implementing UI on unistaker

* Minor refactor of the delegate card component

* Fixed pool stats

* Withdraw refresh flow and component cleanup

* Work in progress on editing deposit

* Edit deposit and displayed sktaed amount per user

* Unistaker

* Unistaker flow update

* More cleanup and bug bashing

* Merge and bugfixes

* Fixed delegate voting activity and build fixes

* Alligator dependecny

* Tenant abstracted delegation flow

* Prettier

* Resolved issue with scientific notation

* Impelmenting abstract vote contract

* Displaying transaction link and simplified button code

* Prettier

* Fixed a flicker issue with the deposit list

* Deposit list padding

* Disabled uniswap prop creation

* Refactored deposits to work with static wallet paths

* Misc

* Misc refactor

* Dynamic data refresh

* Updated the FAQ page and disconnect page layout

* Staking confirmation display

* Invalidation strategy

* Receipt background

* Implemented allowance approval

* Copy correction

* QA fixes

* Don't display duplicate delegate

* Tenant svg icon

* Display allowance and delegate icons

* Tenant-based ens avatars

* Fixed decimal rounding issue.

* Fixed max amount bugs and disable deposit button when no balance

* Refactored spending allowance flow

* Minor styling fix

* Abstract naming

* Disabled proposal cancel for non-alligator tenants. Misc UI fixes

* Minor cleanup and removed alligator requirement

* Console log

* Implemented chain-specific timestamps

* Implemented tenant-specific quorum calculations

* quorum votes for Uniswap governor

* Split advanced voting from the basic voting

* Linking proposed transactions to correct URLs

* Merge

* Merge with main

* Tenant copy

* Merge

* Mainnet contracts and a small bugfix

* Code review cleanup

* staking page flag and metadata

* Code review changes

* Misc

* minor code review

* Code review fix

---------

Co-authored-by: sbvhev <[email protected]>
Co-authored-by: Andrei Taraschuk <[email protected]>
jefag pushed a commit that referenced this pull request Oct 8, 2024
* Tenant scaffolding

* OG image previews

* More tenant config

* Contract scaffolding

* Misc

* Staking route

* Uniswap tenant db placehoder

* Misc

* Prettier

* Misc

* Generated

* Staking contract scaffolding

* Uni token and staker abis

* Uni token and staker factoris

* work in progress

* WIP

* Staking flow

* Unstake flow dialog

* Unstake flow

* feat:Added Uni Staking UI/UX components

* Uniswap UI implementation

* Total staked

* feat:uni staking select delegate ui/ux components

* Wiring in the unstaking flow

* Rewards metrics header

* Prettier

* Refactor ui components for uni staking

* Work in progress

* Merge

* Delegate more flow

* feat:staking transaction receipt ui/ux components

* Additional delegations

* Fixed dialog refresh

* Fractional withdrawals

* Work in progress

* Implementing db calls

* Replaced contract calls with db

* wip Implementing deposit management flow

* revamp:updated ui of claim reward component and transaction receipt

* wip

* Implementing ui in deposit / withdrawal flows

* Prettier

* Implemented new delegation flow

* Misc

* New deposit flow

* Implementing UI on unistaker

* Minor refactor of the delegate card component

* Fixed pool stats

* Withdraw refresh flow and component cleanup

* Work in progress on editing deposit

* Edit deposit and displayed sktaed amount per user

* Unistaker

* Unistaker flow update

* More cleanup and bug bashing

* Merge and bugfixes

* Fixed delegate voting activity and build fixes

* Alligator dependecny

* Tenant abstracted delegation flow

* Prettier

* Resolved issue with scientific notation

* Impelmenting abstract vote contract

* Displaying transaction link and simplified button code

* Prettier

* Fixed a flicker issue with the deposit list

* Deposit list padding

* Disabled uniswap prop creation

* Refactored deposits to work with static wallet paths

* Misc

* Misc refactor

* Dynamic data refresh

* Updated the FAQ page and disconnect page layout

* Staking confirmation display

* Invalidation strategy

* Receipt background

* Implemented allowance approval

* Copy correction

* QA fixes

* Don't display duplicate delegate

* Tenant svg icon

* Display allowance and delegate icons

* Tenant-based ens avatars

* Fixed decimal rounding issue.

* Fixed max amount bugs and disable deposit button when no balance

* Refactored spending allowance flow

* Minor styling fix

* Abstract naming

* Disabled proposal cancel for non-alligator tenants. Misc UI fixes

* Minor cleanup and removed alligator requirement

* Console log

* Implemented chain-specific timestamps

* Implemented tenant-specific quorum calculations

* quorum votes for Uniswap governor

* Split advanced voting from the basic voting

* Linking proposed transactions to correct URLs

* Merge

* Merge with main

* Tenant copy

* Merge

* Mainnet contracts and a small bugfix

* Code review cleanup

* staking page flag and metadata

* Code review changes

* Misc

* minor code review

* Code review fix

---------

Co-authored-by: sbvhev <[email protected]>
Co-authored-by: Andrei Taraschuk <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants