-
Notifications
You must be signed in to change notification settings - Fork 477
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
fix decimal overflow issue #194
base: main
Are you sure you want to change the base?
Conversation
Pretty important PR, would be cool to have it merged. All Uniswap subgraphs are down because of this |
Our uniswap subgraphs are failed on multiple chains. Would greatly appreciate this fix 🙏 |
Are you sure this works? I'm getting build errors when trying to use this PR. decimalResult.value.kind == Ethereum.ValueKind.INT Property kind does not exist in type ethereum.Value. Is this branch dependent on a specific version in the package.lock? |
I
It is because you are on a different package version, you need to downgrade the apiVersion in your |
Everything the same on then than the addresses
…On Fri, Feb 2, 2024, 5:08 AM gs8nrv ***@***.***> wrote:
I
Are you sure this works?
I'm getting build errors when trying to use this PR.
decimalResult.value.kind == Ethereum.ValueKind.INT
Property kind does not exist in type ethereum.Value.
Is this branch dependent on a specific version in the package.lock?
It is because you are on a different package version
—
Reply to this email directly, view it on GitHub
<#194 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AYR4EL653NX6NZNCNZVUPZDYRS3JDAVCNFSM6AAAAABCNCCKDGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMRTGQ4DCMZSHE>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
I checked out the proposal, installed packages, ran codegen and tried building but I'm getting issues
|
seems that #206 fixed this |
Problem Scenario:
When the indexer attempts to call
try_decimals()
, if the decimal value exceeds uint8, the following error message will be triggered:Mapping aborted at ~lib/@graphprotocol/graph-ts/common/collections.ts, line 150, column 9, with message: overflow converting 0x0000000000000000000000000000000000000000000000000000000067e53c31 to i32\twasm backtrace:\t 0: 0x3ddd - <unknown>!~lib/@graphprotocol/graph-ts/chain/ethereum/ethereum.Value#toI32\t 1: 0x3ed9 - <unknown>!src/types/Factory/ERC20/ERC20#try_decimals
Fix Solution:
Check if the decimal value is of type int or uint, and verify whether it is less than the maximum value of uint8. If both conditions are met, return the correct value; otherwise, return null.