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

[RELEASE 🪄 ] v1.11.0-RC.0 #2511

Merged
merged 40 commits into from
Mar 3, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
913a30a
remove unused audio. (#2348)
fairlighteth Feb 1, 2022
525622c
Merge branch 'master' of gno.github.com:gnosis/cowswap into develop
Feb 1, 2022
fcb05fe
Fix claim input error message position (#2368)
nenadV91 Feb 2, 2022
505a3b4
Remove some claim functions that are not being used (#2372)
nenadV91 Feb 2, 2022
22fc2d1
Update confirmation text based on chainId (#2373)
nenadV91 Feb 2, 2022
e8b8fe8
Merge branch 'master' of gno.github.com:gnosis/cowswap into develop
Feb 3, 2022
e7feb5d
Moved claim state updater to claim page (#2380)
alfetopito Feb 3, 2022
d1119ca
Fix e2e (#2379)
anxolin Feb 3, 2022
c939d78
Add CLA (#2390)
anxolin Feb 4, 2022
94245c5
Fix token display in dark/light mode for transactions. (#2386)
fairlighteth Feb 4, 2022
653d9b6
Add alternative claim success sound. (#2384)
fairlighteth Feb 4, 2022
ee0101a
Improve responsiveness of header elements. (#2376)
fairlighteth Feb 4, 2022
6763fc2
Bump simple-get from 2.8.1 to 2.8.2 (#2392)
dependabot[bot] Feb 4, 2022
af1a7c6
Updated gas estimation for gchain (#2391)
alfetopito Feb 7, 2022
b551f2b
Merge branch 'hotfix/1.10.1' into develop
anxolin Feb 7, 2022
ad5e98c
Fix readme path and add users (#2400)
anxolin Feb 7, 2022
1e1b409
Menu: view all orders position (#2399)
alongoni Feb 8, 2022
a57279f
Show banner if the user has claimed already (#2393)
nenadV91 Feb 9, 2022
451206f
Removed Ethereum word from popup text msg (#2412)
nenadV91 Feb 10, 2022
9189731
2382/already claimed (#2394)
alfetopito Feb 10, 2022
a4e63b5
Merge branch 'master' into develop
nenadV91 Feb 14, 2022
e28bfd3
1867 - Add network if nonexistent (#2424)
W3stside Feb 15, 2022
d42aabe
Merge remote-tracking branch 'origin/master' into develop
W3stside Feb 16, 2022
7319d6c
Enhance messages for Affiliate program (#2414)
alongoni Feb 17, 2022
e4364cb
Fix avilable claims issue on rinkeby (#2420)
nenadV91 Feb 18, 2022
6dc3d57
Scrollbar styles (#2421)
alongoni Feb 21, 2022
a8157ce
2150 Terms and Conditions: gnosis forum link (#2483)
alongoni Feb 22, 2022
32c4765
Bump url-parse from 1.5.3 to 1.5.7 (#2476)
dependabot[bot] Feb 22, 2022
55ffce3
Fix 404 for OPYN_LIST url (their file name changed) (#2481)
fadomire Feb 23, 2022
516a425
Merge remote-tracking branch 'origin/master' into develop
W3stside Feb 24, 2022
af28821
2473/cancel claim issue (#2485)
nenadV91 Feb 24, 2022
6be36ca
Fix for already claimed button on claim successful screen (#2478)
nenadV91 Feb 24, 2022
67d6294
Swap page layout (#2488)
alongoni Feb 25, 2022
c64624e
Merge remote-tracking branch 'origin/master' into develop
W3stside Feb 25, 2022
795f7fc
Fix for claim cancel popup icon (#2501)
nenadV91 Feb 28, 2022
90e6843
Reduce dependencies (#2480)
nenadV91 Feb 28, 2022
588ccf2
Add fast price fetching (#2477)
nenadV91 Feb 28, 2022
670ecf3
Revert "Swap page layout (#2488)"
Feb 28, 2022
ffbbda9
Use previously supported wallets (#2166)
henrypalacios Mar 1, 2022
f4e511f
[2506] Sync BE errors with FE (#2507)
W3stside Mar 2, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ REACT_APP_NETWORK_URL_100=https://rpc.xdaichain.com

# Wallets
REACT_APP_PORTIS_ID="c0e2bf01-4b08-4fd5-ac7b-8e26b58cd236"
REACT_APP_FORTMATIC_KEY="pk_live_F937DF033A1666BF"
REACT_APP_FORTMATIC_KEY="pk_live_6AED76CA755EFDC7"
REACT_APP_FORTMATIC_SITE_VERIFICATION="LzjrtdM7hqVJfvvA"

# Domain regex (to detect environment)
Expand Down
4 changes: 3 additions & 1 deletion .env.production
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ REACT_APP_NETWORK_URL_100=https://rpc.xdaichain.com

# Wallets
REACT_APP_PORTIS_ID="c0e2bf01-4b08-4fd5-ac7b-8e26b58cd236"
REACT_APP_FORTMATIC_KEY="pk_live_F937DF033A1666BF"
REACT_APP_FORTMATIC_KEY="pk_live_9E53F9A29112A9FC"
REACT_APP_FORTMATIC_KEY_BARN="pk_live_C0DA025E15EBF895"
REACT_APP_FORTMATIC_KEY_PROD="pk_live_7BD8004CBBF5CDD6"

# Domain regex (to detect environment)
REACT_APP_DOMAIN_REGEX_LOCAL="^(:?localhost:\d{2,5}|(?:127|192)(?:\.[0-9]{1,3}){3})"
Expand Down
26 changes: 26 additions & 0 deletions .github/workflows/cla.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: 'CLA Assistant'
on:
issue_comment:
types: [created]
pull_request_target:
types: [opened, closed, synchronize]

jobs:
CLAssistant:
runs-on: ubuntu-latest
steps:
- name: 'CLA Assistant'
if: github.base_ref != 'main' && ((github.event.comment.body == 'recheckcla' || github.event.comment.body == 'I have read the CLA Document and I hereby sign the CLA') || github.event_name == 'pull_request_target')
# Alpha Release
uses: gnosis/github-action@master
# GitHub token, automatically provided to the action
# (No need to define this secret in the repo settings)
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
path-to-signatures: 'signatures/version1/cla.json'
path-to-cla-document: 'https://github.com/gnosis/cowswap/blob/develop/docs/GNOSIS_CLA.md'
branch: 'cla-signatures'
allowlist: dependabot,mergify,alfetopito,anxolin,W3stside,nenadV91,biocom,annamsgeorge,avsavsavs,biocom,c3rnst,cmagan,josojo,davidalbela,fedgiac,fleupold,giacomolicari,GabrielCamba,nlordell,alongoni,elena-zh,henrypalacios,matextrem,ramirotw
empty-commit-flag: false
blockchain-storage-flag: false
7 changes: 7 additions & 0 deletions craco.config.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
/* eslint-disable @typescript-eslint/no-var-requires */
const path = require('path')
const SentryWebpackPlugin = require('@sentry/webpack-plugin')
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin
const { version } = require('./package.json')

// see https://github.com/gsoft-inc/craco/blob/master/packages/craco/README.md#configuration-overview

const plugins = []
const SENTRY_AUTH_TOKEN = process.env.REACT_APP_SENTRY_AUTH_TOKEN
const SENTRY_RELEASE_VERSION = 'CowSwap@v' + version
const ANALYZE_BUNDLE = process.env.REACT_APP_ANALYZE_BUNDLE

if (ANALYZE_BUNDLE) {
plugins.push(new BundleAnalyzerPlugin())
}

if (SENTRY_AUTH_TOKEN) {
plugins.push(
Expand Down Expand Up @@ -42,6 +48,7 @@ module.exports = {
plugins,
alias: {
'@src': path.resolve(__dirname, 'src'),
'bn.js': path.resolve(__dirname, 'node_modules/bn.js/lib/bn.js'),
},
// https://webpack.js.org/configuration
configure: (webpackConfig) => ({
Expand Down
32 changes: 31 additions & 1 deletion cypress/support/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ export const TEST_ADDRESS_NEVER_USE_SHORTENED = `${TEST_ADDRESS_NEVER_USE.substr
6
)}...${TEST_ADDRESS_NEVER_USE.substr(-4, 4)}`

// Redefined bridge to fix a supper annoying issue making some contract calls to fail
// See https://github.com/ethers-io/ethers.js/issues/1683
class CustomizedBridge extends Eip1193Bridge {
chainId = 4

Expand All @@ -41,6 +43,7 @@ class CustomizedBridge extends Eip1193Bridge {
method = args[0]
params = args[1]
}
// Mock out request accounts and chainId
if (method === 'eth_requestAccounts' || method === 'eth_accounts') {
if (isCallbackForm) {
callback({ result: [TEST_ADDRESS_NEVER_USE] })
Expand All @@ -56,14 +59,41 @@ class CustomizedBridge extends Eip1193Bridge {
}
}
try {
const result = await super.send(method, params)
// If from is present on eth_call it errors, removing it makes the library set
// from as the connected wallet which works fine
if (params && params.length && params[0].from && method === 'eth_call') delete params[0].from
let result
// For sending a transaction if we call send it will error
// as it wants gasLimit in sendTransaction but hexlify sets the property gas
// to gasLimit which makes sensd transaction error.
// This have taken the code from the super method for sendTransaction and altered
// it slightly to make it work with the gas limit issues.
if (params && params.length && params[0].from && method === 'eth_sendTransaction') {
// Hexlify will not take gas, must be gasLimit, set this property to be gasLimit
params[0].gasLimit = params[0].gas
delete params[0].gas
// If from is present on eth_sendTransaction it errors, removing it makes the library set
// from as the connected wallet which works fine
delete params[0].from
const req = ethers.providers.JsonRpcProvider.hexlifyTransaction(params[0])
// Hexlify sets the gasLimit property to be gas again and send transaction requires gasLimit
req.gasLimit = req.gas
delete req.gas
// Send the transaction
const tx = await this.signer.sendTransaction(req)
result = tx.hash
} else {
// All other transactions the base class works for
result = await super.send(method, params)
}
console.debug('result received', method, params, result)
if (isCallbackForm) {
callback(null, { result })
} else {
return result
}
} catch (error) {
console.log(error)
if (isCallbackForm) {
callback(error, null)
} else {
Expand Down
23 changes: 23 additions & 0 deletions docs/GNOSIS_CLA.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
### Gnosis Contributor License Agreement

Thank you for your interest in contributing to open source software projects (“Projects”) made available by Gnosis Ltd or its affiliates (“Gnosis”). This Contributor License Agreement (“Agreement”) sets out the terms governing any source code, object code, bug fixes, configuration changes, tools, specifications, documentation, data, materials, feedback, information or other works of authorship that you submit or have submitted, in any form and in any manner, to Gnosis in respect of any of the Projects (collectively “Contributions”). If you have any questions respecting this Agreement, please contact [email protected].

You agree that the following terms apply to all of your past, present and future Contributions. Except for the licenses granted in this Agreement, you retain all of your right, title and interest in and to your Contributions.

**Copyright License.** You hereby grant, and agree to grant, to Gnosis a non-exclusive, perpetual, irrevocable, worldwide, fully-paid, royalty-free, transferable copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, and distribute your Contributions and such derivative works, with the right to sublicense the foregoing rights through multiple tiers of sublicensees.

**Patent License.** You hereby grant, and agree to grant, to Gnosis a non-exclusive, perpetual, irrevocable, worldwide, fully-paid, royalty-free, transferable patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer your Contributions, where such license applies only to those patent claims licensable by you that are necessarily infringed by your Contributions alone or by combination of your Contributions with the Project to which such Contributions were submitted, with the right to sublicense the foregoing rights through multiple tiers of sublicensees.

**Moral Rights.** To the fullest extent permitted under applicable law, you hereby waive, and agree not to assert, all of your “moral rights” in or relating to your Contributions for the benefit of Gnosis, its assigns, and their respective direct and indirect sublicensees.

**Third Party Content/Rights.** If your Contribution includes or is based on any source code, object code, bug fixes, configuration changes, tools, specifications, documentation, data, materials, feedback, information or other works of authorship that were not authored by you (“Third Party Content”) or if you are aware of any third party intellectual property or proprietary rights associated with your Contribution (“Third Party Rights”), then you agree to include with the submission of your Contribution full details respecting such Third Party Content and Third Party Rights.

**Representations.** You represent that, other than the Third Party Content and Third Party Rights identified by you in accordance with this Agreement, you are the sole author of your Contributions and are legally entitled to grant the foregoing licenses and waivers in respect of your Contributions. If your Contributions were created in the course of your employment with your past or present employer(s), you represent that such employer(s) has authorized you to make your Contributions on behalf of such employer(s) or such employer(s) has waived all of their right, title or interest in or to your Contributions.

**Disclaimer.** To the fullest extent permitted under applicable law, your Contributions are provided on an "as-is" basis, without any warranties or conditions, express or implied, including, without limitation, any implied warranties or conditions of non-infringement, merchantability or fitness for a particular purpose. You are not required to provide support for your Contributions, except to the extent you desire to provide support.

**No Obligation.** You acknowledge that Gnosis is under no obligation to use or incorporate your Contributions into any of the Projects. The decision to use or incorporate your Contributions into any of the Projects will be made at the sole discretion of Gnosis or its authorized delegates.

**Disputes.** This Agreement shall be governed by and construed in accordance with the laws of the State of New York, United States of America, without giving effect to its principles or rules regarding conflicts of laws, other than such principles directing application of New York law. The parties hereby submit to venue in, and jurisdiction of the courts located in New York, New York for purposes relating to this Agreement. In the event that any of the provisions of this Agreement shall be held by a court or other tribunal of competent jurisdiction to be unenforceable, the remaining portions hereof shall remain in full force and effect.

**Assignment.** You agree that Gnosis may assign this Agreement, and all of its rights, obligations and licenses hereunder.
11 changes: 8 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
"@web3-react/injected-connector": "^6.0.7",
"@web3-react/portis-connector": "^6.1.9",
"@web3-react/walletconnect-connector": "6.2.4",
"@web3-react/walletlink-connector": "^6.2.5",
"@web3-react/walletlink-connector": "^6.2.12",
"ajv": "^6.12.3",
"array.prototype.flat": "^1.2.4",
"array.prototype.flatmap": "^1.2.4",
Expand Down Expand Up @@ -150,6 +150,10 @@
"use-count-up": "^2.2.5",
"wcag-contrast": "^3.0.0",
"web-vitals": "^2.1.0",
"web3": "^1.7.0",
"web3-providers-http": "^1.7.0",
"web3-providers-ws": "^1.7.0",
"webpack-bundle-analyzer": "^4.5.0",
"workbox-core": "^6.1.0",
"workbox-precaching": "^6.1.0",
"workbox-routing": "^6.1.0"
Expand All @@ -164,6 +168,7 @@
"start:service-worker": "yarn build && yarn serve",
"mock": "REACT_APP_MOCK=true yarn start",
"build": "yarn i18n:compile && craco build && yarn writeVersion",
"build:analyze": "cross-env REACT_APP_ANALYZE_BUNDLE=true yarn craco build && yarn writeVersion",
"ipfs:build": "cross-env PUBLIC_URL=\".\" yarn build",
"ipfs:publish": "ipfs-deploy build -p infura -O",
"test": "NODE_PATH=src/custom craco test --env=jsdom",
Expand Down Expand Up @@ -215,16 +220,16 @@
"@gnosis.pm/dex-js": "^0.14.0",
"@gnosis.pm/gp-v2-contracts": "^1.1.2",
"@gnosis.pm/safe-service-client": "^0.1.1",
"@pinata/sdk": "^1.1.23",
"@sentry/react": "^6.11.0",
"@sentry/tracing": "^6.11.0",
"@uniswap/default-token-list": "^2.0.0",
"@walletconnect/web3-provider": "^1.6.6",
"bnc-sdk": "^3.5.0",
"fast-safe-stringify": "^2.0.8",
"firebase": "^9.1.3",
"fortmatic": "^2.2.1",
"ipfs-http-client": "^52.0.3",
"paraswap": "^5.0.1",
"paraswap": "npm:@nenad91/paraswap#5.1.0",
"react-appzi": "^1.0.4",
"react-inlinesvg": "^2.3.0",
"react-router-hash-link": "^2.4.0",
Expand Down
8 changes: 0 additions & 8 deletions src/constants/wallet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,7 @@ export const SUPPORTED_WALLETS: { [key: string]: WalletInfo } = {
description: 'Use Coinbase Wallet app on mobile device',
href: null,
color: '#315CF5',
},
COINBASE_LINK: {
name: 'Open in Coinbase Wallet',
iconURL: COINBASE_ICON_URL,
description: 'Open in Coinbase Wallet app.',
href: 'https://go.cb-w.com/mtUDhEZPy1',
color: '#315CF5',
mobile: true,
mobileOnly: true,
},
FORTMATIC: {
connector: fortmatic,
Expand Down
3 changes: 2 additions & 1 deletion src/custom/api/gnosisProtocol/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ async function _handleQuoteResponse<T = any, P extends QuoteQuery = QuoteQuery>(
}

function _mapNewToLegacyParams(params: FeeQuoteParams): QuoteQuery {
const { amount, kind, userAddress, receiver, validTo, sellToken, buyToken, chainId } = params
const { amount, kind, userAddress, receiver, validTo, sellToken, buyToken, chainId, priceQuality } = params
const fallbackAddress = userAddress || ZERO_ADDRESS

const baseParams = {
Expand All @@ -320,6 +320,7 @@ function _mapNewToLegacyParams(params: FeeQuoteParams): QuoteQuery {
appData: getAppDataHash(),
validTo,
partiallyFillable: false,
priceQuality,
}

const finalParams: QuoteQuery =
Expand Down
44 changes: 28 additions & 16 deletions src/custom/api/gnosisProtocol/errors/OperatorError.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ export interface ApiErrorObject {
}

// Conforms to backend API
// https://github.com/gnosis/gp-v2-services/blob/d932e11c9a2125fdba239530be7684799f694909/crates/orderbook/openapi.yml#L801
// https://github.com/gnosis/gp-v2-services/blob/main/crates/orderbook/openapi.yml#L801
// and
// https://github.com/gnosis/gp-v2-services/blob/d932e11c9a2125fdba239530be7684799f694909/crates/orderbook/openapi.yml#L740
// https://github.com/gnosis/gp-v2-services/blob/main/crates/orderbook/openapi.yml#L740
export enum ApiErrorCodes {
DuplicateOrder = 'DuplicateOrder',
InvalidSignature = 'InvalidSignature',
Expand All @@ -29,6 +29,12 @@ export enum ApiErrorCodes {
AmountIsZero = 'AmountIsZero',
SellAmountDoesNotCoverFee = 'SellAmountDoesNotCoverFee',
TransferEthToContract = 'TransferEthToContract',
TransferSimulationFailed = 'TransferSimulationFailed',
SameBuyAndSellToken = 'SameBuyAndSellToken',
ZeroAmount = 'ZeroAmount',
UnsupportedBuyTokenDestination = 'UnsupportedBuyTokenDestination',
UnsupportedSellTokenSource = 'UnsupportedSellTokenSource',
UnsupportedOrderType = 'UnsupportedOrderType',
UNHANDLED_GET_ERROR = 'UNHANDLED_GET_ERROR',
UNHANDLED_CREATE_ERROR = 'UNHANDLED_CREATE_ERROR',
UNHANDLED_DELETE_ERROR = 'UNHANDLED_DELETE_ERROR',
Expand All @@ -38,24 +44,30 @@ export enum ApiErrorCodeDetails {
DuplicateOrder = 'There was another identical order already submitted. Please try again.',
InsufficientFee = "The signed fee is insufficient. It's possible that is higher now due to a change in the gas price, ether price, or the sell token price. Please try again to get an updated fee quote.",
InvalidSignature = 'The order signature is invalid. Check whether your Wallet app supports off-chain signing.',
MissingOrderData = 'The order has missing information',
MissingOrderData = 'The order has missing information.',
InsufficientValidTo = 'The order you are signing is already expired. This can happen if you set a short expiration in the settings and waited too long before signing the transaction. Please try again.',
InsufficientAllowance = "The account doesn't have enough funds",
InsufficientBalance = 'The account needs to approve the selling token in order to trade',
InsufficientAllowance = "The account doesn't have enough funds.",
InsufficientBalance = 'The account needs to approve the selling token in order to trade.',
WrongOwner = "The signature is invalid.\n\nIt's likely that the signing method provided by your wallet doesn't comply with the standards required by CowSwap.\n\nCheck whether your Wallet app supports off-chain signing (EIP-712 or ETHSIGN).",
NotFound = 'Token pair selected has insufficient liquidity',
OrderNotFound = 'The order you are trying to cancel does not exist',
AlreadyCancelled = 'Order is already cancelled',
OrderFullyExecuted = 'Order is already filled',
OrderExpired = 'Order is expired',
NoLiquidity = 'Token pair selected has insufficient liquidity',
NotFound = 'Token pair selected has insufficient liquidity.',
OrderNotFound = 'The order you are trying to cancel does not exist.',
AlreadyCancelled = 'Order is already cancelled.',
OrderFullyExecuted = 'Order is already filled.',
OrderExpired = 'Order is expired.',
NoLiquidity = 'Token pair selected has insufficient liquidity.',
UnsupportedToken = 'One of the tokens you are trading is unsupported. Please read the FAQ for more info.',
AmountIsZero = 'Amount is zero',
SellAmountDoesNotCoverFee = 'Sell amount does not sufficiently cover the current fee',
TransferEthToContract = 'Sending the native currency to smart contract wallets is not currently supported',
AmountIsZero = 'Amount is zero.',
SellAmountDoesNotCoverFee = 'Sell amount does not sufficiently cover the current fee.',
TransferEthToContract = 'Sending native currency to smart contract wallets is not currently supported.',
TransferSimulationFailed = 'Transfer simulation of native currency failed. This is likely due to the current unsupported state of smart contract wallets.',
SameBuyAndSellToken = 'Sell and buy token can not be the same.',
ZeroAmount = 'Order amount cannot be zero.',
UnsupportedBuyTokenDestination = 'Buy token destination is unsupported. Please try again with a different destination.',
UnsupportedSellTokenSource = 'Sell token source is unsupported. Please try again with a different source.',
UnsupportedOrderType = 'Order type unsupported. Please try again with a different order type.',
UNHANDLED_GET_ERROR = 'Order fetch failed. This may be due to a server or network connectivity issue. Please try again later.',
UNHANDLED_CREATE_ERROR = 'The order was not accepted by the network',
UNHANDLED_DELETE_ERROR = 'The order cancellation was not accepted by the network',
UNHANDLED_CREATE_ERROR = 'The order was not accepted by the network.',
UNHANDLED_DELETE_ERROR = 'The order cancellation was not accepted by the network.',
}

function _mapActionToErrorDetail(action?: ApiActionType) {
Expand Down
Loading