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

fix: hide cowswap solver on sidechains #262

Merged
merged 2 commits into from
Jul 1, 2023

Conversation

Majorfi
Copy link
Collaborator

@Majorfi Majorfi commented Jun 29, 2023

Description

On sidechains (not 1), hide the cowswap solver as it cannot be used. Requested by Coinbase.

Related Issue

NA

Motivation and Context

Requested by coinbase

How Has This Been Tested?

Tested on mainnet vs optimism

Screenshots (if appropriate):

@Majorfi Majorfi added the enhancement New feature or request label Jun 29, 2023
@Majorfi Majorfi requested a review from karelianpie June 29, 2023 09:21
@Majorfi Majorfi self-assigned this Jun 29, 2023
@vercel
Copy link

vercel bot commented Jun 29, 2023

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

Name Status Preview Comments Updated (UTC)
yearnfi ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 1, 2023 8:53am

Comment on lines +19 to +21
if (chainID !== 1 && zapProvider === 'Cowswap') {
return 'Wido';
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

If not 1 and Cowswap, switch back to second solver, aka Wido

Copy link
Member

Choose a reason for hiding this comment

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

Wondering if we can have a more centralized place to decide when or which network a zap should be enabled, that way we could keep the logic as is and just disable the zap for specific networks. Wdyt?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Should probably be refactored at some point yes.

value={Solver.enum.Cowswap}>
{Solver.enum.Cowswap}
</option>
{chainID === 1 ? (
Copy link
Member

Choose a reason for hiding this comment

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

Would this logic be better in isSolverDisabled?

@Majorfi
Copy link
Collaborator Author

Majorfi commented Jul 1, 2023

Merging for now, even if some improvements can be made

@Majorfi Majorfi merged commit 36e1f4a into main Jul 1, 2023
6 of 7 checks passed
@Majorfi Majorfi deleted the fix/hide-cowswap-solver-sidechains branch July 1, 2023 08:49
Majorfi added a commit that referenced this pull request Jul 3, 2023
Majorfi added a commit that referenced this pull request Aug 28, 2023
* feat: add delegate vote action

* feat: add address validation

* feat: add input common component

* feat: add gauge vote tab

* feat: add base gauge context

* feat: add gauge actions

* feat: add table common component

* feat: add gauge tab with mock data

* refactor: sort order states

* fix: table sizing

* fix: table header font size

* refactor: isNumber cast

* style: readability improvements

* refactor: input placeholder

* refactor: nullish coalescing

* refactor: sort numbers

* refactor: keyBy typing

* refactor: isString util

* style: remove unnecessary unknowns

* style: remove unnesessary cast

* refactor: replace mt for gap

* style: isNumberable better naming

* fix: gauge tab table span

* fix: update unstake interface changes

* feat: add gauge reward position

* feat: add gauge boost

* refactor: user positions not optional

* feat: add base generic dropdown component

* feat: add dropdown improvements

* feat: add base rewards tab UI

* feat: Generic table pagination (#79)

* feat: Generic table pagination

* refactor: Styling

* refactor: Greyer caption

* refactor: Extract pagination to usePagination hook

* refactor: Separate usePagination from Pagination

* feat: add base redeem tab

* feat: implement base gauge interactions

* feat: optional table pagination

* feat: implement base rewards functionality

* feat: update to latest actions interface

* feat: add base options context

* feat: add options allowance fetcher

* fix: use default provider

* refactor: use unique allowance ID

* feat: add dynamic required eth fetcher

* fix: new types directory

* feat: add option actions

* feat: add contexts to veyfi app wrapper

* feat: add base option redeem functionality

* feat: update contract abi

* feat: support bignumbers on tables

* feat: import contract ABIs

* feat: format gauge table columns

* feat: add option price calcs

* feat: add option price to views

* feat: update options contracts

* fix: gauge staking

* fix: calculate boost using fixed number

* fix: fetch next boost

* feat: display gauges with rewards only

* refactor: claim reward actions

* fix: option price fetcher

* fix: update redeem option interface

* fix: update gauge abi

* fix: allowance key changes

* fix: redeem action details

* refactor: BigNumber -> bigint

* fix: Expression

* feat: Migrate useGauge to wagmi

* refactor: Migrate useGauge to wagmi

* refactor: Use 1 for chain id

* feat: Migrate useOption to wagmi

* feat: Migrate RewardsTab to wagmi

* feat: Assert gauge addresses

* refactor: Use `isDisabled` rather than `disabled` prop

Co-authored-by: Major <90963895+Majorfi@users.noreply.github.com>

* @karelianpie @Majorfi refactor: Use `isDisabled` rather than `disabled` prop

Co-authored-by: Major <90963895+Majorfi@users.noreply.github.com>

* feat: Migrate RedeemTab to wagmi

* Update apps/veyfi/components/RedeemTab.tsx

Co-authored-by: Major <90963895+Majorfi@users.noreply.github.com>

* feat: Assert account address and amount

* feat: Migrate VoteTab to wagmi

* refactor: Assert all addresses

* feat: Migrate GaugesTab to wagmi

* fix: Remove commented out code

* fix: Import the correct assert

* refactor: Assert accountAddress

* Update _app.tsx (#259)

* fix: Typo (#260)

* fix: refresh stuff

* fix: image with fallback

* fix: wallet connect

* fix: disable wallet connect while waiting for v2 validation

* fix: wallet connect

* fix: upd style

* feat: clean files

* fix: chain

* fix: Use want symbol for Total Deposited (#261)

Co-authored-by: Major <90963895+Majorfi@users.noreply.github.com>

* fix: wallet

* fix: networks

* fix: add rpc

* fix: add rpc

* feat: update optimism networks

* fix: On Optimism it shows New on the list but 0 inside

* fix: hide cowswap solver on sidechains (#262)

* fix: opt

* fix: bump lib for iFrame fix

* refactor: Rename toWagmiProvider -> wagmiUtils

* refactor: Use viem instead of ethers

* refactor: Move formatBytes32String -> stringToHex

* feat: Add assert ethRequired

* refactor: Remove unnecessary fn, use approveERC20

* Cast to const

Co-authored-by: Major <90963895+Majorfi@users.noreply.github.com>

* refactor: Use cl()

* fix: Remove extra spaces

* fix: Make tailwind css literal

* refactor: Move all constants to the same file

* Add missing space

Co-authored-by: Major <90963895+Majorfi@users.noreply.github.com>

* fix: Formatting

Co-authored-by: Major <90963895+Majorfi@users.noreply.github.com>

* refactor: Convert fn to wagmi

* refactor: Use separate args rather than array

* fix: Use isDisabled prop

* refactor: Use cl, props in multiple lines

* refactor: Use cl

* refactor: Replace with a useAsync

* refactor: Convert async fn to usCallback

* feat: Use cl()

* feat: Fetch prices on mount

* feat: Add refreshPrice to the dep array

* refactor: Replace useSWR with useAsync

* refactor(useGauge): Replace useSWR with useAsync

* refactor: Remove unnecessary prop

* feat: Add button role

Co-authored-by: Major <90963895+Majorfi@users.noreply.github.com>

* feat: Add button role

Co-authored-by: Major <90963895+Majorfi@users.noreply.github.com>

* feat: Move usePagination to common hooks

* refactor: Remove `.toString()`

Co-authored-by: Major <90963895+Majorfi@users.noreply.github.com>

* refactor: Tailwindcss dynamic classnames

* feat: Add `gauge-voting` feature flag

* chore: Update CHANGELOG

---------

Co-authored-by: xgambitox <18649057+xgambitox@users.noreply.github.com>
Co-authored-by: Major <90963895+Majorfi@users.noreply.github.com>
Co-authored-by: Major <major@ycorpo.com>
Co-authored-by: murderteeth <89237203+murderteeth@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants