Skip to content

Commit

Permalink
magicswap: update eth and magic token data logic
Browse files Browse the repository at this point in the history
  • Loading branch information
alecananian committed Nov 29, 2024
1 parent c52cbd8 commit 4baee4b
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 6 deletions.
10 changes: 6 additions & 4 deletions packages/config/src/treasure-topaz.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,16 @@
"network": "topaz-testnet",
"burner_address": "0x0000000000000000000000000000000000000000",

"magic_address": "0x095ded714d42cbd5fb2e84a0ffbfb140e38dc9e1",

"magicswapv1_start_block": 1641,
"magicswapv1_uniswapv2_factory_address": "0x0000000000000000000000000000000000000000",
"magicswapv2_start_block": 1641,
"magicswapv2_nft_vault_factory_address": "0x0000000000000000000000000000000000000000",
"magicswapv2_nft_vault_factory_v2_address": "0x657c165eE78429c71D7D6d7dE6c0dBe39aD30817",
"magicswapv2_uniswapv2_factory_address": "0x129A3Fe403c94000A89136ABDffce7C98FbDaB8a",
"magicswapv2_router_address": "0xAd781eD13b5966E7c620B896B6340AbB4dd2ca86",
"magicswapv2_nft_vault_factory_v2_address": "0x657c165ee78429c71d7d6d7de6c0dbe39ad30817",
"magicswapv2_uniswapv2_factory_address": "0x129a3fe403c94000a89136abdffce7c98fbdab8a",
"magicswapv2_router_address": "0xad781ed13b5966e7c620b896b6340abb4dd2ca86",
"magicswapv2_staking_address": "0x0000000000000000000000000000000000000000",
"magic_usd_price_feed_address": "0x0000000000000000000000000000000000000000",
"weth_address": "0x095ded714d42cBD5fb2E84A0FfbFb140E38dC9E1"
"weth_address": "0x095ded714d42cbd5fb2e84a0ffbfb140e38dc9e1"
}
15 changes: 13 additions & 2 deletions subgraphs/magicswap/src/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,9 +156,20 @@ export const getOrCreateToken = (address: Address): Token => {
if (!token) {
token = new Token(address);
setTokenContractData(token);

if (address.equals(WETH_ADDRESS)) {
token.name = "Ether";
token.symbol = "ETH";
token.isETH = true;
}

if (address.equals(MAGIC_ADDRESS)) {
token.name = "MAGIC";
token.symbol = "MAGIC";
token.isMAGIC = true;
}

token.isNFT = false;
token.isMAGIC = address.equals(MAGIC_ADDRESS);
token.isETH = address.equals(WETH_ADDRESS);
token.volume = ZERO_BD;
token.volumeUSD = ZERO_BD;
token.txCount = ZERO_BI;
Expand Down

0 comments on commit 4baee4b

Please sign in to comment.