Skip to content

Commit 64206b4

Browse files
authored
feat: MGP12 token renaming (#98)
1 parent 1ae07f1 commit 64206b4

37 files changed

+1630
-1671
lines changed

README.md

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -30,25 +30,25 @@ Current token connectivity on Celo Mainnet (last updated: 2025-10-02):
3030
```mermaid
3131
graph TD
3232
USDT["USD₮"]
33-
USDC --- cUSD
34-
axlUSDC --- cUSD
35-
USDT --- cUSD
36-
cAUD --- cUSD
37-
cCAD --- cUSD
38-
CELO --- cUSD
39-
cGBP --- cUSD
40-
cUSD --- cZAR
41-
cCHF --- cUSD
42-
PUSO --- cUSD
43-
cJPY --- cUSD
44-
cCOP --- cUSD
45-
cREAL --- cUSD
46-
axlEUROC --- cEUR
47-
cEUR --- cUSD
48-
cGHS --- cUSD
49-
cNGN --- cUSD
50-
cKES --- cUSD
51-
cUSD --- eXOF
33+
USDC --- USDm
34+
axlUSDC --- USDm
35+
USDT --- USDm
36+
AUDm --- USDm
37+
CADm --- USDm
38+
CELO --- USDm
39+
GBPm --- USDm
40+
USDm --- ZARm
41+
CHFm --- USDm
42+
PHPm --- USDm
43+
JPYm --- USDm
44+
COPm --- USDm
45+
BRLm --- USDm
46+
axlEUROC --- EURm
47+
EURm --- USDm
48+
GHSm --- USDm
49+
NGNm --- USDm
50+
KESm --- USDm
51+
USDm --- XOFm
5252
```
5353

5454
**Network Stats:** 20 tokens, 19 direct trading pairs

TRADING_MODE_EXAMPLE.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,15 +122,15 @@ This method:
122122
### Multi-Hop Routes
123123

124124
The `isPairTradable()` method intelligently handles multi-hop routes. For example, if you want to swap CELO → USDT but there's no direct exchange, the route might be:
125-
- CELO → cUSD (hop 1)
126-
- cUSD → USDT (hop 2)
125+
- CELO → USDm (hop 1)
126+
- USDm → USDT (hop 2)
127127

128128
The method will check that **ALL** rate feeds in the path are in BIDIRECTIONAL mode. If any hop is HALTED or DISABLED, the entire pair is considered not tradable.
129129

130130
```typescript
131131
// Example: Multi-hop route check
132132
const isTradable = await mento.isPairTradable(celoAddress, usdtAddress)
133-
// Returns true ONLY if both CELO/cUSD AND cUSD/USDT rate feeds are BIDIRECTIONAL
133+
// Returns true ONLY if both CELO/USDm AND USDm/USDT rate feeds are BIDIRECTIONAL
134134
```
135135

136136
### Method Comparison

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@mento-protocol/mento-sdk",
33
"description": "Official SDK for interacting with the Mento Protocol",
4-
"version": "1.17.0",
4+
"version": "1.19.0",
55
"license": "MIT",
66
"author": "Mento Labs",
77
"keywords": [

scripts/breakerBox/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ A CLI tool for visualizing all circuit breaker configurations and their current
2222
yarn breakerBox
2323

2424
# Filter by token symbol
25-
yarn breakerBox --token cUSD
26-
yarn breakerBox --token=cUSD
27-
yarn breakerBox -t cUSD
25+
yarn breakerBox --token USDm
26+
yarn breakerBox --token=USDm
27+
yarn breakerBox -t USDm
2828

2929
# Connect to a specific RPC endpoint
3030
RPC_URL=https://your-rpc-url.com yarn breakerBox

scripts/breakerBox/index.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@ const RATEFEED_REVERSE_LOOKUP: Record<string, string> = CURRENCIES.reduce((acc,
3030
}, {} as Record<string, string>)
3131
}
3232
}, {
33-
["0x765DE816845861e75A25fCA122bb6898B8B1282a".toLocaleLowerCase()]: "cUSD (CELOUSD)",
34-
["0xD8763CBa276a3738E6DE85b4b3bF5FDed6D6cA73".toLocaleLowerCase()]: "cEUR (CELOEUR)",
35-
["0xe8537a3d056DA446677B9E9d6c5dB704EaAb4787".toLocaleLowerCase()]: "cREAL (CELOBRL)",
36-
["0x73F93dcc49cB8A239e2032663e9475dd5ef29A08".toLocaleLowerCase()]: "eXOF (CELOXOF)",
33+
["0x765DE816845861e75A25fCA122bb6898B8B1282a".toLocaleLowerCase()]: "USDm (CELOUSD)",
34+
["0xD8763CBa276a3738E6DE85b4b3bF5FDed6D6cA73".toLocaleLowerCase()]: "EURm (CELOEUR)",
35+
["0xe8537a3d056DA446677B9E9d6c5dB704EaAb4787".toLocaleLowerCase()]: "BRLm (CELOBRL)",
36+
["0x73F93dcc49cB8A239e2032663e9475dd5ef29A08".toLocaleLowerCase()]: "XOFm (CELOXOF)",
3737
})
3838

