Skip to content
This repository has been archived by the owner on Jun 24, 2022. It is now read-only.

Commit

Permalink
[Hotfix 🔥 ] - 1.12.4 - rc.2 (#2615)
Browse files Browse the repository at this point in the history
* Split refactor faq (#2592)

* Update FAQ to reflect Token Launch

This PR pushes a new content section from lines 559 - 627 that addresses questions related to the token launch. I have tried format everything as good as I possibly know/can, apologies if it needs to be reworked.

Questions are:
562 - Does CowSwap Have a token?
580 - Is there a proposal to make vCOW transferrable?
585 - what is the purspose of the COW tokens?
605 - what was the criteria for the token airdrop?

* Fix code style issues with Prettier

* Fix building error

* Add space

* Update index.tsx

* Fix code style issues with Prettier

* Split and refactor FAQ

* Fix links

* Add footer

* Add footer to index too

* Update metrics

* Fix internal links

* Hide back in home

* Link to FAQ

* Correct year

* Fix typo. Fixes #2067

Co-authored-by: Alex V <[email protected]>
Co-authored-by: Lint Action <[email protected]>

* Re-style FAQ menu. (#2611)

* Update FAQ to reflect Token Launch

This PR pushes a new content section from lines 559 - 627 that addresses questions related to the token launch. I have tried format everything as good as I possibly know/can, apologies if it needs to be reworked. 

Questions are: 
562 - Does CowSwap Have a token? 
580 - Is there a proposal to make vCOW transferrable?
585 - what is the purspose of the COW tokens?
605 - what was the criteria for the token airdrop?

* Fix code style issues with Prettier

* Fix building error

* Add space

* Profile page: Add vCOW swap feature cards (#2564)

* Style vCOW swap cards.

* Style vCOW swap cards. (#2565)

* Add governance card banner. (#2566)

* Add governance card banner.

* Governance banner update styles.

* Make question icon use dynamic dark/light mode colors.

* Center content properly cross devices.

* Dummy values.

* Disable unused vars

* Cleanup obsolete color

* Moving custom components to mod file to avoid circular dependencies/lazy loading issues (#2580)

Co-authored-by: Leandro <[email protected]>

* Remove isClaiming flag (#2586)

* Remove lint warn (#2587)

* Update index.tsx

* Fix code style issues with Prettier

* Split and refactor FAQ

* Update FAQ to reflect Token Launch (#2540)

* Update FAQ to reflect Token Launch

This PR pushes a new content section from lines 559 - 627 that addresses questions related to the token launch. I have tried format everything as good as I possibly know/can, apologies if it needs to be reworked. 

Questions are: 
562 - Does CowSwap Have a token? 
580 - Is there a proposal to make vCOW transferrable?
585 - what is the purspose of the COW tokens?
605 - what was the criteria for the token airdrop?

* Fix code style issues with Prettier

* Fix building error

* Add space

* Update index.tsx

* Fix code style issues with Prettier

* Add punctuantions

Co-authored-by: Lint Action <[email protected]>
Co-authored-by: Anxo Rodriguez <[email protected]>

* Fix links

* Add footer

* Add footer to index too

* Update metrics

* Fix internal links

* Hide back in home

* Link to FAQ

* Correct year

* Fix typo. Fixes #2067

* Re-style FAQ menu.

* Title styles.

* Cleanup console.log

* Fix merge and style back to top + misc.

* Text updates.

* Fix code style issues with Prettier

* Remove click events.

* Fix lint issue.

* Remove is claim enabled

Co-authored-by: Alex V <[email protected]>
Co-authored-by: Lint Action <[email protected]>
Co-authored-by: Anxo Rodriguez <[email protected]>
Co-authored-by: Leandro Boscariol <[email protected]>
Co-authored-by: Leandro <[email protected]>
Co-authored-by: w3stside <[email protected]>

Co-authored-by: Anxo Rodriguez <[email protected]>
Co-authored-by: Alex V <[email protected]>
Co-authored-by: Lint Action <[email protected]>
Co-authored-by: fairlight <[email protected]>
Co-authored-by: Leandro Boscariol <[email protected]>
Co-authored-by: Leandro <[email protected]>
Co-authored-by: w3stside <[email protected]>
  • Loading branch information
8 people authored Mar 30, 2022
1 parent 9735ce0 commit f0d0050
Show file tree
Hide file tree
Showing 21 changed files with 1,335 additions and 929 deletions.
2 changes: 1 addition & 1 deletion cypress/plugins/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
/**
* @type {Cypress.PluginConfig}
*/
// eslint-disable-next-line no-unused-vars
// eslint-disable-next-line @typescript-eslint/no-unused-vars
module.exports = (on, config) => {
// `on` is used to hook into various events Cypress emits
// `config` is the resolved Cypress config
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ function RequestCancellationModal(props: RequestCancellationModalProps): JSX.Ele
<p>
This means that a solver might already have included the order in a solution even if this cancellation
is successful. Read more in the{' '}
<a target="_blank" href="/#/faq#can-i-cancel-an-order">
<a target="_blank" href="/#/faq/trading#can-i-cancel-an-order">
FAQ
</a>
.
Expand Down
19 changes: 8 additions & 11 deletions src/custom/components/Header/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ import Modal from 'components/Modal'
// import ClaimModal from 'components/claim/ClaimModal'
import UniBalanceContent from 'components/Header/UniBalanceContent'
import CowClaimButton from 'components/CowClaimButton'
import { IS_CLAIMING_ENABLED } from 'pages/Claim/const'

export const NETWORK_LABELS: { [chainId in ChainId]?: string } = {
[ChainId.RINKEBY]: 'Rinkeby',
Expand Down Expand Up @@ -276,16 +275,14 @@ export default function Header() {
<NetworkSelector />
</HeaderElement>
<HeaderElement>
{IS_CLAIMING_ENABLED && (
<VCowWrapper>
<CowClaimButton
isClaimPage={isClaimPage}
account={account}
chainId={chainId}
handleOnClickClaim={handleOnClickClaim}
/>
</VCowWrapper>
)}
<VCowWrapper>
<CowClaimButton
isClaimPage={isClaimPage}
account={account}
chainId={chainId}
handleOnClickClaim={handleOnClickClaim}
/>
</VCowWrapper>

<AccountElement active={!!account} style={{ pointerEvents: 'auto' }}>
{account && userEthBalance && (
Expand Down
15 changes: 6 additions & 9 deletions src/custom/components/Menu/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import { getExplorerAddressLink } from 'utils/explorer'
import { useHasOrders } from 'api/gnosisProtocol/hooks'
import { useHistory } from 'react-router-dom'
import CowClaimButton, { Wrapper as ClaimButtonWrapper } from 'components/CowClaimButton'
import { IS_CLAIMING_ENABLED } from 'pages/Claim/const'

import twitterImage from 'assets/cow-swap/twitter.svg'
import discordImage from 'assets/cow-swap/discord.svg'
Expand Down Expand Up @@ -291,14 +290,12 @@ export function Menu({ darkMode, toggleDarkMode, isClaimPage }: MenuProps) {
return (
<StyledMenu isClaimPage={isClaimPage}>
<MenuFlyout>
{IS_CLAIMING_ENABLED && (
<CowClaimButton
isClaimPage={isClaimPage}
handleOnClickClaim={handleOnClickClaim}
account={account}
chainId={chainId}
/>
)}
<CowClaimButton
isClaimPage={isClaimPage}
handleOnClickClaim={handleOnClickClaim}
account={account}
chainId={chainId}
/>

<ResponsiveInternalMenuItem to="/" onClick={close}>
<Repeat size={14} /> Swap
Expand Down
7 changes: 5 additions & 2 deletions src/custom/components/Page/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { WithClassName } from 'types'
import { useIsDarkMode } from 'state/user/hooks'
import SVG from 'react-inlinesvg'
import { questionIcon } from 'assets/cow-swap/question'
import { transparentize } from 'polished'

const HelpCircleWrapper = styled.div`
> svg {
Expand Down Expand Up @@ -37,6 +38,8 @@ export const Title = styled.h1`
font-size: 32px;
margin: 24px 0 16px;
color: ${({ theme }) => theme.text1};
text-shadow: 0px 0px 42px ${({ theme }) => transparentize(0.9, theme.text1)},
0px 0px 28px ${({ theme }) => transparentize(0.8, theme.text1)};
${({ theme }) => theme.mediaWidth.upToVerySmall`
font-size: 24px;
Expand All @@ -49,7 +52,7 @@ export const SectionTitle = styled(Title)`
`

export const Content = styled.div`
font-size: 15px;
font-size: 16px;
margin: 0 0 28px;
display: block;
Expand Down Expand Up @@ -82,7 +85,7 @@ export const Content = styled.div`
}
> p {
line-height: 1.5;
line-height: 1.6;
}
> p > img {
Expand Down
2 changes: 1 addition & 1 deletion src/custom/constants/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ export const GAS_FEE_ENDPOINTS = {
[ChainId.XDAI]: 'https://blockscout.com/xdai/mainnet/api/v1/gas-price-oracle',
}

export const UNSUPPORTED_TOKENS_FAQ_URL = '/faq#what-token-pairs-does-cowswap-allow-to-trade'
export const UNSUPPORTED_TOKENS_FAQ_URL = '/faq/trading#what-token-pairs-does-cowswap-allow-to-trade'

// fee threshold - should be greater than percentage, show warning
export const FEE_SIZE_THRESHOLD = new Fraction(10, 100) // 30%
Expand Down
2 changes: 1 addition & 1 deletion src/custom/pages/App/AppMod.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ const AppWrapper = styled.div<Partial<CSS.Properties & AppWrapProps>>`
flex-flow: column;
align-items: flex-start;
min-height: 100vh;
overflow-x: hidden;
/* overflow-x: hidden; */ // mod
&:after {
content: '';
position: fixed;
Expand Down
18 changes: 14 additions & 4 deletions src/custom/pages/App/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import { version } from '@src/../package.json'
import { environmentName } from 'utils/environments'
import { useFilterEmptyQueryParams } from 'hooks/useFilterEmptyQueryParams'
import RedirectAnySwapAffectedUsers from 'pages/error/AnySwapAffectedUsers/RedirectAnySwapAffectedUsers'
import { IS_CLAIMING_ENABLED } from 'pages/Claim/const'
import { SENTRY_IGNORED_GP_QUOTE_ERRORS } from 'api/gnosisProtocol/errors/QuoteError'

const SENTRY_DSN = process.env.REACT_APP_SENTRY_DSN
Expand All @@ -24,11 +23,16 @@ const CookiePolicy = lazy(() => import(/* webpackChunkName: "cookie_policy" */ '
const TermsAndConditions = lazy(() => import(/* webpackChunkName: "terms" */ 'pages/TermsAndConditions'))
const About = lazy(() => import(/* webpackChunkName: "about" */ 'pages/About'))
const Profile = lazy(() => import(/* webpackChunkName: "profile" */ 'pages/Profile'))
const Faq = lazy(() => import(/* webpackChunkName: "faq" */ 'pages/Faq'))
const NotFound = lazy(() => import(/* webpackChunkName: "not_found" */ 'pages/error/NotFound'))
const CowRunner = lazy(() => import(/* webpackChunkName: "cow_runner" */ 'pages/games/CowRunner'))
const MevSlicer = lazy(() => import(/* webpackChunkName: "mev_slicer" */ 'pages/games/MevSlicer'))

const Faq = lazy(() => import(/* webpackChunkName: "faq" */ 'pages/Faq'))
const ProtocolFaq = lazy(() => import(/* webpackChunkName: "faq" */ 'pages/Faq/ProtocolFaq'))
const TokenFaq = lazy(() => import(/* webpackChunkName: "faq" */ 'pages/Faq/TokenFaq'))
const TradingFaq = lazy(() => import(/* webpackChunkName: "faq" */ 'pages/Faq/TradingFaq'))
const AffiliateFaq = lazy(() => import(/* webpackChunkName: "faq" */ 'pages/Faq/AffiliateFaq'))

if (SENTRY_DSN) {
Sentry.init({
dsn: process.env.REACT_APP_SENTRY_DSN,
Expand Down Expand Up @@ -98,10 +102,16 @@ export default function App() {
<Route exact strict path="/swap" component={Swap} />
<Route exact strict path="/swap/:outputCurrency" component={RedirectToSwap} />
<Route exact strict path="/send" component={RedirectPathToSwapOnly} />
{IS_CLAIMING_ENABLED && <Route exact strict path="/claim" component={Claim} />}
<Route exact strict path="/claim" component={Claim} />
<Route exact strict path="/about" component={About} />
<Route exact strict path="/profile" component={Profile} />
<Route exact strict path="/faq" component={Faq} />

<Route exact path="/faq" component={Faq} />
<Route exact strict path="/faq/protocol" component={ProtocolFaq} />
<Route exact strict path="/faq/token" component={TokenFaq} />
<Route exact strict path="/faq/trading" component={TradingFaq} />
<Route exact strict path="/faq/affiliate" component={AffiliateFaq} />

<Route exact strict path="/play/cow-runner" component={CowRunner} />
<Route exact strict path="/play/mev-slicer" component={MevSlicer} />
<Route exact strict path="/anyswap-affected-users" component={AnySwapAffectedUsers} />
Expand Down
1 change: 0 additions & 1 deletion src/custom/pages/Claim/const.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { isProd, isEns, isBarn } from 'utils/environments'

export const IS_CLAIMING_ENABLED = !isBarn
export const IS_TESTING_ENV = !isProd && !isEns && !isBarn
187 changes: 187 additions & 0 deletions src/custom/pages/Faq/AffiliateFaq.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,187 @@
import Page, { Content } from 'components/Page'
import { LinkScrollable } from 'components/Link'

import { ExternalLinkFaq, Wrapper } from './styled'
import { Footer } from '.'
import { useToC } from './hooks'
import ToC from './ToC'
import { FaqMenu } from './Menu'

export default function AffiliateFaq() {
const { toc, faqRef } = useToC()

return (
<Wrapper ref={faqRef}>
<FaqMenu />
<Page>
<ToC toc={toc} name="Affiliate Program FAQ" />
<Content>
<h2 id="affiliate">Affiliate program</h2>

<h3 id="what-is-the-profile-page">What is the Profile page?</h3>

<p>
It is a page where you can see your number of trades and volume that you have done with the wallet you have
connected with.
</p>

<p>
Additionally, you will be able to get your own referral/affiliate link, so you can share it with others, and
if you do so, you will also be able to see the number of trades and volume that your referral link gets
credited from the users who followed your link and interacted with the DEX.
</p>

<h3 id="in-which-networks-it-is-available">In which networks is it available?</h3>

<p>At this time, the affiliate program only works for Ethereum Mainnet.</p>

<h3 id="are-there-any-rewards-for-sharing-the-referral-link">
Are there any rewards for sharing the referral link?
</h3>

<p>
The affiliate program will initially run as a trial and therefore there are currently no announced rewards.
The tracking, however, has already started.
</p>

<p>
CowSwap&apos;s positive network effect scales exponentially with more people using it, therefore, the
affiliate program aims to acknowledge which users are contributing more to the success of the protocol.{' '}
</p>

<p>
We now briefly explain CowSwap’s positive network effect. CowSwap&apos;s name comes from the economic
phenomenon &quot;Coincidence of Wants&quot;, where users&apos; orders can be matched with each other to
obtain better prices. When the protocol finds a CoW, trades are directly settled among traders, which allows
saving on slippage, gas, and LP fees. The network effect of CoWs increases alongside with the number of
traders using the protocol&#59; the more users we have sending orders to the protocol, the better the prices
and gas savings the protocol is able to offer. Our new CoW-filiate program is aiming to increase this
positive network effect.
</p>

<h3 id="who-can-share-the-referral-link">Who can share the referral link?</h3>

<p>
Everyone can share a link, you only need a valid Ethereum wallet address to create your own personal link.
</p>

<h3 id="who-can-follow-the-referral-link">Who can follow the referral link?</h3>

<p>
Everyone! Please share the excitement for the CowSwap protocol & dapp. It would really make a difference for
the Cow-mmunity if you share it with your friends, Twitter/YouTube followers, or anyone that would be
interested.
</p>

<p>
Share your referral link with all your friends if you think they can be interested in the qualities Cowswap
has to offer. These qualities range from ETH-less trading experience, MEV protection, no fees for failed
transactions, and more.{' '}
<span role="img" aria-label="cow">
🐮
</span>
</p>

<p>
Note that trades and volume will only be credited to your wallet if the user has not traded in CowSwap with
that address before, and their first trade is done after following your link.
</p>

<h3 id="what-is-the-source-of-truth-for-accounting-trade-volume">
What is the source of truth for accounting trade volume?
</h3>

<p>
The referral program fetches data from Dune, and therefore, the USD value is taken from the information
available in Dune under price feed. If the token is not in the Dune price feed, then volume will not be
counted.
</p>

<h3 id="why-do-not-i-see-any-referral-trades-in-my-profile-page">
I shared my referral with a friend, who then also traded. Why do I not see any referral trades in my profile
page?
</h3>

<p>There could be a few reasons for this:</p>
<ol>
<li>
Your friend was trading tokens that do not have a price feed available (see FAQ entry{' '}
<LinkScrollable
href={'/faq/affiliate#why-is-my-total-trade-referral-trade-volume-smaller-than-the-real-volume'}
>
Why is the volume smaller than the real volume?
</LinkScrollable>
).
</li>
<li>The data has not yet propagated from the chain to our backend.</li>
<li>
Your friend had already traded with that account, which does not count towards referral volume (see FAQ
entry{' '}
<LinkScrollable href={'/faq/affiliate#who-can-follow-the-referral-link'}>
Who can follow the referral link?
</LinkScrollable>
).
</li>
</ol>

<h3 id="why-is-my-total-trade-referral-trade-volume-smaller-than-the-real-volume">
Why is my total trade/referral trade volume smaller than the real volume?
</h3>

<p>
Some tokens might not yet have a proper price feed linking them to a USD estimation at the date/time when
your trade was executed. When that happens the trade volume is set to 0. Thus, your total volume can be
smaller, or even be shown as 0 (see FAQ entry{' '}
<LinkScrollable href={'/faq/affiliate#what-is-the-source-of-truth-for-accounting-trade-volume'}>
What is the source of truth for accounting trade volume?
</LinkScrollable>
).
</p>

<h3 id="why-do-i-see-more-trades">
Why do I see more trades and referrals in my profile page than I actually see in the activity list?
</h3>

<p>The number of trades on the profile page is calculated based on on-chain data.</p>
<p>We have two publicly facing interfaces where both use the same contracts, which are:</p>
<ul>
<li>
The production version:{' '}
<ExternalLinkFaq href="https://cowswap.exchange" target="_blank" rel="noopener noreferrer">
https://cowswap.exchange
</ExternalLinkFaq>
</li>
<li>
The public test version:{' '}
<ExternalLinkFaq href="https://barn.cowswap.exchange" target="_blank" rel="noopener noreferrer">
https://barn.cowswap.exchange
</ExternalLinkFaq>
</li>
</ul>

<p>
Even though both use the same contract, the backend services, solvers and infrastructure are independent.
</p>

<p>
Thus, when accessing{' '}
<ExternalLinkFaq href="https://cowswap.exchange" target="_blank" rel="noopener noreferrer">
https://cowswap.exchange
</ExternalLinkFaq>{' '}
you will see orders/trades placed only using this interface. The same is true for orders/trades placed on{' '}
<ExternalLinkFaq href="https://barn.cowswap.exchange" target="_blank" rel="noopener noreferrer">
https://barn.cowswap.exchange
</ExternalLinkFaq>
.
</p>

<p>If you ever traded on both, you might have more trades than you would expect.</p>

<p>In the future, the data will be consolidated and this number will match your expectations.</p>

<Footer />
</Content>
</Page>
</Wrapper>
)
}
Loading

0 comments on commit f0d0050

Please sign in to comment.