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 $cCOP to alfajores #144

Merged
merged 2 commits into from
Oct 25, 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
21 changes: 21 additions & 0 deletions .github/workflows/check-branch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Prevent Non-Release/Non-Hotfix PRs to Main

on:
pull_request:
branches:
- main
pull_request_target:
branches:
- main

jobs:
check-target-branch:
if: github.base_ref == 'main'
runs-on: ubuntu-latest
steps:
- name: Check if the source branch is a release branch
run: |
if [[ "${{ github.head_ref }}" != release/* && "${{ github.head_ref }}" != hotfix/* ]]; then
echo "Only release and hotfix branches can be merged into the main branch."
exit 1
fi
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ name: ci
on:
# Triggers the workflow on push or pull request events but only for the main branch
push:
branches: [main]
branches: [main, dev]
pull_request:
branches: [main]
branches: [main, dev]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@mento-protocol/mento-web",
"version": "2.2.1",
"version": "2.2.2",
"description": "A simple DApp for Celo Mento exchanges",
"keywords": [
"Celo",
Expand Down
2 changes: 1 addition & 1 deletion src/components/input/Select.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export function Select({ value, optionValues, onChange, button, option, buttonLa
leaveFrom="opacity-100"
leaveTo="opacity-0"
>
<Listbox.Options className="absolute z-20 w-full py-1 mt-1 overflow-auto dark:bg-[#3F3F46] bg-white rounded-[8px] shadow-lg max-h-60 ring-1 ring-black ring-opacity-5 focus:outline-none border border-solid border-black">
<Listbox.Options className="absolute z-20 w-full py-1 mt-1 overflow-auto dark:bg-[#3F3F46] bg-white rounded-[8px] shadow-lg max-h-60 ring-1 ring-black ring-opacity-5 focus:outline-none border border-solid border-black sm:mobile-dropdown dropdown-menu">
{optionValues.map((optionValue) => (
<Listbox.Option
key={optionValue}
Expand Down
8 changes: 8 additions & 0 deletions src/config/exchanges.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,14 @@ export const AlfajoresExchanges: Exchange[] = [
'0x5E0E3c9419C42a1B04e2525991FB1A2C467AB8bF',
],
},
{
providerAddr: '0x9B64E8EaBD1a035b148cE970d3319c5C3Ad53EC3',
id: '0x1c9378bd0973ff313a599d3effc654ba759f8ccca655ab6d6ce5bd39a212943b',
assets: [
'0x874069Fa1Eb16D44d622F2e0Ca25eeA172369bC1',
'0xe6A57340f0df6E020c1c0a80bC6E13048601f0d4',
],
},
]

export const BaklavaExchanges: Exchange[] = [
Expand Down
13 changes: 13 additions & 0 deletions src/config/tokens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export enum TokenId {
eXOF = 'eXOF',
cKES = 'cKES',
PUSO = 'PUSO',
cCOP = 'cCOP',
}

export const NativeStableTokenIds = [TokenId.cUSD, TokenId.cEUR, TokenId.cREAL]
Expand Down Expand Up @@ -113,6 +114,14 @@ export const PUSO: Token = Object.freeze({
decimals: 18,
})

export const cCOP: Token = Object.freeze({
id: TokenId.cCOP,
symbol: TokenId.cCOP,
name: 'cCOP',
color: Color.usdcBlue,
decimals: 18,
})

export const Tokens: Record<TokenId, Token> = {
CELO,
cUSD,
Expand All @@ -125,6 +134,7 @@ export const Tokens: Record<TokenId, Token> = {
eXOF,
cKES,
PUSO,
cCOP,
}

export const TokenAddresses: Record<ChainId, Record<TokenId, Address>> = Object.freeze({
Expand All @@ -140,6 +150,7 @@ export const TokenAddresses: Record<ChainId, Record<TokenId, Address>> = Object.
[TokenId.eXOF]: '0xB0FA15e002516d0301884059c0aaC0F0C72b019D',
[TokenId.cKES]: '0x1E0433C1769271ECcF4CFF9FDdD515eefE6CdF92',
[TokenId.PUSO]: '0x5E0E3c9419C42a1B04e2525991FB1A2C467AB8bF',
[TokenId.cCOP]: '0xe6A57340f0df6E020c1c0a80bC6E13048601f0d4',
},
[ChainId.Baklava]: {
[TokenId.CELO]: '0xdDc9bE57f553fe75752D61606B94CBD7e0264eF8',
Expand All @@ -153,6 +164,7 @@ export const TokenAddresses: Record<ChainId, Record<TokenId, Address>> = Object.
[TokenId.eXOF]: '0x64c1D812673E93Bc036AdC3D547d9950696DA5Af',
[TokenId.cKES]: '0x8813Ae180017057d0Cf98C930cED1E7101B97370',
[TokenId.PUSO]: '',
[TokenId.cCOP]: '',
},
[ChainId.Celo]: {
[TokenId.CELO]: '0x471EcE3750Da237f93B8E339c536989b8978a438',
Expand All @@ -166,6 +178,7 @@ export const TokenAddresses: Record<ChainId, Record<TokenId, Address>> = Object.
[TokenId.eXOF]: '0x73F93dcc49cB8A239e2032663e9475dd5ef29A08',
[TokenId.cKES]: '0x456a3D042C0DbD3db53D5489e98dFb038553B0d0',
[TokenId.PUSO]: '0x105d4A9306D2E55a71d2Eb95B81553AE1dC20d7B',
[TokenId.cCOP]: '',
},
})

Expand Down
2 changes: 2 additions & 0 deletions src/images/tokens/TokenIcon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import USDCIcon from 'src/images/tokens/USDC.svg'
import USDTIcon from 'src/images/tokens/USDT.svg'
import axlEUROCIcon from 'src/images/tokens/axlEUROC.svg'
import axlUSDCIcon from 'src/images/tokens/axlUSDC.svg'
import cCOPIcon from 'src/images/tokens/cCOP.svg'
import cEURIcon from 'src/images/tokens/cEUR.svg'
import cKESIcon from 'src/images/tokens/cKES.svg'
import cREALIcon from 'src/images/tokens/cREAL.svg'
Expand Down Expand Up @@ -45,6 +46,7 @@ function _TokenIcon({ token, size = 'm' }: Props) {
else if (token?.id === TokenId.eXOF) imgSrc = eXOFIcon
else if (token?.id === TokenId.cKES) imgSrc = cKESIcon
else if (token?.id === TokenId.PUSO) imgSrc = PUSOIcon
else if (token?.id === TokenId.cCOP) imgSrc = cCOPIcon

if (imgSrc) {
return (
Expand Down
1 change: 1 addition & 0 deletions src/images/tokens/cCOP.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions src/styles/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -214,3 +214,14 @@ Toasts
--toastify-color-progress-warning: var(--toastify-color-warning);
--toastify-color-progress-error: var(--toastify-color-error);
}

@media (max-width: 640px) {
.dropdown-menu {
position: fixed !important;
bottom: auto !important;
top: auto !important;
max-height: 25vh !important;
width: 48% !important;
z-index: 9999 !important;
}
}
Loading