diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a6e0d58d56..df2ad2a156 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -25,7 +25,7 @@ Thank you for your interest in contributing to the CowSwap interface! ๐Ÿฎ ## Finding a first issue Start with issues with the label -[`good first issue`](https://github.com/Gnosis/cowswap/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22). +[`Help wanted`](https://github.com/cowprotocol/cowswap/issues?q=is%3Aopen+is%3Aissue+label%3A%22Help_Wanted%22+). ## Pull requests diff --git a/README.md b/README.md index 38bbe0e1c2..b9e22e5644 100644 --- a/README.md +++ b/README.md @@ -1,32 +1,25 @@ -[![Gitpod ready-to-code](https://img.shields.io/badge/Gitpod-ready--to--code-blue?logo=gitpod)](https://gitpod.io/#https://github.com/gnosis/gp-swap-ui) - -

- -

- -[![Lint](https://github.com/gnosis/dex-swap/workflows/Lint/badge.svg)](https://github.com/gnosis/dex-swap/actions?query=workflow%3ALint) -[![Tests](https://github.com/gnosis/dex-swap/workflows/Tests/badge.svg)](https://github.com/gnosis/dex-swap/actions?query=workflow%3ATests) +[![Tests](https://github.com/cowprotocol/cowswap/workflows/CI/badge.svg)](https://github.com/cowprotocol/cowswap/actions/workflows/ci.yml?query=workflow%3ACI) [![Styled With Prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://prettier.io/) -CowSwap is the first trading interface built on top of CoW Protocol v2. +CowSwap is the first trading interface built on top of CoW Protocol. It allows you to buy and sell tokens using gas-less orders that are settled peer-to-peer among its users or into any on-chain liquidity source while providing MEV protection. - ๐Ÿฎ**Official Website**๐Ÿฎ: - ENS Website (alternative): , or if you have MetaMask or an ENS compatible browser. - - The website can also be run locally, or from IPFS. Every release will have an IPFS hash associated, available in the [Releases](https://github.com/gnosis/gp-swap-ui/releases) section. + - The website can also be run locally, or from IPFS. Every release will have an IPFS hash associated, available in the [Releases](https://github.com/cowprotocol/cowswap/releases) section. +- Protocol: - Docs: - Stats: -- Twitter: [@gnosisPM](https://twitter.com/gnosisPM) -- Reddit: [/r/gnosisPM](https://www.reddit.com/r/gnosisPM) +- Twitter: [@MEVprotection](https://twitter.com/MEVprotection) - Discord: Please see the: -- [CoW Protocol: Smart contracts](https://github.com/gnosis/gp-v2-contracts) -- [CoW Protocol: Services](https://github.com/gnosis/gp-v2-services) +- [CoW Protocol: Smart contracts](https://github.com/cowprotocol/contracts) +- [CoW Protocol: Services](https://github.com/cowprotocol/services) You can block an entire list of tokens by passing in a tokenlist like [here](./src/constants/lists.ts) or you can block specific tokens by adding them to [unsupported.tokenlist.json](./src/constants/tokenLists/unsupported.tokenlist.json). @@ -143,7 +136,7 @@ REACT_APP_NETWORK_URL_100=https://rpc.xdaichain.com Fee quote requests and posting orders are sent to an API. This API has the responsibility of collecting orders and handing them to the solvers. -The reference implementation of th API is [gp-v2-services](https://github.com/gnosis/gp-v2-services). +The reference implementation of th API is [gp-v2-services](https://github.com/cowprotocol/services). The API endpoint is configured using the environment variable ` {XDAI|RINKEBY|MAINNET}` to e.g. `"http://localhost:8080/api"` when running the services locally. diff --git a/src/custom/api/gnosisProtocol/api.ts b/src/custom/api/gnosisProtocol/api.ts index c7bc149f4e..04cef488e4 100644 --- a/src/custom/api/gnosisProtocol/api.ts +++ b/src/custom/api/gnosisProtocol/api.ts @@ -8,7 +8,7 @@ import { SigningSchemeValue, UnsignedOrder, } from 'utils/signatures' -import { APP_DATA_HASH, GAS_FEE_ENDPOINTS } from 'constants/index' +import { APP_DATA_HASH, GAS_FEE_ENDPOINTS, RAW_CODE_LINK } from 'constants/index' import { registerOnWindow } from 'utils/misc' import { isBarn, isDev, isLocal, isPr } from '../../utils/environments' import OperatorError, { @@ -63,7 +63,7 @@ function getProfileUrl(): Partial> { [ChainId.MAINNET]: process.env.REACT_APP_PROFILE_API_URL_STAGING_MAINNET || 'https://api.cow.fi/affiliate/api', } } -const STRATEGY_URL_BASE = 'https://raw.githubusercontent.com/gnosis/cowswap/configuration/config/strategies' +const STRATEGY_URL_BASE = RAW_CODE_LINK + '/configuration/config/strategies' function getPriceStrategyUrl(): Record { return { [SupportedChainId.MAINNET]: STRATEGY_URL_BASE + '/strategy-1.json', diff --git a/src/custom/api/gnosisProtocol/errors/OperatorError.ts b/src/custom/api/gnosisProtocol/errors/OperatorError.ts index aae6280bcb..708e5bd175 100644 --- a/src/custom/api/gnosisProtocol/errors/OperatorError.ts +++ b/src/custom/api/gnosisProtocol/errors/OperatorError.ts @@ -9,9 +9,9 @@ export interface ApiErrorObject { } // Conforms to backend API -// https://github.com/gnosis/gp-v2-services/blob/main/crates/orderbook/openapi.yml#L801 +// https://github.com/cowprotocol/services/blob/main/crates/orderbook/openapi.yml#L801 // and -// https://github.com/gnosis/gp-v2-services/blob/main/crates/orderbook/openapi.yml#L740 +// https://github.com/cowprotocol/services/blob/main/crates/orderbook/openapi.yml#L740 export enum ApiErrorCodes { DuplicateOrder = 'DuplicateOrder', InvalidSignature = 'InvalidSignature', @@ -94,7 +94,7 @@ export default class OperatorError extends Error { description: ApiErrorObject['description'] // Status 400 errors - // https://github.com/gnosis/gp-v2-services/blob/9014ae55412a356e46343e051aefeb683cc69c41/orderbook/openapi.yml#L563 + // https://github.com/cowprotocol/services/blob/9014ae55412a356e46343e051aefeb683cc69c41/orderbook/openapi.yml#L563 static apiErrorDetails = ApiErrorCodeDetails public static async getErrorMessage(response: Response, action: ApiActionType) { diff --git a/src/custom/api/gnosisProtocol/errors/QuoteError.ts b/src/custom/api/gnosisProtocol/errors/QuoteError.ts index 9a6a061103..bfcf2fa45f 100644 --- a/src/custom/api/gnosisProtocol/errors/QuoteError.ts +++ b/src/custom/api/gnosisProtocol/errors/QuoteError.ts @@ -7,7 +7,7 @@ export interface GpQuoteErrorObject { } // Conforms to backend API -// https://github.com/gnosis/gp-v2-services/blob/main/crates/orderbook/openapi.yml +// https://github.com/cowprotocol/services/blob/main/crates/orderbook/openapi.yml export enum GpQuoteErrorCodes { UnsupportedToken = 'UnsupportedToken', InsufficientLiquidity = 'InsufficientLiquidity', @@ -67,7 +67,7 @@ export default class GpQuoteError extends Error { data?: any // Status 400 errors - // https://github.com/gnosis/gp-v2-services/blob/9014ae55412a356e46343e051aefeb683cc69c41/orderbook/openapi.yml#L563 + // https://github.com/cowprotocol/services/blob/9014ae55412a356e46343e051aefeb683cc69c41/orderbook/openapi.yml#L563 static quoteErrorDetails = GpQuoteErrorDetails public static async getErrorMessage(response: Response) { diff --git a/src/custom/components/ErrorBoundary/ErrorBoundaryMod.tsx b/src/custom/components/ErrorBoundary/ErrorBoundaryMod.tsx index 507c4159b3..bbfa6c0f62 100644 --- a/src/custom/components/ErrorBoundary/ErrorBoundaryMod.tsx +++ b/src/custom/components/ErrorBoundary/ErrorBoundaryMod.tsx @@ -16,6 +16,7 @@ import CowError from 'assets/cow-swap/CowError.png' import { UniIcon, LogoImage } from '../Header' import { HeaderRow } from 'components/Header/HeaderMod' import Footer from 'components/Footer' +import { DISCORD_LINK, CODE_LINK } from 'constants/index' /* const FallbackWrapper = styled.div` display: flex; @@ -197,9 +198,12 @@ export default class ErrorBoundary extends React.Component Create an issue on GitHub @@ -208,7 +212,7 @@ export default class ErrorBoundary extends React.Component - + Get support on Discord โ†— diff --git a/src/custom/components/Header/URLWarning/index.tsx b/src/custom/components/Header/URLWarning/index.tsx index da6aeada18..6d62f5fd07 100644 --- a/src/custom/components/Header/URLWarning/index.tsx +++ b/src/custom/components/Header/URLWarning/index.tsx @@ -1,5 +1,5 @@ import styled from 'styled-components/macro' -import { BARN_URL, PRODUCTION_URL } from 'constants/index' +import { BARN_URL, PRODUCTION_URL, RAW_CODE_LINK } from 'constants/index' import { AlertTriangle } from 'react-feather' import URLWarningUni, { PhishAlert, StyledClose } from './URLWarningMod' import { useAnnouncementVisible, useCloseAnnouncement } from 'state/profile/hooks' @@ -49,8 +49,7 @@ const Wrapper = styled.div` // Announcement content: Modify this file to edit the announcement // https://github.com/gnosis/cowswap/blob/configuration/config/announcements/announcements.md -const ANNOUNCEMENTS_MARKDOWN_BASE_URL = - 'https://raw.githubusercontent.com/gnosis/cowswap/configuration/config/announcements' +const ANNOUNCEMENTS_MARKDOWN_BASE_URL = RAW_CODE_LINK + '/configuration/config/announcements' function getAnnouncementUrl(chainId: number) { return `${ANNOUNCEMENTS_MARKDOWN_BASE_URL}/announcements-${chainId}.md` diff --git a/src/custom/connectors/index.ts b/src/custom/connectors/index.ts index 4694fc4bd2..61ed70729b 100644 --- a/src/custom/connectors/index.ts +++ b/src/custom/connectors/index.ts @@ -119,7 +119,7 @@ export const portis = new PortisConnector({ export const walletlink = new WalletLinkConnector({ url: rpcNetworks[NETWORK_CHAIN_ID], appName: 'CowSwap', - appLogoUrl: 'https://raw.githubusercontent.com/gnosis/gp-swap-ui/develop/public/favicon.png', + appLogoUrl: 'https://raw.githubusercontent.com/cowprotocol/cowswap/develop/public/favicon.png', supportedChainIds: getSupportedChainIds(), }) diff --git a/src/custom/constants/index.ts b/src/custom/constants/index.ts index 16ddf74b8e..c02a5dc91f 100644 --- a/src/custom/constants/index.ts +++ b/src/custom/constants/index.ts @@ -69,7 +69,7 @@ export const COW_CONTRACT_ADDRESS: Record = { [ChainId.RINKEBY]: '0xbdf1e19f8c78A77fb741b44EbA5e4c0C8DBAeF91', } -// See https://github.com/gnosis/gp-v2-contracts/commit/821b5a8da213297b0f7f1d8b17c893c5627020af#diff-12bbbe13cd5cf42d639e34a39d8795021ba40d3ee1e1a8282df652eb161a11d6R13 +// See https://github.com/cowprotocol/contracts/commit/821b5a8da213297b0f7f1d8b17c893c5627020af#diff-12bbbe13cd5cf42d639e34a39d8795021ba40d3ee1e1a8282df652eb161a11d6R13 export const NATIVE_CURRENCY_BUY_ADDRESS = '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE' export const NATIVE_CURRENCY_BUY_TOKEN: { [chainId in ChainId | number]: Token } = { [ChainId.MAINNET]: new Token(ChainId.MAINNET, NATIVE_CURRENCY_BUY_ADDRESS, 18, 'ETH', 'Ether'), @@ -94,13 +94,16 @@ export const WETH_LOGO_URI = export const XDAI_LOGO_URI = 'https://raw.githubusercontent.com/1Hive/default-token-list/master/src/assets/xdai/0xe91d153e0b41518a2ce8dd3d7944fa863463a97d/logo.png' +const GITHUB_REPOSITORY = 'cowprotocol/cowswap' +export const CODE_LINK = 'https://github.com/' + GITHUB_REPOSITORY +export const RAW_CODE_LINK = 'https://raw.githubusercontent.com/' + GITHUB_REPOSITORY + export const DOCS_LINK = 'https://docs.cow.fi' -export const CONTRACTS_CODE_LINK = 'https://github.com/gnosis/gp-v2-contracts' -export const CODE_LINK = 'https://github.com/cowprotocol/cowswap' +export const CONTRACTS_CODE_LINK = 'https://github.com/cowprotocol/contracts' export const DISCORD_LINK = 'https://discord.com/invite/cowprotocol' export const DUNE_DASHBOARD_LINK = 'https://duneanalytics.com/gnosis.protocol/Gnosis-Protocol-V2' export const TWITTER_LINK = 'https://twitter.com/mevprotection' -export const GPAUDIT_LINK = 'https://github.com/gnosis/gp-v2-contracts/blob/main/audits/GnosisProtocolV2May2021.pdf' +export const GPAUDIT_LINK = 'https://github.com/cowprotocol/contracts/blob/main/audits/GnosisProtocolV2May2021.pdf' export const FLASHBOYS_LINK = 'https://arxiv.org/abs/1904.05234' export const COWWIKI_LINK = 'https://en.wikipedia.org/wiki/Coincidence_of_wants' export const GNOSIS_FORUM_ROADTODECENT_LINK = 'https://forum.gnosis.io/t/gpv2-road-to-decentralization/1245' diff --git a/src/custom/constants/lists.ts b/src/custom/constants/lists.ts index 7a303ecac8..13900a5f90 100644 --- a/src/custom/constants/lists.ts +++ b/src/custom/constants/lists.ts @@ -1,5 +1,6 @@ // used to mark unsupported tokens, these are hosted lists of unsupported tokens import { SupportedChainId as ChainId } from 'constants/chains' +import { RAW_CODE_LINK } from '.' export * from '@src/constants/lists' @@ -24,8 +25,7 @@ const GEMINI_LIST = 'https://www.gemini.com/uniswap/manifest.json' const BA_LIST = 'https://raw.githubusercontent.com/The-Blockchain-Association/sec-notice-list/master/ba-sec-list.json' // Rinkeby Default -const RINKEBY_LIST = - 'https://raw.githubusercontent.com/cowprotocol/cowswap/main/src/custom/tokens/rinkeby-token-list.json' +const RINKEBY_LIST = RAW_CODE_LINK + '/main/src/custom/tokens/rinkeby-token-list.json' // XDAI Default const HONEY_SWAP_XDAI = 'https://tokens.honeyswap.org' diff --git a/src/custom/pages/Faq/TradingFaq.tsx b/src/custom/pages/Faq/TradingFaq.tsx index cf3a5cd710..349cf662b9 100644 --- a/src/custom/pages/Faq/TradingFaq.tsx +++ b/src/custom/pages/Faq/TradingFaq.tsx @@ -126,7 +126,7 @@ export default function TokenFaq() { When an order is executed, the settlement contract withdraws the sell amount from the traderโ€™s token balance via the CoW Protocol Vault Relayer (for more information read{' '} diff --git a/src/custom/state/claim/hooks/index.ts b/src/custom/state/claim/hooks/index.ts index e459abb398..ea3de6d090 100644 --- a/src/custom/state/claim/hooks/index.ts +++ b/src/custom/state/claim/hooks/index.ts @@ -620,7 +620,7 @@ function _getClaimManyArgs({ nativeTokenPrice, }: GetClaimManyArgsParams): GetClaimManyArgsResult { // Arrays are named according to contract parameters - // For more info, check https://github.com/gnosis/gp-v2-token/blob/main/src/contracts/mixins/MerkleDistributor.sol#L123 + // For more info, check https://github.com/cowprotocol/token/blob/main/src/contracts/mixins/MerkleDistributor.sol#L123 const indices: ClaimManyFnArgs[0] = [] const claimTypes: ClaimManyFnArgs[1] = [] const claimants: ClaimManyFnArgs[2] = [] @@ -731,7 +731,7 @@ function _hasNoInputOrInputIsGreaterThanClaimAmount( * * The calculation is done based on the formula: * vCowAmount * wethPrice / 10^18 - * See https://github.com/gnosis/gp-v2-token/blob/main/src/contracts/mixins/Claiming.sol#L314-L320 + * See https://github.com/cowprotocol/token/blob/main/src/contracts/mixins/Claiming.sol#L314-L320 */ function _getClaimValue(claim: UserClaimData, vCowAmount: string, nativeTokenPrice: string): string { if (claim.type !== ClaimType.UserOption) { diff --git a/src/custom/utils/misc.ts b/src/custom/utils/misc.ts index a9ba71d054..9b48925219 100644 --- a/src/custom/utils/misc.ts +++ b/src/custom/utils/misc.ts @@ -55,7 +55,7 @@ export interface TokensFromMarketParams extends Market { } export function getCanonicalMarket({ sellToken, buyToken, kind }: CanonicalMarketParams): Market { - // TODO: Implement smarter logic https://github.com/gnosis/gp-ui/issues/331 + // TODO: Implement smarter logic https://github.com/cowprotocol/explorer/issues/9 // Not big reasoning on my selection of what is base and what is quote (important thing in this PR is just to do a consistent selection) // The used reasoning is: