Skip to content

Commit 85a83dd

Browse files
authored
Merge pull request #141 from gnosischain/feat/remove-not-omni-tokens
feat: block a list of tokens to deploy on GC && nextjs upgrade && RPC url for web3names
2 parents 199392b + bbdbe7f commit 85a83dd

File tree

8 files changed

+177
-58
lines changed

8 files changed

+177
-58
lines changed

app/.env.example

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ NEXT_PUBLIC_GA_MEASUREMENT_ID=
1313
NEXT_PUBLIC_POLLING_INTERVAL=10000
1414

1515
# RPCs
16-
NEXT_PUBLIC_RPC_MAINNET=https://rpc.ankr.com/eth
16+
NEXT_PUBLIC_RPC_MAINNET=
1717
NEXT_PUBLIC_RPC_GNOSIS=https://rpc.gnosischain.com
1818
NEXT_PUBLIC_RPC_CHIADO=https://rpc.chiadochain.net
1919

app/.yarn/install-state.gz

1.05 KB
Binary file not shown.

app/next-env.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
/// <reference types="next/image-types/global" />
33

44
// NOTE: This file should not be edited
5-
// see https://nextjs.org/docs/pages/building-your-application/configuring/typescript for more information.
5+
// see https://nextjs.org/docs/pages/api-reference/config/typescript for more information.

app/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
"graphql-tag": "^2.12.6",
4545
"loader-utils": "^2.0.4",
4646
"lodash": "^4.17.21",
47-
"next": "^15.0.3",
47+
"next": "15.2.3",
4848
"nextjs-google-analytics": "^1.2.0",
4949
"nullthrows": "^1.1.1",
5050
"polished": "^4.2.2",

app/src/hooks/useWeb3Name.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import useSWR from 'swr'
22
import { createWeb3Name } from '@web3-name-sdk/core'
33

4-
const web3name = createWeb3Name()
4+
const web3name = createWeb3Name({ rpcUrl: process.env.NEXT_PUBLIC_RPC_MAINNET })
55

66
interface UseWeb3NameProps {
77
address?: string

app/src/pagePartials/bridge/bridgeForm/index.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ import {
4747
import { UnifiedBridgeButton } from './button/UnifiedBridgeButton'
4848
import { useRouter } from 'next/router'
4949
import { useSanitizedQuery } from '@/src/hooks/useSanitizedQuery'
50+
import { isBlockedToken } from '@/src/utils/blocked-tokens'
5051

5152
const Title = styled.h2`
5253
align-items: center;
@@ -247,12 +248,13 @@ const Main = () => {
247248
})
248249

249250
const isNotBridgedErc20 =
250-
tokenOut?.chainId === 1 && tokenOut.extensions.bridgeInfo[1]?.tokenAddress === ZERO_ADDRESS
251+
(tokenOut?.chainId === 1 && tokenOut.extensions.bridgeInfo[1]?.tokenAddress === ZERO_ADDRESS) ||
252+
isBlockedToken(formState.token?.address || '')
251253
? true
252254
: false
253255

254-
// console.log('tokenIn', formState.token)
255-
// console.log('tokenOut', tokenOut)
256+
console.log('tokenIn', formState.token)
257+
console.log('tokenOut', tokenOut)
256258

257259
return (
258260
<Wrapper>

app/src/utils/blocked-tokens.ts

Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
interface BlockedToken {
2+
tokenOutAddress: string
3+
mediator: string
4+
mode: 'ERC677' | 'D-ERC20'
5+
}
6+
7+
const blockedTokens: Record<string, BlockedToken> = {
8+
// // OWL Token -> gnosis
9+
// '0x0905ab807f8fd040255f0cf8fa14756c1d824931': {
10+
// tokenOutAddress: '0x1a5f9352af8af974bfc03399e3767df6370d82e4',
11+
// mediator: '0xbed794745e2a0543ee609795ade87a55bbe935ba',
12+
// mode: 'ERC677',
13+
// },
14+
// OWL Token -> mainnet
15+
// '0x1a5f9352af8af974bfc03399e3767df6370d82e4': {
16+
// tokenOutAddress: '0x0905ab807f8fd040255f0cf8fa14756c1d824931',
17+
// mediator: '0xed7e6720Ac8525Ac1AEee710f08789D02cD87ecB',
18+
// mode: 'D-ERC20',
19+
// },
20+
// // Moon -> gnosis
21+
// '0x1e16aa4df73d29c029d94ceda3e3114ec191e25a': {
22+
// tokenOutAddress: '0xe1ca72ff3434b131765c62cbcbc26060f7aba03d',
23+
// mediator: '0xf75c28fe07e0647b05160288f172ad27cccd8f30',
24+
// mode: 'ERC677',
25+
// },
26+
// // Moon -> mainnet
27+
// '0xe1ca72ff3434b131765c62cbcbc26060f7aba03d': {
28+
// tokenOutAddress: '0x1e16aa4df73d29c029d94ceda3e3114ec191e25a',
29+
// mediator: '0xe7228b4ebad37ba031a8b63473727f991e262dcd',
30+
// mode: 'ERC677',
31+
// },
32+
// HNY -> gnosis
33+
// '0x71850b7e9ee3f13ab46d67167341e4bdc905eef9': {
34+
// tokenOutAddress: '0xc3589f56b6869824804a5ea29f2c9886af1b0fce',
35+
// mediator: '0x0eeacdb0dd96588711581c5f3173dd55841b8e91',
36+
// mode: 'D-ERC20',
37+
// },
38+
// HNY -> mainnet
39+
'0xc3589f56b6869824804a5ea29f2c9886af1b0fce': {
40+
tokenOutAddress: '0x71850b7e9ee3f13ab46d67167341e4bdc905eef9',
41+
mediator: '0x81a4833b3a40e7c61efe9d1a287343797993b1e8',
42+
mode: 'ERC677',
43+
},
44+
// DATA -> gnosis
45+
'0x256eb8a51f382650b2a1e946b8811953640ee47d': {
46+
tokenOutAddress: '0x8f693ca8d21b157107184d29d398a8d082b38b76',
47+
mediator: '0x53f3f44c434494da73ec44a6e8a8d091332bc2ce',
48+
mode: 'D-ERC20',
49+
},
50+
// DATA -> mainnet
51+
'0x8f693ca8d21b157107184d29d398a8d082b38b76': {
52+
tokenOutAddress: '0x256eb8a51f382650b2a1e946b8811953640ee47d',
53+
mediator: '0x29e572d45cc33d5a68dcc8f92bfc7ded0017bc59',
54+
mode: 'D-ERC20',
55+
},
56+
// XDATA -> gnosis
57+
'0xe4a2620ede1058d61bee5f45f6414314fdf10548': {
58+
tokenOutAddress: '0x0cf0ee63788a0849fe5297f3407f701e122cc023',
59+
mediator: '0x7d55f9981d4e10a193314e001b96f72fcc901e40',
60+
mode: 'D-ERC20',
61+
},
62+
// // XDATA -> mainnet
63+
// '0x0cf0ee63788a0849fe5297f3407f701e122cc023': {
64+
// tokenOutAddress: '0xe4a2620ede1058d61bee5f45f6414314fdf10548',
65+
// mediator: '0x2eeeddeece91c9f4c5ba4c8e1d784a0234c6d015',
66+
// mode: 'D-ERC20',
67+
// },
68+
69+
// AGVE -> gnosis
70+
// '0x3a97704a1b25f08aa230ae53b352e2e72ef52843': {
71+
// tokenOutAddress: '0x0b006e475620af076915257c6a9e40635abdbbad',
72+
// mediator: '0xbe20f60339b06db32c319d46cf3bc9bacc0694ab',
73+
// mode: 'D-ERC20',
74+
// },
75+
// AGVE -> mainnet
76+
'0x0b006e475620af076915257c6a9e40635abdbbad': {
77+
tokenOutAddress: '0x3a97704a1b25f08aa230ae53b352e2e72ef52843',
78+
mediator: '0x5689c65cfe5e8bf1a5f836c956dea1b3b8be00bb',
79+
mode: 'ERC677',
80+
},
81+
// // SWASH -> gnosis
82+
// '0x84e2c67cbefae6b5148fca7d02b341b12ff4b5bb': {
83+
// tokenOutAddress: '0xa130e3a33a4d84b04c3918c4e5762223ae252f80',
84+
// mediator: '0x68a64df7458a8eb2677991e657508fe00205332d',
85+
// mode: 'ERC677',
86+
// },
87+
// // SWASH -> mainnet
88+
// '0xa130e3a33a4d84b04c3918c4e5762223ae252f80': {
89+
// tokenOutAddress: '0x84e2c67cbefae6b5148fca7d02b341b12ff4b5bb',
90+
// mediator: '0xe964a36142bbe39751d0b4d6140fc0b8c48e68be',
91+
// mode: 'ERC677',
92+
// },
93+
// UDT -> gnosis
94+
'0x8c84142c4a716a16a89d0e61707164d6107a9811': {
95+
tokenOutAddress: '0x90de74265a416e1393a450752175aed98fe11517',
96+
mediator: '0x5f0fe58709639a39c193521d919afaef02e570f7',
97+
mode: 'ERC677',
98+
},
99+
// UDT -> mainnet
100+
'0x90de74265a416e1393a450752175aed98fe11517': {
101+
tokenOutAddress: '0x8c84142c4a716a16a89d0e61707164d6107a9811',
102+
mediator: '0x41a4ee2855a7dc328524babb07d7f505b201133e',
103+
mode: 'D-ERC20',
104+
},
105+
}
106+
107+
export const isBlockedToken = (address: string): boolean => {
108+
const normalizedAddress = address.toLowerCase()
109+
110+
if (normalizedAddress in blockedTokens) {
111+
return true
112+
}
113+
114+
return Object.values(blockedTokens).some(
115+
(token) => token.tokenOutAddress.toLowerCase() === normalizedAddress,
116+
)
117+
}

app/yarn.lock

Lines changed: 51 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -2864,10 +2864,10 @@ __metadata:
28642864
languageName: node
28652865
linkType: hard
28662866

2867-
"@next/env@npm:15.0.3":
2868-
version: 15.0.3
2869-
resolution: "@next/env@npm:15.0.3"
2870-
checksum: 10c0/63582fed80d6a28fff102c935095da71fd57ddf6b5f5d564e85ebdefdeb93298f7f7cf7d813c75b460c6627106717ea959b4c232939e7abb97d73d8b8467d4cd
2867+
"@next/env@npm:15.2.3":
2868+
version: 15.2.3
2869+
resolution: "@next/env@npm:15.2.3"
2870+
checksum: 10c0/52e60419f71b991bdab23fc23f05d221dfe07b725140a110eedc158b2612cebcaa71a74726e2f78b1d53ae162ae0a745fdc3263a2bc76eda013cac057a30f05e
28712871
languageName: node
28722872
linkType: hard
28732873

@@ -2880,58 +2880,58 @@ __metadata:
28802880
languageName: node
28812881
linkType: hard
28822882

2883-
"@next/swc-darwin-arm64@npm:15.0.3":
2884-
version: 15.0.3
2885-
resolution: "@next/swc-darwin-arm64@npm:15.0.3"
2883+
"@next/swc-darwin-arm64@npm:15.2.3":
2884+
version: 15.2.3
2885+
resolution: "@next/swc-darwin-arm64@npm:15.2.3"
28862886
conditions: os=darwin & cpu=arm64
28872887
languageName: node
28882888
linkType: hard
28892889

2890-
"@next/swc-darwin-x64@npm:15.0.3":
2891-
version: 15.0.3
2892-
resolution: "@next/swc-darwin-x64@npm:15.0.3"
2890+
"@next/swc-darwin-x64@npm:15.2.3":
2891+
version: 15.2.3
2892+
resolution: "@next/swc-darwin-x64@npm:15.2.3"
28932893
conditions: os=darwin & cpu=x64
28942894
languageName: node
28952895
linkType: hard
28962896

2897-
"@next/swc-linux-arm64-gnu@npm:15.0.3":
2898-
version: 15.0.3
2899-
resolution: "@next/swc-linux-arm64-gnu@npm:15.0.3"
2897+
"@next/swc-linux-arm64-gnu@npm:15.2.3":
2898+
version: 15.2.3
2899+
resolution: "@next/swc-linux-arm64-gnu@npm:15.2.3"
29002900
conditions: os=linux & cpu=arm64 & libc=glibc
29012901
languageName: node
29022902
linkType: hard
29032903

2904-
"@next/swc-linux-arm64-musl@npm:15.0.3":
2905-
version: 15.0.3
2906-
resolution: "@next/swc-linux-arm64-musl@npm:15.0.3"
2904+
"@next/swc-linux-arm64-musl@npm:15.2.3":
2905+
version: 15.2.3
2906+
resolution: "@next/swc-linux-arm64-musl@npm:15.2.3"
29072907
conditions: os=linux & cpu=arm64 & libc=musl
29082908
languageName: node
29092909
linkType: hard
29102910

2911-
"@next/swc-linux-x64-gnu@npm:15.0.3":
2912-
version: 15.0.3
2913-
resolution: "@next/swc-linux-x64-gnu@npm:15.0.3"
2911+
"@next/swc-linux-x64-gnu@npm:15.2.3":
2912+
version: 15.2.3
2913+
resolution: "@next/swc-linux-x64-gnu@npm:15.2.3"
29142914
conditions: os=linux & cpu=x64 & libc=glibc
29152915
languageName: node
29162916
linkType: hard
29172917

2918-
"@next/swc-linux-x64-musl@npm:15.0.3":
2919-
version: 15.0.3
2920-
resolution: "@next/swc-linux-x64-musl@npm:15.0.3"
2918+
"@next/swc-linux-x64-musl@npm:15.2.3":
2919+
version: 15.2.3
2920+
resolution: "@next/swc-linux-x64-musl@npm:15.2.3"
29212921
conditions: os=linux & cpu=x64 & libc=musl
29222922
languageName: node
29232923
linkType: hard
29242924

2925-
"@next/swc-win32-arm64-msvc@npm:15.0.3":
2926-
version: 15.0.3
2927-
resolution: "@next/swc-win32-arm64-msvc@npm:15.0.3"
2925+
"@next/swc-win32-arm64-msvc@npm:15.2.3":
2926+
version: 15.2.3
2927+
resolution: "@next/swc-win32-arm64-msvc@npm:15.2.3"
29282928
conditions: os=win32 & cpu=arm64
29292929
languageName: node
29302930
linkType: hard
29312931

2932-
"@next/swc-win32-x64-msvc@npm:15.0.3":
2933-
version: 15.0.3
2934-
resolution: "@next/swc-win32-x64-msvc@npm:15.0.3"
2932+
"@next/swc-win32-x64-msvc@npm:15.2.3":
2933+
version: 15.2.3
2934+
resolution: "@next/swc-win32-x64-msvc@npm:15.2.3"
29352935
conditions: os=win32 & cpu=x64
29362936
languageName: node
29372937
linkType: hard
@@ -4066,12 +4066,12 @@ __metadata:
40664066
languageName: node
40674067
linkType: hard
40684068

4069-
"@swc/helpers@npm:0.5.13":
4070-
version: 0.5.13
4071-
resolution: "@swc/helpers@npm:0.5.13"
4069+
"@swc/helpers@npm:0.5.15":
4070+
version: 0.5.15
4071+
resolution: "@swc/helpers@npm:0.5.15"
40724072
dependencies:
4073-
tslib: "npm:^2.4.0"
4074-
checksum: 10c0/b9df578401fc62405da9a6c31e79e447a2fd90f68b25b1daee12f2caf2821991bb89106f0397bc1acb4c4d84a8ce079d04b60b65f534496952e3bf8c9a52f40f
4073+
tslib: "npm:^2.8.0"
4074+
checksum: 10c0/33002f74f6f885f04c132960835fdfc474186983ea567606db62e86acd0680ca82f34647e8e610f4e1e422d1c16fce729dde22cd3b797ab1fd9061a825dabca4
40754075
languageName: node
40764076
linkType: hard
40774077

@@ -9631,7 +9631,7 @@ __metadata:
96319631
lint-staged: "npm:^12.3.5"
96329632
loader-utils: "npm:^2.0.4"
96339633
lodash: "npm:^4.17.21"
9634-
next: "npm:^15.0.3"
9634+
next: "npm:15.2.3"
96359635
nextjs-google-analytics: "npm:^1.2.0"
96369636
nullthrows: "npm:^1.1.1"
96379637
polished: "npm:^4.2.2"
@@ -12573,21 +12573,21 @@ __metadata:
1257312573
languageName: node
1257412574
linkType: hard
1257512575

12576-
"next@npm:^15.0.3":
12577-
version: 15.0.3
12578-
resolution: "next@npm:15.0.3"
12576+
"next@npm:15.2.3":
12577+
version: 15.2.3
12578+
resolution: "next@npm:15.2.3"
1257912579
dependencies:
12580-
"@next/env": "npm:15.0.3"
12581-
"@next/swc-darwin-arm64": "npm:15.0.3"
12582-
"@next/swc-darwin-x64": "npm:15.0.3"
12583-
"@next/swc-linux-arm64-gnu": "npm:15.0.3"
12584-
"@next/swc-linux-arm64-musl": "npm:15.0.3"
12585-
"@next/swc-linux-x64-gnu": "npm:15.0.3"
12586-
"@next/swc-linux-x64-musl": "npm:15.0.3"
12587-
"@next/swc-win32-arm64-msvc": "npm:15.0.3"
12588-
"@next/swc-win32-x64-msvc": "npm:15.0.3"
12580+
"@next/env": "npm:15.2.3"
12581+
"@next/swc-darwin-arm64": "npm:15.2.3"
12582+
"@next/swc-darwin-x64": "npm:15.2.3"
12583+
"@next/swc-linux-arm64-gnu": "npm:15.2.3"
12584+
"@next/swc-linux-arm64-musl": "npm:15.2.3"
12585+
"@next/swc-linux-x64-gnu": "npm:15.2.3"
12586+
"@next/swc-linux-x64-musl": "npm:15.2.3"
12587+
"@next/swc-win32-arm64-msvc": "npm:15.2.3"
12588+
"@next/swc-win32-x64-msvc": "npm:15.2.3"
1258912589
"@swc/counter": "npm:0.1.3"
12590-
"@swc/helpers": "npm:0.5.13"
12590+
"@swc/helpers": "npm:0.5.15"
1259112591
busboy: "npm:1.6.0"
1259212592
caniuse-lite: "npm:^1.0.30001579"
1259312593
postcss: "npm:8.4.31"
@@ -12597,8 +12597,8 @@ __metadata:
1259712597
"@opentelemetry/api": ^1.1.0
1259812598
"@playwright/test": ^1.41.2
1259912599
babel-plugin-react-compiler: "*"
12600-
react: ^18.2.0 || 19.0.0-rc-66855b96-20241106
12601-
react-dom: ^18.2.0 || 19.0.0-rc-66855b96-20241106
12600+
react: ^18.2.0 || 19.0.0-rc-de68d2f4-20241204 || ^19.0.0
12601+
react-dom: ^18.2.0 || 19.0.0-rc-de68d2f4-20241204 || ^19.0.0
1260212602
sass: ^1.3.0
1260312603
dependenciesMeta:
1260412604
"@next/swc-darwin-arm64":
@@ -12630,7 +12630,7 @@ __metadata:
1263012630
optional: true
1263112631
bin:
1263212632
next: dist/bin/next
12633-
checksum: 10c0/c5f6a57acb5f29063abc82d4d4417a048d0c2d5216d6ded6aa3fe32d60bb4835ed57dd34e2ef8fdda15579e97205820dc25bf34556b1d942a01a33d9ae7f88db
12633+
checksum: 10c0/d9f374d42e422b1fc6ef3499e46318b572717c4dd35db04c25bec3b998e693d927ec8edaa7aa819f71aae7ae74645f498184e08ad261e35baeeaac560e915b9c
1263412634
languageName: node
1263512635
linkType: hard
1263612636

@@ -15887,7 +15887,7 @@ __metadata:
1588715887
languageName: node
1588815888
linkType: hard
1588915889

15890-
"tslib@npm:^2.0.0, tslib@npm:^2.0.3, tslib@npm:^2.1.0, tslib@npm:^2.2.0, tslib@npm:^2.3.1, tslib@npm:^2.4.0, tslib@npm:^2.5.0, tslib@npm:^2.6.2, tslib@npm:^2.6.3, tslib@npm:^2.7.0, tslib@npm:^2.8.1":
15890+
"tslib@npm:^2.0.0, tslib@npm:^2.0.3, tslib@npm:^2.1.0, tslib@npm:^2.2.0, tslib@npm:^2.3.1, tslib@npm:^2.4.0, tslib@npm:^2.5.0, tslib@npm:^2.6.2, tslib@npm:^2.6.3, tslib@npm:^2.7.0, tslib@npm:^2.8.0, tslib@npm:^2.8.1":
1589115891
version: 2.8.1
1589215892
resolution: "tslib@npm:2.8.1"
1589315893
checksum: 10c0/9c4759110a19c53f992d9aae23aac5ced636e99887b51b9e61def52611732872ff7668757d4e4c61f19691e36f4da981cd9485e869b4a7408d689f6bf1f14e62

0 commit comments

Comments
 (0)