import { formatUnits } from '@ethersproject/units' ; import { multicall } from '../../utils' ; export const author = '2fd' ; export const version = '0.1.0' ; const abi = [ 'function balanceOf(address account) external view returns (uint256)' ] ; export async function strategy ( space , network , provider , addresses , options , snapshot ) { const multipler = options . multiplier || 1 ; const blockTag = typeof snapshot === 'number' ? snapshot : 'latest' ; const response = await multicall ( network , provider , abi , addresses . map ( ( address ) => [ options . address , 'balanceOf' , [ address ] ] ) , { blockTag } ) ; return Object . fromEntries ( response . map ( ( value , i ) => [ addresses [ i ] , parseFloat ( formatUnits ( value . toString ( ) , 0 ) ) * multipler ] ) ) ; }