Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add native USDC to Baklava #120

Merged
merged 1 commit into from
Mar 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
25 changes: 25 additions & 0 deletions src/config/exchanges.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,32 @@ export const BaklavaExchanges: Exchange[] = [
'0x6f90ac394b1F45290d3023e4Ba0203005cAF2A4B',
],
},
{
providerAddr: '0xFF9a3da00F42839CD6D33AD7adf50bCc97B41411',
id: '0xd8573fd7c4151f38cde9b2349a26a6bb03be4b3791105bc625731ad2d71c54ba',
assets: [
'0x62492A644A588FD904270BeD06ad52B9abfEA1aE',
'0xB407D37d76c417B6343310D42611FCA106B2abB8',
],
},
{
providerAddr: '0xFF9a3da00F42839CD6D33AD7adf50bCc97B41411',
id: '0x3839dd748e34fa87f5cd928e10d3e0ecafd9230ac9932c6cb2b0d5a358b72618',
assets: [
'0xf9ecE301247aD2CE21894941830A2470f4E774ca',
'0xB407D37d76c417B6343310D42611FCA106B2abB8',
],
},
{
providerAddr: '0xFF9a3da00F42839CD6D33AD7adf50bCc97B41411',
id: '0xbfd96ed0ed5098d2b2bff8b9d8423dc47001fccf2391ee6e532618ef79c12075',
assets: [
'0x6a0EEf2bed4C30Dc2CB42fe6c5f01F80f7EF16d1',
'0xB407D37d76c417B6343310D42611FCA106B2abB8',
],
},
]

