Skip to content

Commit

Permalink
Merge pull request #8 from rainlanguage/2024-04-26-memoizer
Browse files Browse the repository at this point in the history
flare network, viem config
  • Loading branch information
thedavidmeister authored May 6, 2024
2 parents 02894af + 0ef79d9 commit 5858c6a
Show file tree
Hide file tree
Showing 17 changed files with 232 additions and 118 deletions.
24 changes: 12 additions & 12 deletions .github/workflows/apps-evm-e2e.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
name: Sushi - apps / evm

on:
pull_request:
types: [opened, synchronize]
paths:
- ".github/workflows/apps-evm-e2e.yml"
- "apps/evm/**"
- "config/nextjs/**"
- "config/router/**"
- "config/tailwindcss/**"
- "config/typescript/**"
- "config/viem/**"
- "config/wagmi/**"
- "packages/**"
# pull_request:
# types: [opened, synchronize]
# paths:
# - ".github/workflows/apps-evm-e2e.yml"
# - "apps/evm/**"
# - "config/nextjs/**"
# - "config/router/**"
# - "config/tailwindcss/**"
# - "config/typescript/**"
# - "config/viem/**"
# - "config/wagmi/**"
# - "packages/**"
workflow_dispatch:

env:
Expand Down
13 changes: 7 additions & 6 deletions .github/workflows/chromatic.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
name: 'Chromatic'

on:
pull_request:
types: [opened, synchronize]
paths:
- ".github/workflows/chromatic.yml"
- "config/tailwindcss/**"
- "packages/ui/**"
# pull_request:
# types: [opened, synchronize]
# paths:
# - ".github/workflows/chromatic.yml"
# - "config/tailwindcss/**"
# - "packages/ui/**"
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
Expand Down
26 changes: 26 additions & 0 deletions .github/workflows/rain-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Rain CI
on: [push]

jobs:
install-build-lint-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: DeterminateSystems/nix-installer-action@v4
- uses: DeterminateSystems/magic-nix-cache-action@v2

- name: Install deps
run: nix develop -c pnpm install --frozen-lockfile

- name: Build ./packages/sushi
run: nix develop -c pnpm exec turbo run build --filter=./packages/sushi

- name: Lint
run: nix develop -c pnpm lint

- name: Check ./packages/sushi Types
run: nix develop -c pnpm exec turbo run check --filter=./packages/sushi

- name: Test ./packages/sushi
run: nix develop -c pnpm exec turbo run test --filter=./packages/sushi
5 changes: 3 additions & 2 deletions .github/workflows/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ name: Sushi - verify
# workflow_call:
# workflow_dispatch:
on:
pull_request:
types: [opened, synchronize]
# pull_request:
# types: [opened, synchronize]
workflow_dispatch:
env:
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ exports

# cache
cache
mem-cache

# generated
generated
Expand Down
16 changes: 16 additions & 0 deletions packages/hooks/src/usePinnedTokens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ import {
import {
ARB,
DAI,
ENOSYS_APS,
ENOSYS_BNZ,
ENOSYS_EETH,
ENOSYS_EQNT,
ENOSYS_HLN,
FRAX,
GNO,
MATIC,
Expand Down Expand Up @@ -353,6 +358,17 @@ export const DEFAULT_BASES = {
USDC[ChainId.CRONOS],
],
[ChainId.BLAST]: [Native.onChain(ChainId.BLAST), USDB[ChainId.BLAST]],
[ChainId.FLARE]: [
Native.onChain(ChainId.FLARE),
WNATIVE[ChainId.FLARE],
WETH9[ChainId.FLARE],
USDT[ChainId.FLARE],
ENOSYS_BNZ,
ENOSYS_EQNT,
ENOSYS_HLN,
ENOSYS_APS,
ENOSYS_EETH,
],
// [ChainId.SEPOLIA]: [Native.onChain(ChainId.SEPOLIA), WNATIVE[ChainId.SEPOLIA]],
} as const satisfies Record<ChainId, Readonly<(Token | Native)[]>>

Expand Down
2 changes: 1 addition & 1 deletion packages/sushi/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@
"check": "tsc --pretty --noEmit",
"clean": "rm -rf .turbo && rm -rf node_modules && rm -rf dist",
"dev": "tsc -w",
"generate": "npx tsx ./scripts/generate.ts",
"generate": "tsx ./scripts/generate.ts",
"prepublishOnly": "pnpm build",
"test": "vitest run -c ./test/vitest.config.ts",
"test:debug": "vitest --inspect-brk --no-threads run -c ./test/vitest.config.ts",
Expand Down
2 changes: 2 additions & 0 deletions packages/sushi/src/chain/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ export const ChainId = {
CRONOS: 25,
BLAST: 81457,
// RONIN: 2020,
FLARE: 14,
} as const
export type ChainId = (typeof ChainId)[keyof typeof ChainId]

Expand Down Expand Up @@ -130,5 +131,6 @@ export const ChainKey = {
[ChainId.ZETACHAIN]: 'zetachain',
[ChainId.CRONOS]: 'cronos',
[ChainId.BLAST]: 'blast',
[ChainId.FLARE]: 'flare',
} as const
export type ChainKey = (typeof ChainKey)[keyof typeof ChainKey]
34 changes: 23 additions & 11 deletions packages/sushi/src/chain/generated.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,28 @@ export default [
name: 'OP Mainnet',
shortName: 'oeth',
},
{
chainId: 14,
explorers: [
{
name: 'blockscout',
url: 'https://flare-explorer.flare.network',
standard: 'EIP3091',
},
{
name: 'flarescan',
url: 'https://mainnet.flarescan.com',
standard: 'EIP3091',
},
],
nativeCurrency: {
name: 'Flare',
symbol: 'FLR',
decimals: 18,
},
name: 'Flare Mainnet',
shortName: 'flr',
},
{
chainId: 25,
explorers: [
Expand Down Expand Up @@ -301,11 +323,6 @@ export default [
url: 'https://bobascan.com',
standard: 'none',
},
{
name: 'Blockscout',
url: 'https://blockexplorer.boba.network',
standard: 'none',
},
],
nativeCurrency: {
name: 'Ether',
Expand Down Expand Up @@ -745,7 +762,7 @@ export default [
explorers: [
{
name: 'Boba BNB block explorer',
url: 'https://blockexplorer.bnb.boba.network',
url: 'https://bobascan.com',
standard: 'none',
},
],
Expand Down Expand Up @@ -884,11 +901,6 @@ export default [
url: 'https://scrollscan.com',
standard: 'EIP3091',
},
{
name: 'Blockscout',
url: 'https://blockscout.scroll.io',
standard: 'EIP3091',
},
],
nativeCurrency: {
name: 'Ether',
Expand Down
21 changes: 20 additions & 1 deletion packages/sushi/src/config/bases-to-check-trades-against.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
import { ChainId } from '../chain/index.js'
import { MUSD, Token, USDB } from '../currency/index.js'
import {
ENOSYS_APS,
ENOSYS_BNZ,
ENOSYS_EETH,
ENOSYS_EQNT,
ENOSYS_HLN,
MUSD,
Token,
USDB,
} from '../currency/index.js'
import {
AAVE,
BUSD,
Expand Down Expand Up @@ -479,4 +488,14 @@ export const BASES_TO_CHECK_TRADES_AGAINST: {
USDC[ChainId.CRONOS],
],
[ChainId.BLAST]: [WNATIVE[ChainId.BLAST], USDB[ChainId.BLAST], MUSD],
[ChainId.FLARE]: [
WNATIVE[ChainId.FLARE],
WETH9[ChainId.FLARE],
USDT[ChainId.FLARE],
ENOSYS_BNZ,
ENOSYS_EQNT,
ENOSYS_HLN,
ENOSYS_APS,
ENOSYS_EETH,
],
}
1 change: 1 addition & 0 deletions packages/sushi/src/config/native-ids.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,5 @@ export const nativeCurrencyIds = {
[ChainId.ZETACHAIN]: 'ZETA',
[ChainId.CRONOS]: 'CRO',
[ChainId.BLAST]: 'ETH',
[ChainId.FLARE]: 'FLR',
} as const
4 changes: 4 additions & 0 deletions packages/sushi/src/config/route-processor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ export const ROUTE_PROCESSOR_3_SUPPORTED_CHAIN_IDS = [
ChainId.TELOS,
ChainId.THUNDERCORE,
ChainId.LINEA,
ChainId.FLARE,
] as const
export type RouteProcessor3ChainId =
(typeof ROUTE_PROCESSOR_3_SUPPORTED_CHAIN_IDS)[number]
Expand Down Expand Up @@ -169,6 +170,7 @@ export const ROUTE_PROCESSOR_3_ADDRESS: Record<
[ChainId.TELOS]: '0x80C7DD17B01855a6D2347444a0FCC36136a314de',
[ChainId.THUNDERCORE]: '0x1b9d177CcdeA3c79B6c8F40761fc8Dc9d0500EAa',
[ChainId.LINEA]: '0x0b17dF2CDEf8f0fCb7847e287726C6a8c1415A1f',
[ChainId.FLARE]: '0x9B3F1D56D9004e6C69d8247d402F38DE5F87A27c',
} as const
export const isRouteProcessor3ChainId = (
chainId: ChainId,
Expand Down Expand Up @@ -225,6 +227,7 @@ export const ROUTE_PROCESSOR_3_2_SUPPORTED_CHAIN_IDS = [
ChainId.SCROLL,
ChainId.FILECOIN,
ChainId.ZETACHAIN,
ChainId.FLARE,
] as const
export type RouteProcessor3_2ChainId =
(typeof ROUTE_PROCESSOR_3_2_SUPPORTED_CHAIN_IDS)[number]
Expand All @@ -251,6 +254,7 @@ export const ROUTE_PROCESSOR_3_2_ADDRESS: Record<
[ChainId.SCROLL]: '0xCA6Fe749878841b96F620Ec79638B13dAaD3D320',
[ChainId.FILECOIN]: '0xCdBCd51a5E8728E0AF4895ce5771b7d17fF71959',
[ChainId.ZETACHAIN]: '0xb46e319390De313B8cc95EA5aa30C7bBFD79Da94',
[ChainId.FLARE]: '0x5CeEe9F4F49C106D5Bc049C8D649C332E6d365ad',
} as const
export const isRouteProcessor3_2ChainId = (
chainId: ChainId,
Expand Down
1 change: 1 addition & 0 deletions packages/sushi/src/config/stables.ts
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ export const STABLES = {
],
[ChainId.CRONOS]: [USDC[ChainId.CRONOS]],
[ChainId.BLAST]: [USDB[ChainId.BLAST], MUSD],
[ChainId.FLARE]: [USDT[ChainId.FLARE]],
// TESTNETS
// [ChainId.RINKEBY]: [USDC[ChainId.RINKEBY]],
// [ChainId.ROPSTEN]: [
Expand Down
Loading

0 comments on commit 5858c6a

Please sign in to comment.