Skip to content

Commit

Permalink
Merge branch 'main' into issue-#774
Browse files Browse the repository at this point in the history
  • Loading branch information
tiagofilipenunes committed Apr 9, 2024
2 parents c541dc2 + 420a07c commit b05e11b
Show file tree
Hide file tree
Showing 129 changed files with 192,161 additions and 760 deletions.
5 changes: 4 additions & 1 deletion .env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,12 @@ VITE_NETWORK=ethereum
# RPC URL used to connect to the network
VITE_CHAIN_RPC_URL=

# Development (optional)
# Development (optional) - control SDK log verbosity - see SDK README
VITE_SDK_VERBOSITY=

# For usage with contracts version < 5, without the enhanced range for trade by source. In that case - set this to true
VITE_LEGACY_TRADE_BY_SOURCE_RANGE=

# Sentry (optional)
SENTRY_ORG=
SENTRY_PROJECT=
Expand Down
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,11 @@ VITE_NETWORK=polygon
VITE_CHAIN_RPC_URL=https://eth-mainnet.alchemyapi.io/v2/<API_KEY>
```

### Contracts with version < 5

In case the network is using a version of CarbonController older than 5 then there's no support for extended range for trade by source,
and it is recommended to set VITE_LEGACY_TRADE_BY_SOURCE_RANGE to true in .env to avoid possible reverts.

## Change Colors

The theme is defined in the [`tailwind.config.ts`](./tailwind.config.ts#L36) file.
Expand Down
8 changes: 4 additions & 4 deletions e2e/pages/simulator.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const testCases: CreateStrategyTestCase[] = [
output: {
roi: '-29.91%',
estimatedGains: 'DAI -9,904.69',
date: 'March 02, 2023 February 25, 2024',
date: 'March 02, 2023 - February 25, 2024',
buy: {
rate: '1,500.00 - 1,600.00 DAI per ETH',
budget: '2,000.00 DAI',
Expand Down Expand Up @@ -67,7 +67,7 @@ const testCases: CreateStrategyTestCase[] = [
output: {
roi: '15.49%',
estimatedGains: 'USDC 376.75',
date: 'March 10, 2023 January 24, 2024',
date: 'March 10, 2023 - January 24, 2024',
buy: {
rate: '1,700.00 - 1,800.00 USDC per ETH',
budget: '200.00 USDC',
Expand Down Expand Up @@ -102,7 +102,7 @@ const testCases: CreateStrategyTestCase[] = [
output: {
roi: '32.23%',
estimatedGains: 'SHIB 407,118,924.87',
date: 'March 08, 2023 January 21, 2024',
date: 'March 08, 2023 - January 21, 2024',
buy: {
rate: '222.00M SHIB per ETH',
budget: '1.00B SHIB',
Expand Down Expand Up @@ -137,7 +137,7 @@ const testCases: CreateStrategyTestCase[] = [
output: {
roi: '-8.87%',
estimatedGains: 'SHIB -285,338,714.67',
date: 'March 01, 2023 February 21, 2024',
date: 'March 01, 2023 - February 21, 2024',
buy: {
rate: '222.00M SHIB per ETH',
budget: '100.00M SHIB',
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 15 additions & 4 deletions e2e/utils/strategy/EditStrategyDriver.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { expect } from '@playwright/test';
import { Page } from 'playwright-core';
import { MainMenuDriver } from '../MainMenuDriver';
import { screenshot, shouldTakeScreenshot } from '../operators';
import { screenshot, shouldTakeScreenshot, waitFor } from '../operators';
import { CreateStrategyTestCase } from './types';
import { Setting, Direction, MinMax } from '../types';
import {
Expand Down Expand Up @@ -51,10 +51,21 @@ export class EditStrategyDriver {
}

async submit(type: 'deposit' | 'withdraw' | 'renew' | 'editPrices') {
if (await this.page.isVisible('[data-testid=approve-warnings]')) {
this.page.getByTestId('approve-warnings').click();
}
const btn = this.page.getByTestId('edit-submit');

const approveWarningsAndWait = async () => {
waitFor(this.page, 'approve-warnings');
if (await this.page.isVisible('[data-testid=approve-warnings]')) {
this.page.getByTestId('approve-warnings').click();
}
await expect(btn).toBeEnabled();
};

// If the submit button is not enabled, try to approve warnings and retry
await expect(btn)
.toBeEnabled()
.catch(() => approveWarningsAndWait());

await expect(btn).toBeEnabled();
if (shouldTakeScreenshot) {
const mainMenu = new MainMenuDriver(this.page);
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"private": true,
"dependencies": {
"@babel/core": "^7.0.0-0",
"@bancor/carbon-sdk": "0.0.95-DEV",
"@bancor/carbon-sdk": "^0.0.97-DEV",
"@cloudflare/workers-types": "^4.20230717.0",
"@coinbase/wallet-sdk": "^3.6.3",
"@ethersproject/abi": "^5.0.0",
Expand Down Expand Up @@ -90,7 +90,7 @@
"ua-parser-js": "^1.0.35",
"use-async-effect": "^2.2.7",
"valibot": "^0.28.1",
"vite": "5.0.12",
"vite": "5.0.13",
"vite-plugin-rewrite-all": "^1.0.1",
"vite-plugin-svgr": "^2.4.0",
"vite-tsconfig-paths": "^4.2.1",
Expand Down
Loading

0 comments on commit b05e11b

Please sign in to comment.