3939

scripts/breakerBox/utils/parseCommandLineArgs.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { parseNetworkArgs } from '../../shared/network'
33

44
/**
55
* Parse command line arguments using yargs-parser
6-
* Supports both "--token=cGHS" and "--token cGHS" formats, as well as short flags (-t, -e)
6+
* Supports both "--token=GHSm" and "--token GHSm" formats, as well as short flags (-t, -e)
77
* Also supports network selection via --network/-n and --chainId/-c flags
88
*
99
* @returns Object containing parsed arguments

scripts/cacheTokens/README.md

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ yarn cacheTokens
2121
### Cache tokens for specific chains
2222

2323
```bash
24-
yarn cacheTokens --chain-ids=42220,44787
24+
yarn cacheTokens --chain-ids=42220,11142220
2525
```
2626

2727
## Output
@@ -31,7 +31,6 @@ The script generates TypeScript files in `src/constants/`:
3131
**Individual token files (per chain):**
3232

3333
- `tokens.42220.ts` - Celo Mainnet tokens (readonly Token[])
34-
- `tokens.44787.ts` - Alfajores Testnet tokens (readonly Token[])
3534
- `tokens.11142220.ts` - Celo Sepolia Testnet tokens (readonly Token[])
3635

3736
**Main index file (dynamically generated):**
@@ -48,7 +47,7 @@ The script generates TypeScript files in `src/constants/`:
4847

4948
Everything is computed dynamically from blockchain data:
5049

51-
**Token enum** - Unique symbols across all chains (e.g., `TokenSymbol.CELO`, `TokenSymbol.cUSD`)
50+
**Token enum** - Unique symbols across all chains (e.g., `TokenSymbol.CELO`, `TokenSymbol.USDm`)
5251
**Address mappings** - Complete `TOKEN_ADDRESSES_BY_CHAIN` for all chains
5352
**Helper functions** - Type-safe address lookups and token search
5453
**Chain support** - Auto-detects supported chains from network config
@@ -59,7 +58,6 @@ Everything is computed dynamically from blockchain data:
5958
RPC URLs can be configured via environment variables:
6059

6160
- `CELO_RPC_URL` - Celo Mainnet RPC URL (default: <https://forno.celo.org>)
62-
- `ALFAJORES_RPC_URL` - Alfajores RPC URL (default: <https://alfajores-forno.celo-testnet.org>)
6361
- `CELO_SEPOLIA_RPC_URL` - Celo Sepolia RPC URL (default: <https://forno.celo-sepolia.celo-testnet.org>)
6462

6563
## When to Regenerate
@@ -74,13 +72,10 @@ Regenerate cached tokens when:
7472
## Example Output
7573

7674
```bash
77-
📡 Cache tokens for chain(s): 42220, 44787, 11142220
75+
📡 Cache tokens for chain(s): 42220, 11142220
7876
🔄 Generating tokens for chain 42220...
7977
✅ Successfully cached 20 tokens to tokens.42220.ts
8078

81-
🔄 Generating tokens for chain 44787...
82-
✅ Successfully cached 20 tokens to tokens.44787.ts
83-
8479
🔄 Generating tokens for chain 11142220...
8580
✅ Successfully cached 20 tokens to tokens.11142220.ts
8681

scripts/cacheTokens/cli.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export function parseCommandLineArgs(): CommandLineArgs {
2828
export function printUsageTips(): void {
2929
console.log('\n💡 Usage tips:')
3030
console.log(' - To cache tokens for specific chains:')
31-
console.log(' yarn cacheTokens --chain-ids=42220,44787')
31+
console.log(' yarn cacheTokens --chain-ids=42220,11142220')
3232
console.log(' - To cache tokens for all chains:')
3333
console.log(' yarn cacheTokens')
3434
}

scripts/cacheTokens/tokensIndexGenerator.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ export function generateTokensIndexFile(
6565
.map((chainId) => {
6666
const names: { [key: string]: string } = {
6767
'42220': 'Celo',
68-
'44787': 'Alfajores',
6968
'11142220': 'Celo Sepolia',
7069
}
7170
return `${chainId} (${names[chainId] || 'Unknown'})`

scripts/cacheTradablePairs/README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ The script can be run via the original entry point for backward compatibility:
3232
yarn cacheTradablePairs
3333

3434
# Cache specific network
35-
yarn cacheTradablePairs --network alfajores
3635
yarn cacheTradablePairs --network celo
3736

3837
# Cache specific chain ID
@@ -42,15 +41,14 @@ yarn cacheTradablePairs --chainId 42220
4241
Or directly via the modular entry point:
4342

4443
```bash
45-
npx ts-node scripts/cacheTradablePairs/index.ts --network alfajores
44+
npx ts-node scripts/cacheTradablePairs/index.ts --network celo
4645
```
4746

4847
## Output
4948

5049
The script generates TypeScript files in `src/constants/` with the format:
5150

5251
- `tradablePairs.42220.ts` (Celo mainnet)
53-
- `tradablePairs.44787.ts` (Alfajores testnet)
5452

5553
Each file contains:
5654

0 commit comments

Comments
 (0)