graph-tooling icon indicating copy to clipboard operation
graph-tooling copied to clipboard

Value of int256 in event may not be handled correctly in subgraph

Open krkzts opened this issue 3 years ago • 0 comments

What

If an output value of an event is int256, it may not be displayed correctly in subgraph. I would like to know how to solve this problem.

Detail

If an output value of an event is fffffffffffffffffffffffffffffffffffffffffffffffeaaace85f47b3e807(int256), it should be 1.15792089237316195423570985008687907853269984665640564039432988979944075028487e+77 in decimal number, but when actually checked by subgraph, it is -24595027969054611449. But in the case of 0000000000000000000000000000000000000000000000000039193f8be3676d, subgraph displays the correct value 16071834393077613. Why is the value not correct for fffffffffffffffffffffffffffffffffffffffffffffffeaaace85f47b3e807?

Supplement

I tried BigDecimal instead of BigInt, but that didn't solve the problem.

krkzts avatar Sep 25 '22 03:09 krkzts