export const CeloExchanges: Exchange[] = [
{
providerAddr: '0x22d9db95E6Ae61c104A7B6F6C78D7993B94ec901',
Expand Down
18 changes: 13 additions & 5 deletions src/config/tokens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export enum TokenId {
cUSD = 'cUSD',
cEUR = 'cEUR',
cREAL = 'cREAL',
USDC = 'USDC',
axlUSDC = 'axlUSDC',
axlEUROC = 'axlEUROC',
eXOF = 'eXOF',
Expand Down Expand Up @@ -57,6 +58,13 @@ export const cREAL: Token = Object.freeze({
color: Color.celoGreen,
decimals: 18,
})
export const USDC: Token = Object.freeze({
id: TokenId.USDC,
symbol: TokenId.USDC,
name: 'USDC',
color: Color.usdcBlue,
decimals: 6,
})
export const axlUSDC: Token = Object.freeze({
id: TokenId.axlUSDC,
symbol: TokenId.axlUSDC,
Expand All @@ -76,7 +84,7 @@ export const eXOF: Token = Object.freeze({
id: TokenId.eXOF,
symbol: TokenId.eXOF,
name: 'eXOF',
color: Color.usdcBlue, // TODO: Change to EUROC
color: Color.usdcBlue,
decimals: 18,
})

Expand All @@ -85,6 +93,7 @@ export const Tokens: Record<TokenId, Token> = {
cUSD,
cEUR,
cREAL,
USDC,
axlUSDC,
axlEUROC,
eXOF,
Expand All @@ -96,6 +105,7 @@ export const TokenAddresses: Record<ChainId, Record<TokenId, Address>> = Object.
[TokenId.cUSD]: '0x874069Fa1Eb16D44d622F2e0Ca25eeA172369bC1',
[TokenId.cEUR]: '0x10c892A6EC43a53E45D0B916B4b7D383B1b78C0F',
[TokenId.cREAL]: '0xE4D517785D091D3c54818832dB6094bcc2744545',
[TokenId.USDC]: '',
[TokenId.axlUSDC]: '0x87D61dA3d668797786D73BC674F053f87111570d',
[TokenId.axlEUROC]: '0x6e673502c5b55F3169657C004e5797fFE5be6653',
[TokenId.eXOF]: '0xB0FA15e002516d0301884059c0aaC0F0C72b019D',
Expand All @@ -105,6 +115,7 @@ export const TokenAddresses: Record<ChainId, Record<TokenId, Address>> = Object.
[TokenId.cUSD]: '0x62492A644A588FD904270BeD06ad52B9abfEA1aE',
[TokenId.cEUR]: '0xf9ecE301247aD2CE21894941830A2470f4E774ca',
[TokenId.cREAL]: '0x6a0EEf2bed4C30Dc2CB42fe6c5f01F80f7EF16d1',
[TokenId.USDC]: '0xB407D37d76c417B6343310D42611FCA106B2abB8',
[TokenId.axlUSDC]: '0xD4079B322c392D6b196f90AA4c439fC2C16d6770',
[TokenId.axlEUROC]: '0x6f90ac394b1F45290d3023e4Ba0203005cAF2A4B',
[TokenId.eXOF]: '0x64c1D812673E93Bc036AdC3D547d9950696DA5Af',
Expand All @@ -114,16 +125,13 @@ export const TokenAddresses: Record<ChainId, Record<TokenId, Address>> = Object.
[TokenId.cUSD]: '0x765DE816845861e75A25fCA122bb6898B8B1282a',
[TokenId.cEUR]: '0xD8763CBa276a3738E6DE85b4b3bF5FDed6D6cA73',
[TokenId.cREAL]: '0xe8537a3d056DA446677B9E9d6c5dB704EaAb4787',
[TokenId.USDC]: '',
[TokenId.axlUSDC]: '0xEB466342C4d449BC9f53A865D5Cb90586f405215',
[TokenId.axlEUROC]: '0x061cc5a2C863E0C1Cb404006D559dB18A34C762d',
[TokenId.eXOF]: '0x73F93dcc49cB8A239e2032663e9475dd5ef29A08',
},
})

export function isUSDCVariant(tokenId: string) {
return USDCVariantIds.includes(tokenId as TokenId)
}

export function isNativeToken(tokenId: string) {
return Object.keys(Tokens).includes(tokenId)
}
Expand Down
10 changes: 6 additions & 4 deletions src/images/tokens/TokenIcon.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import Image from 'next/image'
import { memo } from 'react'
import { Token, TokenId, isUSDCVariant } from 'src/config/tokens'
import { Token, TokenId } from 'src/config/tokens'
import CeloIcon from 'src/images/tokens/CELO.svg'
import EUROCIcon from 'src/images/tokens/EUROC.svg'
import USDCIcon from 'src/images/tokens/USDC.svg'
import axlEUROCIcon from 'src/images/tokens/axlEUROC.svg'
import axlUSDCIcon from 'src/images/tokens/axlUSDC.svg'
import cEURIcon from 'src/images/tokens/cEUR.svg'
import cREALIcon from 'src/images/tokens/cREAL.svg'
import cUSDIcon from 'src/images/tokens/cUSD.svg'
Expand Down Expand Up @@ -34,8 +35,9 @@ function _TokenIcon({ token, size = 'm' }: Props) {
else if (token?.id === TokenId.cUSD) imgSrc = cUSDIcon
else if (token?.id === TokenId.cEUR) imgSrc = cEURIcon
else if (token?.id === TokenId.cREAL) imgSrc = cREALIcon
else if (isUSDCVariant(token?.id)) imgSrc = USDCIcon
else if (token?.id === TokenId.axlEUROC) imgSrc = EUROCIcon
else if (token?.id === TokenId.USDC) imgSrc = USDCIcon
else if (token?.id === TokenId.axlUSDC) imgSrc = axlUSDCIcon
else if (token?.id === TokenId.axlEUROC) imgSrc = axlEUROCIcon
else if (token?.id === TokenId.eXOF) imgSrc = eXOFIcon

if (imgSrc) {
Expand Down
6 changes: 5 additions & 1 deletion src/images/tokens/USDC.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
1 change: 1 addition & 0 deletions src/images/tokens/axlUSDC.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading