Skip to content

Commit e9cf2db

Browse files
committed
feat: remove full erc20 abi
1 parent fc73d7f commit e9cf2db

File tree

2 files changed

+18
-227
lines changed

2 files changed

+18
-227
lines changed

packages/access-control-conditions/src/lib/abis/ERC20.json

Lines changed: 0 additions & 224 deletions
This file was deleted.

packages/access-control-conditions/src/lib/humanizer.ts

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,25 @@ import {
1717
UnifiedAccessControlConditions,
1818
} from '@lit-protocol/types';
1919

20-
import ABI_ERC20 from './abis/ERC20.json';
21-
2220
const logger = pino({ level: 'info', name: 'humanizer' });
2321

22+
export const ERC20ABI = [
23+
{
24+
constant: true,
25+
inputs: [],
26+
name: 'decimals',
27+
outputs: [
28+
{
29+
name: '',
30+
type: 'uint8',
31+
},
32+
],
33+
payable: false,
34+
stateMutability: 'view',
35+
type: 'function',
36+
},
37+
];
38+
2439
/**
2540
*
2641
* Get the number of decimal places in a token
@@ -44,7 +59,7 @@ export const decimalPlaces = async ({
4459
skipFetchSetup: true,
4560
});
4661

47-
const contract = new Contract(contractAddress, ABI_ERC20.abi, web3); // TODO drop the full ABI and just define "decimals"
62+
const contract = new Contract(contractAddress, ERC20ABI, web3);
4863

4964
return await contract['decimals']();
5065
};

0 commit comments

Comments
 (0)