boostxyz / boost-protocol

A permissionless, trustless, and decentralized growth engine for protocol and application developers. It enables developers to bootstrap their projects by leveraging the power of community and the network effect.
https://boost-protocol.vercel.app
GNU General Public License v3.0
4 stars 2 forks source link

fix: UINT comparison not working #151

Closed mmackz closed 5 days ago

mmackz commented 1 week ago

Is there an existing issue for this?

Package Version

alpha.13

Current Behavior

When comparing UINT, the filterData has to be in hexadecimal form, and the fieldValue can be a bigInt.

For example, if we wanted to match a tokenId with the value of 3n, it would compare "0x03" with 3n which resolves to false.

Expected Behavior

Normalize the hexadecimal and field values so they can be compared properly.

Steps To Reproduce

Input a value as a hexadecimal string and have it compared to a field value that is a bigint.

CleanShot 2024-10-01 at 10 49 42@2x

Link to Minimal Reproducible Example (StackBlitz, CodeSandbox, GitHub repo etc.)

No response

Anything else?

No response

sammccord commented 1 week ago

i think we should run everything through https://viem.sh/docs/utilities/fromHex based on the primitive type before comparing

topocount commented 6 days ago

@sammccord I'm already working on this :grimacing: