Skip to content
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

Better Decoding for EVM call #95

Open
0xSpuddy opened this issue Mar 14, 2024 · 0 comments
Open

Better Decoding for EVM call #95

0xSpuddy opened this issue Mar 14, 2024 · 0 comments

Comments

@0xSpuddy
Copy link
Contributor

0xSpuddy commented Mar 14, 2024

The front-end may be having trouble decoding EVM calls because contract functions can return different types. (Boolean, uint256, array, etc).

To get the values to decode properly may require detecting the type somehow? Here's an example report and what the data-feed shows now:

data reported:

queryData: 0x00000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000745564d43616c6c0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000001000000000000000000000000a663b02cf0a4b149d2ad41910cb81e23e1c41c320000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000000499530b0600000000000000000000000000000000000000000000000000000000
query ID: 0xc5b03b89242a5a72c29e03284d7ae9f58943e0fe4c15c7985e88faacfbf9b02e

The decoded value should be a uint256 with 18 decimals. It's function 27. pricePerShare at the sFRAX contract here: https://etherscan.io/address/0xA663B02CF0a4b149d2aD41910CB81e23e1c41c32#readContract

data-feed shows:
Screenshot 2024-03-14 at 1 53 41 PM

the value that was reported should decode to: 1021647436621648324 (uint256)
moving the decimal place it's 1.02

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant