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

chore: add blast to chains not supporting multicall #291

Merged
merged 5 commits into from
Mar 9, 2024

Conversation

genaroibc
Copy link
Contributor

@genaroibc genaroibc commented Mar 9, 2024

Description

  • Add Fraxtal to chains not supporting multicall
  • Use custom multicall address to get balances

Type of change

  • Bug fix (non-breaking change which fixes an issue)

Evidence

Blast

Script to fetch balance for Blast:

import { Squid } from "@0xsquid/sdk";

(async () => {
  const squid = new Squid();

  squid.setConfig({
    baseUrl: "https://squid-api-git-feat-blast-0xsquid.vercel.app",
    integratorId: "squid-test"
  });

  await squid.init();

  const evmBalances = await squid.getAllEvmBalances({
    userAddress: "0xb13CD07B22BC5A69F8500a1Cb3A1b65618d50B22",
    chains: [81457]
  });

  console.log({
    evmBalances: evmBalances.filter(b => b.balance !== "0")
  });
})();

Before fix

Returns:

{
  evmBalances: [],
}

After fix

Returns:

{
  evmBalances: [
    {
      symbol: "ETH",
      address: "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",
      decimals: 18,
      balance: "6277774640826655",
      chainId: 81457,
    }, {
      symbol: "axlUSDC",
      address: "0xEB466342C4d449BC9f53A865D5Cb90586f405215",
      decimals: 6,
      balance: "259067",
      chainId: 81457,
    }
  ],
}

Fraxtal

Script

import { Squid } from "index";

(async () => {
  const squid = new Squid();

  squid.setConfig({
    baseUrl: "http://localhost:3000/api",
    integratorId: "squid-test"
  });

  await squid.init();

  const evmBalances = await squid.getAllEvmBalances({
    userAddress: "0xe743a49f04f2f77eb2d3b753ae3ad599de8cea84",
    chains: [252]
  });

  console.log({
    evmBalances: evmBalances.filter(b => b.balance !== "0")
  });
})();

Before fix

{
  evmBalances: [],
}

After fix

{
  evmBalances: [
    {
      address: "0xEB466342C4d449BC9f53A865D5Cb90586f405215",
      balance: "315014250496",
      decimals: 6,
      symbol: "axlUSDC",
      chainId: 252,
    }, {
      address: "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",
      balance: "1500000000000000000",
      decimals: 18,
      symbol: "frxETH",
      chainId: 252,
    }
  ],
}

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

@genaroibc genaroibc requested review from 0x0Koda and jmdev3 March 9, 2024 04:28
Copy link
Contributor

@ecdsafu ecdsafu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm

@odcey
Copy link
Contributor

odcey commented Mar 9, 2024

Updated the PR because frax doesn't need to be on the "multicall disabled" array
because ethereum-multicall uses multicall3
and fraxtal and blast are deployed there
https://www.multicall3.com/deployments

image

@odcey odcey merged commit f154178 into main Mar 9, 2024
1 check passed
@odcey odcey deleted the chore/update-chains-without-multicall branch March 9, 2024 22:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants