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

update ERC20Standard to use @metamask/abi-utils instead of @ethersproject/abi #985

Merged
merged 14 commits into from
Dec 21, 2022
Prev Previous commit
Next Next commit
lint
adonesky1 committed Dec 19, 2022
commit 55c90b738d1c79bc189dd0b381cb46f9955f0419
4 changes: 2 additions & 2 deletions packages/assets-controllers/src/Standards/ERC20Standard.ts
Original file line number Diff line number Diff line change
@@ -5,8 +5,8 @@ import { decodeSingle } from '@metamask/abi-utils';

import { Web3Provider } from '@ethersproject/providers';
import { ERC20 } from '@metamask/controller-utils';
import { ethersBigNumberToBN } from '../assetsUtil';
import { assertIsStrictHexString } from '@metamask/utils';
import { ethersBigNumberToBN } from '../assetsUtil';

export class ERC20Standard {
private provider: Web3Provider;
@@ -58,7 +58,7 @@ export class ERC20Standard {
// Signature for calling `symbol()`
const payload = { to: address, data: '0x95d89b41' };
const result = await this.provider.call(payload);
assertIsStrictHexString(result)
assertIsStrictHexString(result);
// Parse as string - treat empty string as failure
try {
return decodeSingle('string', result);