Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
b1e6f03
show xdai for usds
ilge-ustun May 12, 2025
653e64a
decimals fix
ilge-ustun May 13, 2025
514838c
usds bridge limits
ilge-ustun May 21, 2025
ffca268
useBridgeTx for dai and usds
ilge-ustun May 21, 2025
d5e0e0b
fix date-fns warning
ilge-ustun May 22, 2025
9c49acd
web3name fetching - add retry interval
ilge-ustun May 22, 2025
a7c99cf
token symbol
ilge-ustun May 25, 2025
05f96ea
fix validator icon
ilge-ustun May 25, 2025
9025ecf
executeSignatures
ilge-ustun May 25, 2025
d1430fb
claim button
ilge-ustun May 25, 2025
c5e53e8
subgraph handlers for usds/dai
ilge-ustun May 26, 2025
cffc082
Merge pull request #165 from gnosischain/feat/usds-upgrade-step1
ilge-ustun May 26, 2025
4c497f6
test sg
ilge-ustun May 28, 2025
68028d5
Merge pull request #166 from gnosischain/feat/usds-upgrade-step1
ilge-ustun May 28, 2025
7d8a6a5
fix sg config
ilge-ustun May 28, 2025
2900a9c
hide USDS token on GC
ilge-ustun May 28, 2025
330accb
Merge pull request #167 from gnosischain/feat/usds-upgrade-step1
ilge-ustun May 28, 2025
9aee5f8
sg eth config
ilge-ustun May 29, 2025
13b8788
Merge pull request #168 from gnosischain/develop
ilge-ustun May 29, 2025
3ffeebc
delete postinstall
ilge-ustun Jun 3, 2025
9a84707
delete logs
ilge-ustun Jun 3, 2025
a385cb3
add generated files
ilge-ustun Jun 3, 2025
133d472
Merge pull request #170 from gnosischain/fix/docker-build-sg
ilge-ustun Jun 3, 2025
b2e69fd
Merge pull request #171 from gnosischain/develop
ilge-ustun Jun 3, 2025
c64e185
delete generated
ilge-ustun Jun 9, 2025
31111b3
include back postinstall
ilge-ustun Jun 9, 2025
45a4354
add copy types
ilge-ustun Jun 9, 2025
d887015
Merge pull request #172 from gnosischain/fix/docker-build-sg
ilge-ustun Jun 9, 2025
fe76c1b
Merge pull request #173 from gnosischain/develop
ilge-ustun Jun 9, 2025
37a78cb
chore: use separate TheGraph API Key for Codegen (CODEGEN_CI_SUBGRAPH…
giacomognosis Jun 9, 2025
91bab4a
Revert "chore: use separate TheGraph API Key for Codegen (CODEGEN_CI_…
giacomognosis Jun 9, 2025
159fd82
Merge pull request #174 from gnosischain/develop
ilge-ustun Jun 9, 2025
bb1699c
add types to repo
ilge-ustun Jun 9, 2025
53a1fa6
Merge pull request #175 from gnosischain/fix/docker-build-sg
ilge-ustun Jun 9, 2025
592858f
Merge pull request #176 from gnosischain/develop
ilge-ustun Jun 9, 2025
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
4 changes: 2 additions & 2 deletions .github/workflows/oicd-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ on:
description: 'subgraph dev tag version for gc subgraph'
required: true
type: string
default: v1.0.1-develop
default: version/latest
dev_subgraph_mainnet:
description: 'subgraph dev tag version for mainnet subgraph'
required: true
type: string
default: v1.0.0-develop
default: version/latest

env:
AWS_REGION: 'eu-central-1'
Expand Down
8 changes: 4 additions & 4 deletions app/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
*.pem
tsconfig.tsbuildinfo
.eslintcache
types/generated/

# debug
npm-debug.log*
Expand All @@ -38,8 +37,9 @@ yarn-error.log*
# vercel
.vercel

#types
/types/typechain

#IDE files
/.idea


# types/generated/
# types/typechain/
4 changes: 1 addition & 3 deletions app/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,12 @@ COPY /src ./src
# Cleaning the cache of yarn
RUN yarn cache clean

RUN yarn install
RUN yarn postinstall
RUN yarn install

FROM base AS builder
WORKDIR /app
COPY --from=deps /app/node_modules ./node_modules
COPY --from=deps /app/src ./src
COPY --from=deps /app/types ./types
COPY . .

ENV NEXT_TELEMETRY_DISABLED 1
Expand Down
5 changes: 2 additions & 3 deletions app/docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
version: '3.8'
services:
web:
build:
Expand All @@ -8,6 +7,6 @@ services:
- .:/app
command: npm run dev
ports:
- "3000:3000"
- '3000:3000'
environment:
NODE_ENV: development
NODE_ENV: development
2 changes: 1 addition & 1 deletion app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"start": "next start",
"typechain": "typechain --target=ethers-v5 ./src/abis/**/*.json --out-dir ./types/typechain/",
"subgraph-codegen": "graphql-codegen --config ./subgraph-config.js",
"postinstall": "yarn typechain && yarn subgraph-codegen"
"postinstall-local": "yarn typechain && yarn subgraph-codegen"
},
"dependencies": {
"@babel/traverse": "^7.23.2",
Expand Down
38 changes: 37 additions & 1 deletion app/pages/api/tokens.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { NextApiRequest, NextApiResponse } from 'next'

import { NATIVE_TOKEN_ADDRESS } from '@/src/constants/config/common'
import { NATIVE_TOKEN_ADDRESS, USDS_ADDRESS } from '@/src/constants/config/common'
import { isSameString } from '@/src/utils/tools'
import { Token as BaseToken } from '@/types/token'
import bridgedTokens from '@/src/constants/bridged_tokens.json'
Expand Down Expand Up @@ -35,6 +35,7 @@ export default function handler(_: NextApiRequest, res: NextApiResponse<Array<To
const { address, decimals, foreign_address, icon_url, name, origin_chain_id, symbol } = token
const isWethOnXdai = isSameString(address, WETH_ON_XDAI)
const isDaiOnMainnet = isSameString(foreign_address, DAI_ON_MAINNET)
const isUsdsOnMainnet = isSameString(foreign_address, USDS_ADDRESS)
let extraTokens: Array<Token> = []

if (isDaiOnMainnet) {
Expand Down Expand Up @@ -107,6 +108,41 @@ export default function handler(_: NextApiRequest, res: NextApiResponse<Array<To
]
}

if (isUsdsOnMainnet) {
extraTokens = [
{
chainId: Number(origin_chain_id),
address: foreign_address,
decimals: Number(decimals),
logoURI: icon_url ?? undefined,
name: name.replace(bridgedTokenName, ''),
symbol,
extensions: {
bridgeInfo: {
100: {
tokenAddress: NATIVE_TOKEN_ADDRESS,
},
},
},
},
{
chainId: 100,
address: NATIVE_TOKEN_ADDRESS,
decimals: Number(decimals),
logoURI: icon_url ?? undefined,
name: 'xDai',
symbol: 'xDAI',
extensions: {
bridgeInfo: {
[origin_chain_id]: {
tokenAddress: foreign_address,
},
},
},
},
]
}

return [
{
chainId: Number(origin_chain_id),
Expand Down
170 changes: 170 additions & 0 deletions app/src/abis/ForeignBridgeRouter.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,170 @@
[
{ "inputs": [], "stateMutability": "nonpayable", "type": "constructor" },
{ "inputs": [], "name": "ClaimUsdsNotSupported", "type": "error" },
{ "inputs": [], "name": "InvalidInitialization", "type": "error" },
{ "inputs": [], "name": "NotInitializing", "type": "error" },
{
"inputs": [{ "internalType": "address", "name": "owner", "type": "address" }],
"name": "OwnableInvalidOwner",
"type": "error"
},
{
"inputs": [{ "internalType": "address", "name": "account", "type": "address" }],
"name": "OwnableUnauthorizedAccount",
"type": "error"
},
{
"anonymous": false,
"inputs": [{ "indexed": false, "internalType": "uint64", "name": "version", "type": "uint64" }],
"name": "Initialized",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{ "indexed": true, "internalType": "address", "name": "previousOwner", "type": "address" },
{ "indexed": true, "internalType": "address", "name": "newOwner", "type": "address" }
],
"name": "OwnershipTransferred",
"type": "event"
},
{
"inputs": [],
"name": "DAI",
"outputs": [{ "internalType": "address", "name": "", "type": "address" }],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "FOREIGN_AMB",
"outputs": [{ "internalType": "address", "name": "", "type": "address" }],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "FOREIGN_OMNIBRIDGE",
"outputs": [{ "internalType": "address", "name": "", "type": "address" }],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "FOREIGN_XDAIBRIDGE",
"outputs": [{ "internalType": "address", "name": "", "type": "address" }],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "USDS",
"outputs": [{ "internalType": "address", "name": "", "type": "address" }],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "WETH_OMNIBRIDGE_ROUTER",
"outputs": [{ "internalType": "address", "name": "", "type": "address" }],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{ "internalType": "bytes", "name": "message", "type": "bytes" },
{ "internalType": "bytes", "name": "signatures", "type": "bytes" }
],
"name": "executeSignatures",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{ "internalType": "bytes", "name": "message", "type": "bytes" },
{ "internalType": "bytes", "name": "signatures", "type": "bytes" }
],
"name": "executeSignaturesUSDS",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [{ "internalType": "address", "name": "owner", "type": "address" }],
"name": "initialize",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "owner",
"outputs": [{ "internalType": "address", "name": "", "type": "address" }],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{ "internalType": "address", "name": "token", "type": "address" },
{ "internalType": "address", "name": "recipient", "type": "address" },
{ "internalType": "uint256", "name": "amount", "type": "uint256" }
],
"name": "recoverLockedFund",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{ "internalType": "address", "name": "_token", "type": "address" },
{ "internalType": "address", "name": "_receiver", "type": "address" },
{ "internalType": "uint256", "name": "_amount", "type": "uint256" }
],
"name": "relayTokens",
"outputs": [],
"stateMutability": "payable",
"type": "function"
},
{
"inputs": [],
"name": "renounceOwnership",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{ "internalType": "bytes", "name": "message", "type": "bytes" },
{ "internalType": "bytes", "name": "signatures", "type": "bytes" }
],
"name": "safeExecuteSignaturesWithAutoGasLimit",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{ "internalType": "address", "name": "_token", "type": "address" },
{ "internalType": "address", "name": "_route", "type": "address" }
],
"name": "setRoute",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [{ "internalType": "address", "name": "", "type": "address" }],
"name": "tokenRoutes",
"outputs": [{ "internalType": "address", "name": "", "type": "address" }],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [{ "internalType": "address", "name": "newOwner", "type": "address" }],
"name": "transferOwnership",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
}
]
16 changes: 16 additions & 0 deletions app/src/constants/bridged_tokens.json
Original file line number Diff line number Diff line change
Expand Up @@ -9762,6 +9762,22 @@
"symbol": "UDT",
"total_supply": "9936213363153110036806",
"type": "ERC-20"
},
{
"bridge_type": "xdai",
"foreign_address": "0xdC035D45d973E3EC169d2276DDab16f1e407384F",
"origin_chain_id": "1",
"address": "",
"circulating_market_cap": null,
"decimals": "18",
"exchange_rate": null,
"holders": "2281",
"icon_url": null,
"is_bridged": true,
"name": "USDS",
"symbol": "USDS",
"total_supply": "3854025994000000000000000000",
"type": "ERC-20"
}
]
}
1 change: 1 addition & 0 deletions app/src/constants/config/chains.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export const chainsConfig: Record<ChainsValues, ChainConfig> = {
bridge: {
DAI: '0x6B175474E89094C44Da98b954EedeAC495271d0F',
wForeignNative: '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2', // WETH
USDS: '0xdc035d45d973e3ec169d2276ddab16f1e407384f',
},
},
// [Chains.chiado]: {
Expand Down
2 changes: 2 additions & 0 deletions app/src/constants/config/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,5 @@ export const WALLET_CONNECT_DAPP_URL = process.env.NEXT_PUBLIC_WALLET_CONNECT_DA
export const WALLET_CONNECT_PROJECT_ID = process.env.NEXT_PUBLIC_WALLET_CONNECT_PROJECT_ID || ''

export const NATIVE_TOKEN_ADDRESS = '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE'

export const USDS_ADDRESS = '0xdC035D45d973E3EC169d2276DDab16f1e407384F'
6 changes: 6 additions & 0 deletions app/src/constants/config/contracts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,12 @@ export const contracts = {
},
abi: AMBBridgeHelper_abi,
},
BridgeRouter: {
address: {
[Chains.mainnet]: '0x9a873656c19Efecbfb4f9FAb5B7acdeAb466a0B0',
[Chains.gnosis]: '',
},
},
} as const

export type ContractsKeys = keyof typeof contracts
1 change: 1 addition & 0 deletions app/src/constants/config/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export type ChainConfig = {
bridge: {
DAI: string
wForeignNative: string
USDS?: string
}
}

Expand Down
18 changes: 18 additions & 0 deletions app/src/constants/xdaiToken.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { Token } from '@/types/token'
import { getIcon } from '@/src/utils/icons'
import { NATIVE_TOKEN_ADDRESS, USDS_ADDRESS } from '@/src/constants/config/common'

export const xdaiToken: Token = {
chainId: 100,
address: '0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee',
decimals: 18,
logoURI: getIcon('xdai'),
name: 'xDAI',
symbol: 'xDAI',
extensions: {
bridgeInfo: {
1: { tokenAddress: USDS_ADDRESS },
100: { tokenAddress: NATIVE_TOKEN_ADDRESS },
},
},
}
Loading